added user option to support message sort by internal date instead of the
[squirrelmail.git] / src / options_display.php
index c351a990b569ceb69f93da59781c876c042364b3..fd075d54a6f1146735c9ea031d43329994728c7c 100644 (file)
@@ -1,15 +1,15 @@
 <?php
 
-   /**
   **  options_display.php
   **
   **  Copyright (c) 1999-2001 The SquirrelMail Development Team
   **  Licensed under the GNU GPL. For full terms see the file COPYING.
   **
   **  Displays all optinos about display preferences
   **
   **  $Id$
   */
+/**
* options_display.php
+ *
* Copyright (c) 1999-2002 The SquirrelMail Project Team
* Licensed under the GNU GPL. For full terms see the file COPYING.
+ *
* Displays all optinos about display preferences
+ *
* $Id$
+ */
 
 /* Define the group constants for the display options page. */
 define('SMOPT_GRP_GENERAL', 0);
@@ -18,7 +18,7 @@ define('SMOPT_GRP_MESSAGE', 2);
 
 /* Define the optpage load function for the display options page. */
 function load_optpage_data_display() {
-    global $theme, $languages, $js_autodetect_results;
+    global $theme, $language, $languages, $js_autodetect_results, $default_use_mdn;
 
     /* Build a simple array into which we will build options. */
     $optgrps = array();
@@ -35,8 +35,10 @@ function load_optpage_data_display() {
     /* Load the theme option. */
     $theme_values = array();
     foreach ($theme as $theme_key => $theme_attributes) {
-        $theme_values[$theme_attributes['PATH']] = $theme_attributes['NAME'];
+        $theme_values[$theme_attributes['NAME']] = $theme_attributes['PATH'];
     }
+    ksort($theme_values);
+    $theme_values = array_flip($theme_values);
     $optvals[SMOPT_GRP_GENERAL][] = array(
         'name'    => 'chosen_theme',
         'caption' => _("Theme"),
@@ -45,13 +47,37 @@ function load_optpage_data_display() {
         'posvals' => $theme_values,
         'save'    => 'save_option_theme'
     );
-
+    $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'])) {
             $language_values[$lang_key] = $lang_attributes['NAME'];
         }
     }
+    asort($language_values);
+    $language_values =
+        array_merge(array('' => _("Default")), $language_values);
     $optvals[SMOPT_GRP_GENERAL][] = array(
         'name'    => 'language',
         'caption' => _("Language"),
@@ -71,11 +97,10 @@ function load_optpage_data_display() {
                            SMPREF_JS_OFF        => _("Never"))
     );
 
-    $js_autodetect_script = "
-        <SCRIPT LANGUAGE=\"JavaScript\"><!--
-           document.forms[0].new_js_autodetect_results.value = '" . SMPREF_JS_ON . "';
-        // --></SCRIPT>
-    ";
+    $js_autodetect_script =
+        "<SCRIPT LANGUAGE=\"JavaScript\"><!--\n".
+           "document.forms[0].new_js_autodetect_results.value = '" . SMPREF_JS_ON . "';\n".
+        "// --></SCRIPT>\n";
     $js_autodetect_results = SMPREF_JS_OFF;
     $optvals[SMOPT_GRP_GENERAL][] = array(
         'name'    => 'js_autodetect_results',
@@ -200,7 +225,32 @@ function load_optpage_data_display() {
         'type'    => SMOPT_TYPE_BOOLEAN,
         'refresh' => SMOPT_REFRESH_NONE
     );
-
+    if ($default_use_mdn) {
+        $optvals[SMOPT_GRP_MESSAGE][] = array(
+            'name'    => 'mdn_user_support',
+            'caption' => _("Enable request/confirm reading"),
+            'type'    => SMOPT_TYPE_BOOLEAN,
+            'refresh' => SMOPT_REFRESH_NONE
+        );
+    }
+    $optvals[SMOPT_GRP_MESSAGE][] = array(
+        'name'    => 'compose_new_win',
+        'caption' => _("Always compose in a new window"),
+        'type'    => SMOPT_TYPE_BOOLEAN,
+        'refresh' => SMOPT_REFRESH_ALL
+    );
+    $optvals[SMOPT_GRP_MESSAGE][] = array(
+        'name'    => 'sig_first',
+        'caption' => _("Append signature before reply/forward text"),
+        'type'    => SMOPT_TYPE_BOOLEAN,
+        'refresh' => SMOPT_REFRESH_NONE
+    );
+    $optvals[SMOPT_GRP_MESSAGE][] = array(
+        'name'    => 'internal_date_sort',
+        'caption' => _("Use receive date for sort"),
+        'type'    => SMOPT_TYPE_BOOLEAN,
+        'refresh' => SMOPT_REFRESH_ALL
+    );
     /* Assemble all this together and return it as our result. */
     $result = array(
         'grps' => $optgrps,