set_focus('tab', 'options', null); $navigator->set_focus('link', 'options-pages-settings', 'options-pages'); if (!can_perform('canadmintools')) { admin_login(); } // ################################################################### if (empty($_REQUEST['do'])) { $_REQUEST['do'] = 'modify'; } // ################################################################### if ($_POST['do'] == 'update') { foreach ($bugsys->in['setting'] AS $varname => $value) { if (is_array($value)) { if ($varname == 'columnoptions') { $value = serialize($value); } else { $value = implode(',', $value); } } $db->query("REPLACE INTO " . TABLE_PREFIX . "setting (varname, value) VALUES ('" . $bugsys->escape($varname) . "', '" . $bugsys->escape($value) . "')"); } build_settings(); $admin->redirect('setting.php'); } // ################################################################### if ($_REQUEST['do'] == 'modify') { $admin->page_start(_('Settings')); $admin->form_start('setting.php', 'update'); $IS_SETTINGS = true; // Don't let them normal folk see what's going on ;-) if (!DEVDEBUG) { unset($settings['untouchables']); } $firstloop = true; foreach ($settings AS $group => $values) { foreach ($values AS $key => $options) { if ($key == ':lang') { if (!$firstloop) { $admin->table_end(); } $admin->table_start(); $admin->table_head($options); } else { $admin->row_span('" . $options[3] . "", 'thead'); switch ($options[0]) { case 'textbox': $admin->row_input($options[4], 'setting[' . $key . ']', $bugsys->options["$key"]); break; case 'textarea': $admin->row_textarea($options[4], 'setting[' . $key . ']', $bugsys->options["$key"]); break; case 'yesno': $admin->list_item(_('Yes'), '1', ($bugsys->options["$key"] ? true : false)); $admin->list_item(_('No'), '0', ($bugsys->options["$key"] ? false : true)); $admin->row_list($options[4], 'setting[' . $key . ']', false); break; default: eval('$optcode = "' . $options[0] . '";'); $admin->row_text($options[4], $optcode); break; } } } } $admin->table_end(); $admin->table_start(); $admin->row_submit(); $admin->table_end(); $admin->form_end(); $admin->page_end(); } /*=====================================================================*\ || ################################################################### || # $HeadURL$ || # $Id$ || ################################################################### \*=====================================================================*/ ?>