From 439538dc8a384f033d79c684d4d692ac5ae0dc75 Mon Sep 17 00:00:00 2001 From: tokul Date: Sun, 5 Feb 2006 10:44:25 +0000 Subject: [PATCH 1/1] 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 git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@10643 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- plugins/administrator/defines.php | 26 +++++++++++++++++++++++++- plugins/administrator/options.php | 4 ++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/plugins/administrator/defines.php b/plugins/administrator/defines.php index 6e5e1267..939365d5 100644 --- a/plugins/administrator/defines.php +++ b/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, diff --git a/plugins/administrator/options.php b/plugins/administrator/options.php index 8596ac72..bc17ddf5 100644 --- a/plugins/administrator/options.php +++ b/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: -- 2.25.1