]>
src.bluestatic.org Git - bugdar.git/blob - admin/setting.php
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 if (!can_perform('canadmintools'))
31 // ###################################################################
33 if (empty($_REQUEST['do']))
35 $_REQUEST['do'] = 'modify';
38 // ###################################################################
40 if ($_POST['do'] == 'update')
42 $settings = $_POST['setting'];
44 foreach ($settings AS $varname => $value)
46 $db->query("REPLACE INTO " . TABLE_PREFIX
. "setting (varname, value) VALUES ('" . $bugsys->escape($varname) . "', '" . $bugsys->escape($value) . "')");
51 $admin->redirect('setting.php');
54 // ###################################################################
56 if ($_REQUEST['do'] == 'modify')
58 $admin->page_start($lang->string('Settings'));
60 $admin->form_start('setting.php', 'update');
62 $settings = $db->query("SELECT * FROM " . TABLE_PREFIX
. "setting ");
63 while ($setting = $db->fetch_array($settings))
65 $options["$setting[varname]"] = $setting['value'];
70 unset($settings, $setting);
72 foreach ($config AS $varname => $setting)
74 $settings["$setting[0]"][] = $setting;
77 // Don't let them normal folk see what's going on ;-)
80 unset($settings['untouchables'], $define['untouchables']);
85 foreach ($define AS $group => $name)
87 $admin->table_start();
88 $admin->table_head($name, 2, 'admin_settings_' . $group);
89 foreach ($settings["$group"] AS $opt)
91 $admin->row_span('<span' . ((DEVDEBUG) ? ' title="$bugsys->options
[\'' . $opt[1] . '\'
]"' : '') . "><strong
>" . $opt[5] . "</strong
></span
>", 'thead');
95 $admin->row_input($opt[6], 'setting[' . $opt[1] . ']', $options["$opt[1]"]);
99 $admin->row_textarea($opt[6], 'setting[' . $opt[1] . ']', $options["$opt[1]"]);
103 if (!isset($options["$opt[1]"]))
105 $options["$opt[1]"] = $opt[3];
108 $admin->list_item($lang->string('Yes'), '1', (($options["$opt[1]"]) ? true : false));
109 $admin->list_item($lang->string('No'), '0', (($options["$opt[1]"]) ? false : true));
110 $admin->row_list($opt[6], 'setting[' . $opt[1] . ']', false);
114 eval('$optcode = "' . $opt[2] . '";');
115 $admin->row_text($opt[6], $optcode);
122 $admin->table_start();
123 $admin->row_submit();
130 /*=====================================================================*\
131 || ###################################################################
134 || ###################################################################
135 \*=====================================================================*/