]>
src.bluestatic.org Git - bugdar.git/blob - admin/setting.php
2 /*=====================================================================*\
3 || ################################################################### ||
4 || # BugStrike [#]version[#]
5 || # --------------------------------------------------------------- # ||
6 || # Copyright ©2002-[#]year[#] by Iris Studios, Inc. All Rights Reserved. # ||
7 || # This file may not be reproduced in any way without permission. # ||
8 || # --------------------------------------------------------------- # ||
9 || # User License Agreement at http://www.iris-studios.com/license/ # ||
10 || ################################################################### ||
11 \*=====================================================================*/
13 require_once('./global.php');
14 require_once('./includes/settings.php');
15 require_once('./includes/functions_datastore.php');
17 if (!can_perform('canadmintools'))
22 // ###################################################################
24 if (empty($_REQUEST['do']))
26 $_REQUEST['do'] = 'modify';
29 // ###################################################################
31 if ($_POST['do'] == 'update')
33 $settings = $_POST['setting'];
35 foreach ($settings AS $varname => $value)
37 $db->query("REPLACE INTO " . TABLE_PREFIX
. "setting (varname, value) VALUES ('" . $bugsys->escape($varname) . "', '" . $bugsys->escape($value) . "')");
42 $admin->redirect('setting.php');
45 // ###################################################################
47 if ($_REQUEST['do'] == 'modify')
49 $admin->page_start($lang->string('Settings'));
51 $admin->form_start('setting.php', 'update');
53 $settings = $db->query("SELECT * FROM " . TABLE_PREFIX
. "setting ");
54 while ($setting = $db->fetch_array($settings))
56 $options["$setting[varname]"] = $setting['value'];
61 unset($settings, $setting);
63 foreach ($config AS $varname => $setting)
65 $settings["$setting[0]"][] = $setting;
68 // Don't let them normal folk see what's going on ;-)
71 unset($settings['untouchables'], $define['untouchables']);
76 foreach ($define AS $group => $name)
78 $admin->table_start();
79 $admin->table_head($name);
80 foreach ($settings["$group"] AS $opt)
82 $admin->row_span('<span' . ((DEVDEBUG) ? ' title="$bugsys->options
[\'' . $opt[1] . '\'
]"' : '') . "><strong
>" . $opt[5] . "</strong
></span
>", 'thead');
86 $admin->row_input($opt[6], 'setting[' . $opt[1] . ']', $options["$opt[1]"]);
90 $admin->row_textarea($opt[6], 'setting[' . $opt[1] . ']', $options["$opt[1]"]);
94 if (!isset($options["$opt[1]"]))
96 $options["$opt[1]"] = $opt[3];
99 $admin->list_item($lang->string('Yes'), '1', (($options["$opt[1]"]) ? true : false));
100 $admin->list_item($lang->string('No'), '0', (($options["$opt[1]"]) ? false : true));
101 $admin->row_list($opt[6], 'setting[' . $opt[1] . ']', false);
105 eval('$optcode = "' . $opt[2] . '";');
106 $admin->row_text($opt[6], $optcode);
113 $admin->table_start();
114 $admin->row_submit();
121 /*=====================================================================*\
122 || ###################################################################
125 || ###################################################################
126 \*=====================================================================*/