X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Foptions_display.php;h=1ddaeb0cc58253c0e62b0ef079dac15c114d5bcd;hb=dbcc5ca308317d7444f1322e661a65f269a31ec3;hp=ccb337dedbdf15e216fea93d75c5298bd0f601e9;hpb=cbe5423b30fd1c50b7dd9546778cbebf48804953;p=squirrelmail.git diff --git a/src/options_display.php b/src/options_display.php index ccb337de..1ddaeb0c 100644 --- a/src/options_display.php +++ b/src/options_display.php @@ -3,7 +3,7 @@ /** * options_display.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. * * Displays all optinos about display preferences @@ -18,7 +18,7 @@ define('SMOPT_GRP_MESSAGE', 2); /* Define the optpage load function for the display options page. */ function load_optpage_data_display() { - global $theme, $languages, $js_autodetect_results; + global $theme, $language, $languages, $js_autodetect_results; /* Build a simple array into which we will build options. */ $optgrps = array(); @@ -35,8 +35,10 @@ function load_optpage_data_display() { /* Load the theme option. */ $theme_values = array(); foreach ($theme as $theme_key => $theme_attributes) { - $theme_values[$theme_attributes['PATH']] = $theme_attributes['NAME']; + $theme_values[$theme_attributes['NAME']] = $theme_attributes['PATH']; } + ksort($theme_values); + $theme_values = array_flip($theme_values); $optvals[SMOPT_GRP_GENERAL][] = array( 'name' => 'chosen_theme', 'caption' => _("Theme"), @@ -46,12 +48,14 @@ function load_optpage_data_display() { 'save' => 'save_option_theme' ); + $language = (!isset($language) || ($language == '') ? 'en' : $language); $language_values = array(); foreach ($languages as $lang_key => $lang_attributes) { if (isset($lang_attributes['NAME'])) { $language_values[$lang_key] = $lang_attributes['NAME']; } } + asort($language_values); $optvals[SMOPT_GRP_GENERAL][] = array( 'name' => 'language', 'caption' => _("Language"), @@ -71,11 +75,10 @@ function load_optpage_data_display() { SMPREF_JS_OFF => _("Never")) ); - $js_autodetect_script = " - - "; + $js_autodetect_script = + "\n"; $js_autodetect_results = SMPREF_JS_OFF; $optvals[SMOPT_GRP_GENERAL][] = array( 'name' => 'js_autodetect_results',