User unknown Please correct the URL and try again.'); return; } register_html_resource('js', 'js/jquery.serializejson.min.js'); register_html_resource('js', 'clipboard.min.js'); register_html_resource('script', 'new Clipboard("#clipboard");'); $user_id = $_SESSION['user_id']; //$prefs = get_user_prefs($user_id); //r($prefs); // Load SQL config into $database_config //load_sqlconfig($database_config); load_user_config($database_config, $user_id); //r($database_config); // cache default and config.php-defined values $defined_config = get_defined_settings(); $default_config = get_default_settings(); echo '
' . PHP_EOL; echo ' ' . PHP_EOL; echo ' ' . PHP_EOL; //echo '
'; // Pretty inefficient looping everything if section != all, but meh // This is only done on this page, so there is no performance issue for the rest of Observium include($config['install_dir'] . '/includes/config-variables.inc.php'); // Loop all variables and build an array with sections, subsections and variables // This is only done on this page, so there is no performance issue for the rest of Observium $config_subsections = []; foreach ($config_variable as $varname => $variable) { if (isset($config_sections[$variable['section']]['edition']) && $config_sections[$variable['section']]['edition'] !== OBSERVIUM_EDITION) { // Skip sections not allowed for current Observium edition //r($config_sections[$variable['section']]); continue; } if (isset($variable['edition']) && $variable['edition'] !== OBSERVIUM_EDITION) { // Skip variable not allowed for current Observium edition //r($varname); //r($variable); continue; } if (isset($variable['useredit']) && $variable['useredit']) { // List only user editable settings $config_subsections[$variable['section']][$variable['subsection']][$varname] = $variable; } } //r($config_subsections); foreach ($config_subsections as $section => $subdata) { echo('
' . PHP_EOL); //if ($vars['section'] === 'all' || $vars['section'] === $section) { // When printing all, also print the section name $title = $config_sections[$section]['text'] . ' :: '; foreach ($subdata as $subsection => $vardata) { //echo '
'; //echo '

'.$subsection.'

'; echo generate_box_open(['title' => $title . $subsection, 'header-border' => FALSE, 'box-style' => 'margin-bottom: 30px; margin-top: 10px;', 'title-style' => 'padding: 15px 10px; color: #555; font-size: 21px;', 'title-element' => 'h2']); //echo generate_box_open(array('box-style' => 'margin-bottom: 30px; margin-top: 10px;')); echo '' . PHP_EOL; $cols = [ [NULL, 'class="state-marker"'], //array(NULL, 'style="width: 0px;"'), ['Description', 'style="width: 40%;"'], [NULL, 'style="width: 50px;"'], 'Configuration Value', [NULL, 'style="width: 75px;"'], //array(NULL, 'style="width: 10px;"'), ]; //echo(get_table_header($cols)); foreach ($vardata as $varname => $variable) { print_setting_row($varname, $variable); } echo('
' . PHP_EOL); echo generate_box_close(); } //echo('
' . PHP_EOL); //} echo('
' . PHP_EOL); } ?>
'hidden', 'id' => 'requesttoken', 'value' => $_SESSION['requesttoken']]; echo(generate_form_element($item) . PHP_EOL); $item = ['type' => 'submit', 'id' => 'submit', 'name' => 'Save Changes', 'class' => 'btn-primary', 'right' => TRUE, 'icon' => 'icon-ok icon-white', 'value' => 'save']; echo(generate_form_element($item) . PHP_EOL); ?>