瀏覽代碼

making sure that new configuration vars are parsed and configuration arrays
are preserved. control of options in arrays requires more changes and will
be implemented after release

tokul 19 年之前
父節點
當前提交
c48180ca31
共有 2 個文件被更改,包括 29 次插入1 次删除
  1. 25 1
      plugins/administrator/defines.php
  2. 4 0
      plugins/administrator/options.php

+ 25 - 1
plugins/administrator/defines.php

@@ -35,9 +35,24 @@ define('SMOPT_TYPE_TITLE', 9);
 define('SMOPT_TYPE_THEME', 10);
 define('SMOPT_TYPE_PLUGINS', 11);
 define('SMOPT_TYPE_LDAP', 12);
+define('SMOPT_TYPE_CUSTOM', 13);
 define('SMOPT_TYPE_EXTERNAL', 32);
 define('SMOPT_TYPE_PATH',33);
 
+/**
+ * Returns reformated aTemplateSet array data for option selection
+ * @return array template selection options
+ * @since 1.5.1
+ */
+function adm_template_options() {
+    global $aTemplateSet;
+    $ret = array();
+    foreach ($aTemplateSet as $iTemplateID => $aTemplate) {
+        $ret[$iTemplateID] = $aTemplate['NAME'];
+    }
+    return $ret;
+}
+
 global $languages, $version;
 
 $language_values = array( );
@@ -385,11 +400,20 @@ $defcfg = array( '$config_version' => array( 'name' => _("Config File Version"),
                  '$abook_global_file_listing'   => array( 'name' => _("Allow listing of global address book"),
                                                           'type' => SMOPT_TYPE_BOOLEAN ),
                  /* --------------------------------------------------------*/
-                 'Group7' => array( 'name' => _("Themes"),
+                 'Group7' => array( 'name' => _("Templates"),
                                     'type' => SMOPT_TYPE_TITLE ),
                  '$theme_css' => array( 'name' => _("Style Sheet URL (css)"),
                                         'type' => SMOPT_TYPE_PATH,
                                         'size' => 40 ),
+                 '$default_fontsize' => array( 'name' => _("Default font size"),
+                                               'type' => SMOPT_TYPE_STRING,
+                                               'default' => ''),
+                 '$default_fontset' => array( 'name' => _("Default font set"),
+                                              'type' => SMOPT_TYPE_STRLIST,
+                                              'posvals' => $fontsets),
+                 '$templateset_default' => array( 'name' => _("Default template"),
+                                                  'type' => SMOPT_TYPE_STRLIST,
+                                                  'posvals' => adm_template_options()),
                  '$theme_default' => array( 'name' => _("Default theme"),
                                             'type' => SMOPT_TYPE_INTEGER,
                                             'default' => 0,

+ 4 - 0
plugins/administrator/options.php

@@ -320,12 +320,16 @@ foreach ( $newcfg as $k => $v ) {
         $type = SMOPT_TYPE_PLUGINS;
     } else if ( substr( $k, 0, 13 ) == '$ldap_server[' ) {
         $type = SMOPT_TYPE_LDAP;
+    } else if ( substr( $k, 0, 9 ) == '$fontsets' ||
+	substr( $k, 0, 13 ) == '$aTemplateSet' ) {
+        $type = SMOPT_TYPE_CUSTOM;
     }
 
     if ( $type == SMOPT_TYPE_TITLE || $colapse[$act_grp] == 'off' ) {
 
         switch ( $type ) {
         case SMOPT_TYPE_LDAP:
+        case SMOPT_TYPE_CUSTOM:
         case SMOPT_TYPE_PLUGINS:
         case SMOPT_TYPE_THEME:
         case SMOPT_TYPE_HIDDEN: