Browse Source

disable template selection, when only one template is present

tokul 19 năm trước cách đây
mục cha
commit
cf7e49e692
1 tập tin đã thay đổi với 11 bổ sung9 xóa
  1. 11 9
      include/options/display.php

+ 11 - 9
include/options/display.php

@@ -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();