From d20713facbd004ca73bc3268d74dffc6f8252061 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Thu, 29 Jun 2006 21:48:25 +0000 Subject: [PATCH] r880: If the record doesn't exist for the setting, create a default value --- admin/setting.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/admin/setting.php b/admin/setting.php index b02a2db..3d3b6cc 100755 --- a/admin/setting.php +++ b/admin/setting.php @@ -88,6 +88,11 @@ if ($_REQUEST['do'] == 'modify') $admin->table_head($name, 2, 'admin_settings_' . $group); foreach ($settings["$group"] AS $opt) { + if (!isset($options["$opt[1]"])) + { + $options["$opt[1]"] = $opt[3]; + } + $admin->row_span('" . $opt[5] . "", 'thead'); switch ($opt[2]) { @@ -99,12 +104,7 @@ if ($_REQUEST['do'] == 'modify') $admin->row_textarea($opt[6], 'setting[' . $opt[1] . ']', $options["$opt[1]"]); break; - case 'yesno': - if (!isset($options["$opt[1]"])) - { - $options["$opt[1]"] = $opt[3]; - } - + case 'yesno': $admin->list_item($lang->string('Yes'), '1', (($options["$opt[1]"]) ? true : false)); $admin->list_item($lang->string('No'), '0', (($options["$opt[1]"]) ? false : true)); $admin->row_list($opt[6], 'setting[' . $opt[1] . ']', false); -- 2.22.5