disable template selection, when only one template is present
authortokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 12 Feb 2006 09:08:11 +0000 (09:08 +0000)
committertokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 12 Feb 2006 09:08:11 +0000 (09:08 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@10724 7612ce4b-ef26-0410-bec9-ea0150e637f0

include/options/display.php

index 039d556..0c07e5a 100644 (file)
@@ -73,15 +73,17 @@ function load_optpage_data_display() {
     }
     ksort($templateset_values);
     $templateset_values = array_flip($templateset_values);
-    $optvals[SMOPT_GRP_GENERAL][] = array(
-        'name'    => 'sTplDir',
-        'caption' => _("Template"),
-        'type'    => SMOPT_TYPE_STRLIST,
-        'refresh' => SMOPT_REFRESH_ALL,
-        'posvals' => $templateset_values,
-        'save'    => 'save_option_template'
-    );
-
+    // display template options only when there is more than one template
+    if (count($templateset_values)>1) {
+        $optvals[SMOPT_GRP_GENERAL][] = array(
+            'name'    => 'sTplDir',
+            'caption' => _("Template"),
+            'type'    => SMOPT_TYPE_STRLIST,
+            'refresh' => SMOPT_REFRESH_ALL,
+            'posvals' => $templateset_values,
+            'save'    => 'save_option_template'
+        );
+    }
 
     /* Load the theme option. */
     $theme_values = array();