X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Foptions.php;h=0137114c74023db4f98de46ff78893bb7a46e2aa;hb=ead50b42b38e393c2f25ac29042324ef32657939;hp=3ee2b62413a7f1e4db0b015ab8c649a4ce3abe0f;hpb=7350889b45590aee831ba1150ee94efb95b03992;p=squirrelmail.git diff --git a/functions/options.php b/functions/options.php index 3ee2b624..0137114c 100644 --- a/functions/options.php +++ b/functions/options.php @@ -1,15 +1,15 @@ save_function = SMOPT_SAVE_DEFAULT; } else { $this->save_function = SMOPT_SAVE_NOOP; @@ -163,7 +164,7 @@ class SquirrelOption { $result = $this->createWidget_Comment(); break; default: - $result = '' + $result = '' . sprintf(_("Option Type '%s' Not Found"), $this->type) . ''; } @@ -177,12 +178,21 @@ class SquirrelOption { function createWidget_String() { switch ($this->size) { - case SMOPT_SIZE_TINY: $width = 5; break; - case SMOPT_SIZE_SMALL: $width = 12; break; - case SMOPT_SIZE_LARGE: $width = 38; break; - case SMOPT_SIZE_HUGE: $width = 50; break; + case SMOPT_SIZE_TINY: + $width = 5; + break; + case SMOPT_SIZE_SMALL: + $width = 12; + break; + case SMOPT_SIZE_LARGE: + $width = 38; + break; + case SMOPT_SIZE_HUGE: + $width = 50; + break; case SMOPT_SIZE_NORMAL: - default: $width = 25; + default: + $width = 25; } $result = "name\" VALUE=\"$this->value\" SIZE=\"$width\">"; @@ -288,7 +298,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 +320,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 +382,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 +404,8 @@ function print_option_groups($option_groups) { echo $option->createHTMLWidget(); } } + + /* Print an empty row after this option group. */ echo " \n"; } }