]> src.bluestatic.org Git - bugdar.git/blob - admin/setting.php
r496: Removing #submitrow from report.css to global.css
[bugdar.git] / admin / setting.php
1 <?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 \*=====================================================================*/
12
13 require_once('./global.php');
14 require_once('./includes/settings.php');
15 require_once('./includes/functions_datastore.php');
16
17 if (!can_perform('canadmintools'))
18 {
19 admin_login();
20 }
21
22 // ###################################################################
23
24 if (empty($_REQUEST['do']))
25 {
26 $_REQUEST['do'] = 'modify';
27 }
28
29 // ###################################################################
30
31 if ($_POST['do'] == 'update')
32 {
33 $settings = $_POST['setting'];
34
35 foreach ($settings AS $varname => $value)
36 {
37 $db->query("REPLACE INTO " . TABLE_PREFIX . "setting (varname, value) VALUES ('" . $bugsys->escape($varname) . "', '" . $bugsys->escape($value) . "')");
38 }
39
40 build_settings();
41
42 $admin->redirect('setting.php');
43 }
44
45 // ###################################################################
46
47 if ($_REQUEST['do'] == 'modify')
48 {
49 $admin->page_start($lang->string('Settings'));
50
51 $admin->form_start('setting.php', 'update');
52
53 $settings = $db->query("SELECT * FROM " . TABLE_PREFIX . "setting ");
54 while ($setting = $db->fetch_array($settings))
55 {
56 $options["$setting[varname]"] = $setting['value'];
57 }
58
59 $IS_SETTINGS = true;
60
61 unset($settings, $setting);
62
63 foreach ($config AS $varname => $setting)
64 {
65 $settings["$setting[0]"][] = $setting;
66 }
67
68 // Don't let them normal folk see what's going on ;-)
69 if (!DEVDEBUG)
70 {
71 unset($settings['untouchables'], $define['untouchables']);
72 }
73
74 unset($config);
75
76 foreach ($define AS $group => $name)
77 {
78 $admin->table_start();
79 $admin->table_head($name);
80 foreach ($settings["$group"] AS $opt)
81 {
82 $admin->row_span('<span' . ((DEVDEBUG) ? ' title="$bugsys->options[\'' . $opt[1] . '\']"' : '') . "><strong>" . $opt[5] . "</strong></span>", 'thead');
83 switch ($opt[2])
84 {
85 case 'textbox':
86 $admin->row_input($opt[6], 'setting[' . $opt[1] . ']', $options["$opt[1]"]);
87 break;
88
89 case 'textarea':
90 $admin->row_textarea($opt[6], 'setting[' . $opt[1] . ']', $options["$opt[1]"]);
91 break;
92
93 case 'yesno':
94 if (!isset($options["$opt[1]"]))
95 {
96 $options["$opt[1]"] = $opt[3];
97 }
98
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);
102 break;
103
104 default:
105 eval('$optcode = "' . $opt[2] . '";');
106 $admin->row_text($opt[6], $optcode);
107 break;
108 }
109 }
110 $admin->table_end();
111 }
112
113 $admin->table_start();
114 $admin->row_submit();
115 $admin->table_end();
116 $admin->form_end();
117
118 $admin->page_end();
119 }
120
121 /*=====================================================================*\
122 || ###################################################################
123 || # $HeadURL$
124 || # $Id$
125 || ###################################################################
126 \*=====================================================================*/
127 ?>