X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Foptions.php;h=d4aa8bc68d525e9be4b2c6d5dce8000a1cffca2c;hb=e080b080522c3d5802580a3d992bde91db98788f;hp=005aea7537e178d5ee9e49ee5e30f8d5a1046133;hpb=355861846a51d35efe50848869d680fd3b4a5316;p=squirrelmail.git diff --git a/functions/options.php b/functions/options.php index 005aea75..d4aa8bc6 100644 --- a/functions/options.php +++ b/functions/options.php @@ -3,7 +3,7 @@ /** * options.php * - * Copyright (c) 1999-2001 The SquirrelMail Development Team + * Copyright (c) 1999-2002 The SquirrelMail Project Team * Licensed under the GNU GPL. For full terms see the file COPYING. * * Functions needed to display the options pages. @@ -96,7 +96,7 @@ class SquirrelOption { } /* Set the default save function. */ - if ((type != SMOPT_TYPE_HIDDEN) && ($type != SMOPT_TYPE_COMMENT)) { + if (($type != SMOPT_TYPE_HIDDEN) && ($type != SMOPT_TYPE_COMMENT)) { $this->save_function = SMOPT_SAVE_DEFAULT; } else { $this->save_function = SMOPT_SAVE_NOOP; @@ -288,7 +288,7 @@ function save_option($option) { setPref($data_dir, $username, $option->name, $option->new_value); /* I do not know if this next line does any good. */ - $GLOBALS[$name] = $option->new_value; + $GLOBALS[$option->name] = $option->new_value; } function save_option_noop($option) { @@ -310,11 +310,6 @@ function create_hidden_element($name, $value) { return ($result); } - -function createOptionGroups($optgrps, $optvals) { - return create_option_groups($optgrps, $optvals); -} - function create_option_groups($optgrps, $optvals) { /* Build a simple array with which to start. */ $result = array(); @@ -377,14 +372,17 @@ function create_option_groups($optgrps, $optvals) { return ($result); } -function printOptionGroups($option_groups) { - print_option_groups($option_groups); -} - function print_option_groups($option_groups) { + /* Print each option group. */ foreach ($option_groups as $next_optgrp) { - echo '' - . $next_optgrp['name'] . "\n"; + /* If it is not blank, print the name for this option group. */ + if ($next_optgrp['name'] != '') { + echo '' + . $next_optgrp['name'] + . "\n"; + } + + /* Print each option in this option group. */ foreach ($next_optgrp['options'] as $option) { if ($option->type != SMOPT_TYPE_HIDDEN) { echo "\n"; @@ -396,6 +394,8 @@ function print_option_groups($option_groups) { echo $option->createHTMLWidget(); } } + + /* Print an empty row after this option group. */ echo " \n"; } }