Add tempalte config var for alternate stylesheets
authorstevetruckstuff <stevetruckstuff@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 29 Sep 2006 22:14:26 +0000 (22:14 +0000)
committerstevetruckstuff <stevetruckstuff@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 29 Sep 2006 22:14:26 +0000 (22:14 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11778 7612ce4b-ef26-0410-bec9-ea0150e637f0

class/template/Template.class.php
include/options/display.php

index 5e561a2b8ca91ebcd4b3c3b0ccf8f2810c24842f..1e91362102f6a933420b67e6713cd0c8208f3c53 100644 (file)
@@ -507,8 +507,8 @@ class Template
      **/
     function get_alternative_stylesheets () {
         $a = array();
-        foreach ($this->alternate_stylesheets as $css) {
-            $a[] = strtolower(basename($css));
+        foreach ($this->alternate_stylesheets as $path=>$name) {
+            $a[strtolower(basename($path))] = $name;
         }
         return $a;
     }
index cd7afb189f04f55012661fe256c0a75bd763e6b5..d4dc021a340ca193e6d01fe22301464500202906 100644 (file)
@@ -87,6 +87,9 @@ function load_optpage_data_display() {
 
     /* Load the theme option. */
     $theme_values = array();
+    // List alternate themes provided by templates first
+#    var_dump(Template::get_template_file_directory());
+    #list_files
     foreach ($theme as $theme_key => $theme_attributes) {
         $theme_values[$theme_attributes['NAME']] = $theme_attributes['PATH'];
     }
@@ -113,19 +116,26 @@ function load_optpage_data_display() {
         closedir($handle);
     }
 
-    /*
-    if ( count( $css_values ) > 1 ) {
-
-        $optvals[SMOPT_GRP_GENERAL][] = array(
-            'name'    => 'custom_css',
-            'caption' => _("Custom Stylesheet"),
-            'type'    => SMOPT_TYPE_STRLIST,
-            'refresh' => SMOPT_REFRESH_ALL,
-            'posvals' => $css_values
-        );
+    /* Icon theme selection */
+    if ($use_icons) {
+        global $icon_themes, $icon_theme;
 
+        $temp = array();
+        $value = 0;
+        for ($count = 0; $count < sizeof($icon_themes); $count++) {
+            $temp[$icon_themes[$count]['PATH']] = $icon_themes[$count]['NAME'];
+        }
+        if (sizeof($icon_themes) > 0) {
+            $optvals[SMOPT_GRP_GENERAL][] = array(
+                'name'          => 'icon_theme',
+                'caption'       => _("Icon Theme"),
+                'type'          => SMOPT_TYPE_STRLIST,
+                'refresh'       => SMOPT_REFRESH_NONE,
+                'posvals'       => $temp,
+                'save'          => 'icon_theme_save'
+            );
+        }
     }
-    */
 
     $fontset_values = array();
     $fontset_list = array();
@@ -221,28 +231,6 @@ function load_optpage_data_display() {
                            SMPREF_TIME_24HR => _("24-hour clock"))
     );
 
-    /* Icon theme selection */
-    if ($use_icons) {
-        global $icon_themes, $icon_theme;
-
-        $temp = array();
-        $value = 0;
-        for ($count = 0; $count < sizeof($icon_themes); $count++) {
-            $temp[$icon_themes[$count]['PATH']] = $icon_themes[$count]['NAME'];
-        }
-        if (sizeof($icon_themes) > 0) {
-            $optvals[SMOPT_GRP_GENERAL][] = array(
-                'name'          => 'icon_theme',
-                'caption'       => _("Icon Theme"),
-                'type'          => SMOPT_TYPE_STRLIST,
-                'refresh'       => SMOPT_REFRESH_NONE,
-                'posvals'       => $temp,
-                'save'          => 'icon_theme_save'
-            );
-        }
-    }
-
-
     /*** Load the General Options into the array ***/
     $optgrps[SMOPT_GRP_MAILBOX] = _("Mailbox Display Options");
     $optvals[SMOPT_GRP_MAILBOX] = array();