X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Foptions.php;h=d2caed53031f4f136d65d1d25061d4942cfd1ffe;hb=e4cbfcc42b2774fd73dd72c69e1f6e92f7907c69;hp=3ee2b62413a7f1e4db0b015ab8c649a4ce3abe0f;hpb=7350889b45590aee831ba1150ee94efb95b03992;p=squirrelmail.git diff --git a/functions/options.php b/functions/options.php index 3ee2b624..d2caed53 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; @@ -144,7 +145,7 @@ class SquirrelOption { case SMOPT_TYPE_STRLIST: $result = $this->createWidget_StrList(); break; - case SMOPT_TYPE_TEXTAREA: + case SMOPT_TYPE_textarea: $result = $this->createWidget_TextArea(); break; case SMOPT_TYPE_INTEGER: @@ -163,9 +164,9 @@ class SquirrelOption { $result = $this->createWidget_Comment(); break; default: - $result = '' + $result = '' . sprintf(_("Option Type '%s' Not Found"), $this->type) - . ''; + . ''; } /* Add the script for this option. */ @@ -177,41 +178,50 @@ 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\">"; + $result = "name\" value=\"$this->value\" size=\"$width\">"; return ($result); } function createWidget_StrList() { /* Begin the select tag. */ - $result = "'; return ($result); } @@ -224,8 +234,8 @@ class SquirrelOption { case SMOPT_SIZE_NORMAL: default: $rows = 5; $cols = 50; } - $result = ""; + $result = ""; return ($result); } @@ -240,21 +250,21 @@ class SquirrelOption { function createWidget_Boolean() { /* Do the whole current value thing. */ if ($this->value != SMPREF_NO) { - $yes_chk = ' CHECKED'; + $yes_chk = ' checked'; $no_chk = ''; } else { $yes_chk = ''; - $no_chk = ' CHECKED'; + $no_chk = ' checked'; } /* Build the yes choice. */ - $yes_option = ' " + $yes_option = ' " . _("Yes"); /* Build the no choice. */ - $no_option = ' " + $no_option = ' " . _("No"); /* Build and return the combined "boolean widget". */ @@ -263,8 +273,8 @@ class SquirrelOption { } function createWidget_Hidden() { - $result = ''; + $result = ''; return ($result); } @@ -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) { @@ -304,17 +314,12 @@ function create_optmode_element($optmode) { } function create_hidden_element($name, $value) { - $result = ''; + $result = ''; 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,32 +382,42 @@ 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 '