10c9201c5db4104941120f15e2e3e5a07f5cd20b
2 /*=====================================================================*\
3 || ###################################################################
4 || # Bugdar [#]version[#]
5 || # Copyright ©2002-[#]year[#] Iris Studios, Inc.
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version [#]gpl[#] of the License.
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
22 require_once('./global.php');
23 require_once('./includes/settings.php');
24 require_once('./includes/functions_datastore.php');
26 NavLinks
::optionsPages();
27 $navigator->set_focus('tab', 'options', null
);
28 $navigator->set_focus('link', 'options-pages-settings', 'options-pages');
30 if (!can_perform('canadmintools'))
35 // ###################################################################
37 if (empty($_REQUEST['do']))
39 $_REQUEST['do'] = 'modify';
42 // ###################################################################
44 if ($_POST['do'] == 'update')
46 $settings = $_POST['setting'];
48 foreach ($settings AS $varname => $value)
50 $db->query("REPLACE INTO " . TABLE_PREFIX
. "setting (varname, value) VALUES ('" . $bugsys->escape($varname) . "', '" . $bugsys->escape($value) . "')");
55 $admin->redirect('setting.php');
58 // ###################################################################
60 if ($_REQUEST['do'] == 'modify')
62 $admin->page_start($lang->string('Settings'));
64 $admin->form_start('setting.php', 'update');
66 $settings = $db->query("SELECT * FROM " . TABLE_PREFIX
. "setting ");
67 while ($setting = $db->fetch_array($settings))
69 $options["$setting[varname]"] = $setting['value'];
74 unset($settings, $setting);
76 foreach ($config AS $varname => $setting)
78 $settings["$setting[0]"][] = $setting;
81 // Don't let them normal folk see what's going on ;-)
84 unset($settings['untouchables'], $define['untouchables']);
89 foreach ($define AS $group => $name)
91 $admin->table_start();
92 $admin->table_head($name);
93 foreach ($settings["$group"] AS $opt)
95 if (!isset($options["$opt[1]"]))
97 $options["$opt[1]"] = $opt[3];
100 $admin->row_span('<span' . ((DEVDEBUG
) ?
' title="$bugsys->options[\'' . $opt[1] . '\']"' : '') . "><strong>" . $opt[5] . "</strong></span>", 'thead');
104 $admin->row_input($opt[6], 'setting[' . $opt[1] . ']', $options["$opt[1]"]);
108 $admin->row_textarea($opt[6], 'setting[' . $opt[1] . ']', $options["$opt[1]"]);
112 $admin->list_item($lang->string('Yes'), '1', (($options["$opt[1]"]) ? true
: false
));
113 $admin->list_item($lang->string('No'), '0', (($options["$opt[1]"]) ? false
: true
));
114 $admin->row_list($opt[6], 'setting[' . $opt[1] . ']', false
);
118 eval('$optcode = "' . $opt[2] . '";');
119 $admin->row_text($opt[6], $optcode);
126 $admin->table_start();
127 $admin->row_submit();
134 /*=====================================================================*\
135 || ###################################################################
138 || ###################################################################
139 \*=====================================================================*/