]>
src.bluestatic.org Git - bugdar.git/blob - options.php
3d5227de42342321af5a281605859d25ba5eacb6
2 /*=====================================================================*\
3 || ################################################################### ||
4 || # Renapsus [#]version[#]
5 || # --------------------------------------------------------------- # ||
6 || # All parts of this file are ©2003-[#]year[#] Iris Studios, Inc. No # ||
7 || # part of this file may be reproduced in any way: part or whole. # ||
8 || # --------------------------------------------------------------- # ||
9 || # ©2003 - [#]year[#] Iris Studios, Inc. | http://www.iris-studios.com # ||
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_sql->query("REPLACE INTO " . TABLE_PREFIX
. "setting (varname, value) VALUES ('" . addslasheslike(trim($varname)) . "', '" . addslasheslike(trim($value)) . "')");
42 $admin->redirect('options.php');
45 // ###################################################################
47 if ($_REQUEST['do'] == 'modify')
49 $admin->page_start('Options');
51 $admin->form_start('options.php', 'update');
53 $settings = $DB_sql->query("SELECT * FROM " . TABLE_PREFIX
. "setting ");
54 while ($setting = $DB_sql->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)
78 $admin->table_start();
79 $admin->table_head(phrase('settinggroup_' . $group));
80 foreach ($settings["$group"] AS $opt)
82 $admin->row_span('<span' . iff(DEVDEBUG, ' title="$bugsys->options
[\'' . $opt[1] . '\'
]"') . "><strong
>" . phrase('setting_' . $opt[1] . '_title') . "</strong
></span
>", 'thead');
86 $admin->row_input(phrase('setting_' . $opt[1] . '_desc'), 'setting[' . $opt[1] . ']', $options["$opt[1]"]);
90 if (!isset($options["$opt[1]"]))
92 $options["$opt[1]"] = $opt[3];
95 $admin->list_item(phrase('yes'), '1', iff($options["$opt[1]"], true, false));
96 $admin->list_item(phrase('no'), '0', iff($options["$opt[1]"], false, true));
97 $admin->row_list(phrase('setting_' . $opt[1] . '_desc'), 'setting[' . $opt[1] . ']', false);
101 eval('$optcode = "' . $opt[2] . '";');
102 $admin->row_text(phrase('setting_' . $opt[1] . '_desc'), $optcode);
109 $admin->table_start();
110 $admin->row_submit();
117 /*=====================================================================*\
118 || ###################################################################
121 || ###################################################################
122 \*=====================================================================*/