From cde10cc31360f6b5e552b6c5b950c314c361c756 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Sun, 11 Oct 2009 16:51:49 -0600 Subject: [PATCH] Move some mimp config options into preferences --- imp/config/conf.xml | 14 -------------- imp/config/prefs.php.dist | 16 ++++++++++++++++ imp/docs/UPGRADING | 4 ++++ imp/mailbox-mimp.php | 8 ++++---- 4 files changed, 24 insertions(+), 18 deletions(-) diff --git a/imp/config/conf.xml b/imp/config/conf.xml index be0fe8c39..98e83cd49 100644 --- a/imp/config/conf.xml +++ b/imp/config/conf.xml @@ -246,20 +246,6 @@ - - - - Mailbox Settings - 10 - 20 - - - - 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 diff --git a/imp/docs/UPGRADING b/imp/docs/UPGRADING index 63de1e6bc..7f7b96033 100644 --- a/imp/docs/UPGRADING +++ b/imp/docs/UPGRADING @@ -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 ----------- diff --git a/imp/mailbox-mimp.php b/imp/mailbox-mimp.php index 068323ce5..733c38b5c 100644 --- a/imp/mailbox-mimp.php +++ b/imp/mailbox-mimp.php @@ -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. */ -- 2.11.0