Replaced hard-coded colors with theme colors.
[squirrelmail.git] / src / options_display.php
index 1ddaeb0cc58253c0e62b0ef079dac15c114d5bcd..bf464856a16b1af366e70aa96715b54aa76a24a1 100644 (file)
@@ -47,8 +47,28 @@ function load_optpage_data_display() {
         'posvals' => $theme_values,
         'save'    => 'save_option_theme'
     );
-
-    $language = (!isset($language) || ($language == '') ? 'en' : $language);
+    $css_values = array( 'none' => _("Default" ) );
+       $handle=opendir('../themes/css/');
+       while ($file = readdir($handle) ) {
+           if ( substr( $file, -4 ) == '.css' ) {
+               $css_values[$file] = substr( $file, 0, strlen( $file ) - 4 );
+        }
+       }       
+       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
+        );
+    
+    }
+    
     $language_values = array();
     foreach ($languages as $lang_key => $lang_attributes) {
         if (isset($lang_attributes['NAME'])) {
@@ -56,6 +76,8 @@ function load_optpage_data_display() {
         }
     }
     asort($language_values);
+    $language_values =
+        array_merge(array('' => _("Default")), $language_values);
     $optvals[SMOPT_GRP_GENERAL][] = array(
         'name'    => 'language',
         'caption' => _("Language"),