Move some mimp config options into preferences
authorMichael M Slusarz <slusarz@curecanti.org>
Sun, 11 Oct 2009 22:51:49 +0000 (16:51 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Sun, 11 Oct 2009 22:51:49 +0000 (16:51 -0600)
imp/config/conf.xml
imp/config/prefs.php.dist
imp/docs/UPGRADING
imp/mailbox-mimp.php

index be0fe8c..98e83cd 100644 (file)
   </configsection>
  </configtab>
 
- <configtab name="mimp" desc="Mobile View (mimp) Options">
-  <configsection name="mimp">
-   <configsection name="mailbox">
-    <configheader>Mailbox Settings</configheader>
-    <configinteger name="max_from_chars" desc="In the mailbox view, how many
-    characters of From: addresses should we show before truncating
-    them?">10</configinteger>
-    <configinteger name="max_subj_chars" desc="In the mailbox view, how many
-    characters of Subject: lines should we show before truncating
-    them?">20</configinteger>
-   </configsection>
-  </configsection>
- </configtab>
-
  <configtab name="dimp" desc="Dynamic View (dimp) Options">
   <configsection name="dimp">
    <configlist name="css_files" required="false" desc="A list of additional CSS
index a6e44c2..47ab5b8 100644 (file)
@@ -1581,6 +1581,22 @@ $_prefs['mimp_preview_msg'] = array(
     'desc' => _("Display only the first 250 characters of a message initially?")
 );
 
+$_prefs['mimp_max_from_chars'] = array(
+    'value' => 10,
+    'locked' => true,
+    'shared' => false,
+    'type' => 'number',
+    'desc' => _("In the mailbox view, how many characters of From: addresses should we show before truncating?")
+);
+
+$_prefs['mimp_max_subj_chars'] = array(
+    'value' => 20,
+    'locked' => true,
+    'shared' => false,
+    'type' => 'number',
+    'desc' => _("In the mailbox view, how many characters of Subject: lines should we show before truncating?")
+);
+
 // End Minimalist View Options
 
 // Standard View Options
index 63de1e6..7f7b960 100644 (file)
@@ -31,6 +31,10 @@ spellchecking, and login redirection have been moved to Horde.
 The 'show_preview' option has been removed; enabling previews is now handled
 by the 'show_preview' preference.
 
+The 'max_from_chars' and 'max_subj_chars' configuration options for the
+minimal (mimp) display have been moved to preferences ('mimp_max_from_chars'
+and 'mimp_max_subj_chars').
+
 
 Preferences
 -----------
index 068323c..733c38b 100644 (file)
@@ -131,8 +131,8 @@ while (list(,$ob) = each($mbox_info['overview'])) {
     /* Format the from header. */
     $getfrom = $imp_ui->getFrom($ob['envelope']);
     $msg['from'] = $getfrom['from'];
-    if (Horde_String::length($msg['from']) > $conf['mimp']['mailbox']['max_from_chars']) {
-        $msg['from'] = Horde_String::substr($msg['from'], 0, $conf['mimp']['mailbox']['max_from_chars']) . '...';
+    if (Horde_String::length($msg['from']) > $prefs->getValue('mimp_max_from_chars')) {
+        $msg['from'] = Horde_String::substr($msg['from'], 0, $prefs->getValue('mimp_max_from_chars')) . '...';
     }
 
     /* Get flag information. */
@@ -160,8 +160,8 @@ while (list(,$ob) = each($mbox_info['overview'])) {
         $msg['subject'] = $threadtree[$ob['uid']] . trim($msg['subject']);
     }
 
-    if (Horde_String::length($msg['subject']) > $conf['mimp']['mailbox']['max_subj_chars']) {
-        $msg['subject'] = Horde_String::substr($msg['subject'], 0, $conf['mimp']['mailbox']['max_subj_chars']) . '...';
+    if (Horde_String::length($msg['subject']) > $prefs->getValue('mimp_max_subj_chars')) {
+        $msg['subject'] = Horde_String::substr($msg['subject'], 0, $prefs->getValue('mimp_max_subj_chars')) . '...';
     }
 
     /* Generate the target link. */