From: tokul Date: Mon, 31 Oct 2005 17:30:08 +0000 (+0000) Subject: don't show language option when only two language options (default and English) are... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=48d5ec1f023a0a1b3fa53d568c9a34cea1f0f47b;p=squirrelmail.git don't show language option when only two language options (default and English) are available git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@10209 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/include/options/display.php b/include/options/display.php index cf7ef5f7..21f731a6 100644 --- a/include/options/display.php +++ b/include/options/display.php @@ -122,15 +122,18 @@ function load_optpage_data_display() { array_merge(array('' => _("Default")), $language_values); $language = $squirrelmail_language; - // 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 - ); + // add language selection only when more than 2 languages are available + // (default, English and some other) + if (count($language_values)>2) { + $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(