From 5ba5dc8e820c4f821073fecb16b33a036a1cf594 Mon Sep 17 00:00:00 2001 From: tokul Date: Sat, 6 Aug 2005 06:01:49 +0000 Subject: [PATCH] removing $available_languages option git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@9916 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- ChangeLog | 4 +++ config/conf.pl | 50 +++++++-------------------- config/config_default.php | 13 ------- include/options/display.php | 57 +++++++++++-------------------- plugins/administrator/defines.php | 8 ++--- 5 files changed, 40 insertions(+), 92 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8c6b47ab..fd5c4ab8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -418,6 +418,10 @@ Version 1.5.1 -- CVS - Translations are loaded automatically from locale//setup.php files (#1240889). - Allow configure to be ran from any directory, thanks Ceri Davies. + - Removed $available_languages configuration option. List is limited to + installed translations. Similar feature is implemented in limit_languages + plugin. + - Don't load plugins/administrator/auth.php during plugin initiation. Version 1.5.0 - 2 February 2004 ------------------------------- diff --git a/config/conf.pl b/config/conf.pl index 3705d583..24626032 100755 --- a/config/conf.pl +++ b/config/conf.pl @@ -339,7 +339,9 @@ $skip_SM_header = 'false' if ( !$skip_SM_header ); $default_use_javascript_addr_book = 'false' if (! $default_use_javascript_addr_book); # since 1.5.0 $show_alternative_names = 'false' if ( !$show_alternative_names ); -$available_languages = 'all' if ( !$available_languages ); +# $available_languages option available only in 1.5.0. removed due to $languages +# implementation changes. options are provided by limit_languages plugin +# $available_languages = 'all' if ( !$available_languages ); $aggressive_decoding = 'false' if ( !$aggressive_decoding ); $advanced_tree = 'false' if ( !$advanced_tree ); $use_php_recode = 'false' if ( !$use_php_recode ); @@ -621,9 +623,8 @@ while ( ( $command ne "q" ) && ( $command ne "Q" ) && ( $command ne ":q" ) ) { print "1. Default Language : $WHT$squirrelmail_default_language$NRM\n"; print "2. Default Charset : $WHT$default_charset$NRM\n"; print "3. Show alternative language names : $WHT$show_alternative_names$NRM\n"; - print "4. Available languages : $WHT$available_languages$NRM\n"; - print "5. Enable aggressive decoding : $WHT$aggressive_decoding$NRM\n"; - print "6. Enable lossy encoding : $WHT$lossy_encoding$NRM\n"; + print "4. Enable aggressive decoding : $WHT$aggressive_decoding$NRM\n"; + print "5. Enable lossy encoding : $WHT$lossy_encoding$NRM\n"; print "\n"; print "R Return to Main Menu\n"; } elsif ( $menu == 11 ) { @@ -788,11 +789,10 @@ while ( ( $command ne "q" ) && ( $command ne "Q" ) && ( $command ne ":q" ) ) { elsif ( $command == 11 ) { $addrbook_global_listing = command911(); } } elsif ( $menu == 10 ) { if ( $command == 1 ) { $squirrelmail_default_language = commandA1(); } - elsif ( $command == 2 ) { $default_charset = commandA2(); } + elsif ( $command == 2 ) { $default_charset = commandA2(); } elsif ( $command == 3 ) { $show_alternative_names = commandA3(); } - elsif ( $command == 4 ) { $available_languages = commandA4(); } - elsif ( $command == 5 ) { $aggressive_decoding = commandA5(); } - elsif ( $command == 6 ) { $lossy_encoding = commandA6(); } + elsif ( $command == 4 ) { $aggressive_decoding = commandA4(); } + elsif ( $command == 5 ) { $lossy_encoding = commandA5(); } } elsif ( $menu == 11 ) { if ( $command == 1 ) { $advanced_tree = commandB1(); } if ( $command == 2 ) { $use_iframe = commandB2(); } @@ -3110,9 +3110,8 @@ sub commandA2 { # Alternative language names sub commandA3 { print "Enable this option if you want to see localized language names in\n"; - print "language selection box. Note, that if don't limit list of available\n"; - print "languages, this option can trigger installation of foreign language\n"; - print "support modules in some browsers.\n"; + print "language selection box. Note, that this option can trigger\n"; + print "installation of foreign language support modules in some browsers.\n"; print "\n"; if ( lc($show_alternative_names) eq 'true' ) { @@ -3129,30 +3128,9 @@ sub commandA3 { } return $show_alternative_names; } -# Available languages -sub commandA4 { - print "This option allows to limit number of languages available in\n"; - print "language selection box. You can enter as code of every language that\n"; - print "you want to enable. Language codes should be separated by space. If you\n"; - print "enter name unsupported by SquirrelMail, it will be ignored. If you enter\n"; - print "special key \'all\' - all languages available in SquirrelMail will be\n"; - print "listed. If you enter special key \'none\' - user won't be able to change"; - print "language and interface will use language set it \"Default language\" option.\n"; - print "\n"; - print "You can find valid language names in doc/i18n.txt.\n"; - print "\n"; - print "[$WHT$available_languages$NRM]: $WHT"; - $new_available_languages = ; - if ( $new_available_languages eq "\n" ) { - $new_available_languages = $available_languages; - } else { - $new_available_languages =~ s/[\r\n]//g; - $new_available_languages =~ s/^\s+$//g; - } - return $new_available_languages; -} + # Aggressive decoding -sub commandA5 { +sub commandA4 { print "Enable this option if you want to use CPU and memory intensive decoding\n"; print "functions. This option allows reading multibyte charset, that are used\n"; print "in Eastern Asia. SquirrelMail will try to use recode functions here,\n"; @@ -3175,7 +3153,7 @@ sub commandA5 { } # Lossy encoding -sub commandA6 { +sub commandA5 { print "Enable this option if you want to allow lossy charset encoding in message\n"; print "composition pages. This option allows charset conversions when output\n"; print "charset does not support all symbols used in original charset. Symbols\n"; @@ -3391,8 +3369,6 @@ sub save_data { print CF "\$default_charset = '$default_charset';\n"; # boolean print CF "\$show_alternative_names = $show_alternative_names;\n"; - # string - print CF "\$available_languages = '$available_languages';\n"; # boolean print CF "\$aggressive_decoding = $aggressive_decoding;\n"; # boolean diff --git a/config/config_default.php b/config/config_default.php index daa82649..3941f40e 100644 --- a/config/config_default.php +++ b/config/config_default.php @@ -895,19 +895,6 @@ $squirrelmail_default_language = 'en_US'; */ $default_charset = 'iso-8859-1'; -/** - * Available Languages - * - * This option controls number of languages available to end user in - * language selection preferences. You can use space separated list - * of translations installed in locale/ directory or special keys - * 'all' (all languages are available) and 'none' (language selection - * is disabled, interface is set to $squirrelmail_default_language - * @global string $available_languages - * @since 1.5.0 - */ -$available_languages = 'all'; - /** * Alternative Language Names Control * diff --git a/include/options/display.php b/include/options/display.php index 31c5122f..1a8bf608 100644 --- a/include/options/display.php +++ b/include/options/display.php @@ -52,7 +52,7 @@ if (! isset($use_iframe)) $use_iframe=false; function load_optpage_data_display() { global $theme, $language, $languages, $default_use_mdn, $squirrelmail_language, $allow_thread_sort, - $show_alternative_names, $available_languages, $use_icons, $use_iframe; + $show_alternative_names, $use_icons, $use_iframe; /* Build a simple array into which we will build options. */ $optgrps = array(); @@ -106,51 +106,32 @@ function load_optpage_data_display() { } - // config.php can be unupdated. - if (! isset($available_languages) || $available_languages=="" ) { - $available_languages="ALL"; } - $language_values = array(); - if ( strtoupper($available_languages)=='ALL') { - foreach ($languages as $lang_key => $lang_attributes) { - if (isset($lang_attributes['NAME'])) { - $language_values[$lang_key] = $lang_attributes['NAME']; - if ( isset($show_alternative_names) && - $show_alternative_names && - isset($lang_attributes['ALTNAME']) ) { - $language_values[$lang_key] .= " / " . $lang_attributes['ALTNAME']; - } - } - } - } else if (strtoupper($available_languages)!='NONE') { - // admin can set list of available languages in config - $available_languages_array=explode (" ",$available_languages); - foreach ($available_languages_array as $lang_key ) { - if (isset($languages[$lang_key]['NAME'])) { - $language_values[$lang_key] = $languages[$lang_key]['NAME']; - if ( isset($show_alternative_names) && - $show_alternative_names && - isset($languages[$lang_key]['ALTNAME']) ) { - $language_values[$lang_key] .= " / " . $languages[$lang_key]['ALTNAME']; - } + foreach ($languages as $lang_key => $lang_attributes) { + if (isset($lang_attributes['NAME'])) { + $language_values[$lang_key] = $lang_attributes['NAME']; + if ( isset($show_alternative_names) && + $show_alternative_names && + isset($lang_attributes['ALTNAME']) ) { + $language_values[$lang_key] .= " / " . $lang_attributes['ALTNAME']; } } } + asort($language_values); $language_values = array_merge(array('' => _("Default")), $language_values); $language = $squirrelmail_language; - if (strtoupper($available_languages)!='NONE') { - // if set to 'none', interface will use only default language - $optvals[SMOPT_GRP_GENERAL][] = array( - 'name' => 'language', - 'caption' => _("Language"), - 'type' => SMOPT_TYPE_STRLIST, - 'refresh' => SMOPT_REFRESH_ALL, - 'posvals' => $language_values, - 'htmlencoded' => true - ); - } + + // TODO: maybe we can add count($language_values) check here + $optvals[SMOPT_GRP_GENERAL][] = array( + 'name' => 'language', + 'caption' => _("Language"), + 'type' => SMOPT_TYPE_STRLIST, + 'refresh' => SMOPT_REFRESH_ALL, + 'posvals' => $language_values, + 'htmlencoded' => true + ); /* Set values for the "use javascript" option. */ $optvals[SMOPT_GRP_GENERAL][] = array( diff --git a/plugins/administrator/defines.php b/plugins/administrator/defines.php index fbff0033..e5deb8be 100644 --- a/plugins/administrator/defines.php +++ b/plugins/administrator/defines.php @@ -10,6 +10,9 @@ * @subpackage administrator */ +/** @ignore */ +if (!defined('SM_PATH')) define('SM_PATH','../../'); + /** */ require_once( SM_PATH . 'functions/constants.php' ); @@ -31,7 +34,7 @@ define('SMOPT_TYPE_LDAP', 12); define('SMOPT_TYPE_EXTERNAL', 32); define('SMOPT_TYPE_PATH',33); -global $languages; +global $languages, $version; $language_values = array( ); foreach ($languages as $lang_key => $lang_attributes) { @@ -331,9 +334,6 @@ $defcfg = array( '$config_version' => array( 'name' => _("Config File Version"), 'iso-2022-jp' => 'iso-2022-jp' ) ), '$show_alternative_names' => array( 'name' => _("Show alternative language names"), 'type' => SMOPT_TYPE_BOOLEAN ), - '$available_languages' => array( 'name' => _("Available languages"), - 'type' => SMOPT_TYPE_STRING, - 'size' => 40 ), '$aggressive_decoding' => array( 'name' => _("Enable aggressive decoding"), 'type' => SMOPT_TYPE_BOOLEAN ), '$lossy_encoding' => array( 'name' => _("Enable lossy encoding"), -- 2.25.1