Bring defaults for the folder selection pref in line.
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 3 Sep 2007 11:51:57 +0000 (11:51 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 3 Sep 2007 11:51:57 +0000 (11:51 +0000)
Create constants for their values, not use the semantically irrelevant
SMPREF_{ON,OFF}

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12670 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_mailbox.php
include/constants.php
include/load_prefs.php
include/options/folder.php

index e7c413095890dffd4cf55278729d8ad02e12941a..df3692044b27eec2df832502402534d2c0bbe124 100755 (executable)
@@ -685,7 +685,7 @@ function sqimap_mailbox_option_array($imap_stream, $folder_skip = 0, $boxes = 0,
     if ( $use_long_format ) {
         $shorten_box_names = 0;
     } else {
-        $shorten_box_names = getPref($data_dir, $username, 'mailbox_select_style', SMPREF_OFF);
+        $shorten_box_names = getPref($data_dir, $username, 'mailbox_select_style', SMPREF_MAILBOX_SELECT_INDENTED);
     }
 
     if ($boxes == 0) {
@@ -710,7 +710,7 @@ function sqimap_mailbox_option_array($imap_stream, $folder_skip = 0, $boxes = 0,
             } else {
                 switch ($shorten_box_names)
                 {
-                  case 2:   /* delimited, style = 2 */
+                  case SMPREF_MAILBOX_SELECT_DELIMITED:
                       if ($translate_special_folders && $boxes_part['unformatted-dm']==$sent_folder) {
                           /*
                            * calculate pad level from number of delimiters. do it inside if control in order 
@@ -731,7 +731,7 @@ function sqimap_mailbox_option_array($imap_stream, $folder_skip = 0, $boxes = 0,
                           $box2 = str_replace('&amp;nbsp;&amp;nbsp;', '.&nbsp;', htmlspecialchars($boxes_part['formatted']));
                       }
                     break;
-                  case 1:   /* indent, style = 1 */
+                  case SMPREF_MAILBOX_SELECT_INDENTED:
                       if ($translate_special_folders && $boxes_part['unformatted-dm']==$sent_folder) {
                           $pad = str_pad('',12 * (count(explode($delimiter,$boxes_part['unformatted-dm']))-1),'&nbsp;&nbsp;');
                           $box2 = $pad . _("Sent");
index 62e507521c22868d4b228ebd84461411c28b3732..5faea98649861b9fc51525b86a01e3adee2357a6 100644 (file)
@@ -57,6 +57,10 @@ define('SMPREF_UNSEEN_NORMAL', 5);  // Only normal folders (since 1.2.5)
 define('SMPREF_UNSEEN_ONLY', 1);
 define('SMPREF_UNSEEN_TOTAL', 2);
 
+define('SMPREF_MAILBOX_SELECT_LONG', 0);
+define('SMPREF_MAILBOX_SELECT_INDENTED', 1);
+define('SMPREF_MAILBOX_SELECT_DELIMITED', 2);
+
 /**
  * Define constants for time/date display preferences.
  * @since 1.2.0
index cc73748bcce422edcd39c1acc56c1c5ce5180f54..8321ab6eb93f08da8f314213cd7a537d5d2a6f67 100644 (file)
@@ -321,7 +321,7 @@ $forward_cc = getPref($data_dir, $username, 'forward_cc', SMPREF_OFF);
 
 /* How are mailbox select lists displayed: 0. full names, 1. indented (default),
  * 3. delimited) */
-$mailbox_select_style = getPref($data_dir, $username, 'mailbox_select_style', SMPREF_ON);
+$mailbox_select_style = getPref($data_dir, $username, 'mailbox_select_style', SMPREF_MAILBOX_SELECT_INDENTED);
 
 /* Allow user to customize, and display the full date, instead of day, or time based
    on time distance from date of message */
index ead93b862707f3c027dfb006d5c3789c2b1f9910..c2f7639ed13ce7b2afc83ace572e41ec9fcba758 100644 (file)
@@ -234,9 +234,13 @@ function load_optpage_data_folder() {
         'caption' => _("Selection List Style"),
         'type'    => SMOPT_TYPE_STRLIST,
         'refresh' => SMOPT_REFRESH_NONE,
-        'posvals' => array( 0 => _("Long:") . ' "' . _("Folder") . $delim . _("Subfolder") . '"',
-                            1 => _("Indented:") . " \"$nbsp$nbsp$nbsp$nbsp" . _("Subfolder") . '"',
-                            2 => _("Delimited:") . " \".$nbsp" . _("Subfolder") . '"'),
+        'posvals' => array(
+            SMPREF_MAILBOX_SELECT_LONG =>
+                _("Long:") . ' "' . _("Folder") . $delim . _("Subfolder") . '"',
+            SMPREF_MAILBOX_SELECT_INDENTED =>
+                _("Indented:") . " \"$nbsp$nbsp$nbsp$nbsp" . _("Subfolder") . '"',
+            SMPREF_MAILBOX_SELECT_DELIMITED =>
+                _("Delimited:") . " \".$nbsp" . _("Subfolder") . '"'),
         'htmlencoded' => true
     );