don't show language option when only two language options (default and English) are...
authortokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 31 Oct 2005 17:30:08 +0000 (17:30 +0000)
committertokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 31 Oct 2005 17:30:08 +0000 (17:30 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@10209 7612ce4b-ef26-0410-bec9-ea0150e637f0

include/options/display.php

index cf7ef5f7b72f74933c1b2a9ebca8a92daeef5127..21f731a68baeef0b9ccebb5a8a5880694194d1b2 100644 (file)
@@ -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(