From 6aa3e46326f0d497a9c6e27f20fba36b08bfcb3f Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 6 Oct 2009 22:43:51 -0600 Subject: [PATCH] More tweaking of various config options --- imp/config/conf.xml | 12 --- imp/config/prefs.php.dist | 138 +++++++++++++++++---------------- imp/docs/UPGRADING | 1 + imp/js/flagprefs.js | 2 + imp/lib/Contents.php | 2 +- imp/lib/Mime/Viewer/Images.php | 2 +- imp/lib/Views/ShowMessage.php | 5 +- imp/mailbox.php | 6 +- imp/message.php | 4 +- imp/rss.php | 2 +- imp/smime.php | 1 + imp/templates/pgp/pgp.html | 4 +- imp/templates/prefs/flagmanagement.inc | 3 +- imp/templates/prefs/soundselect.inc | 2 +- imp/templates/smime/smime.html | 9 ++- imp/themes/ie6_or_less.css | 2 +- imp/themes/ie7.css | 2 +- imp/themes/screen.css | 9 ++- imp/themes/silver/screen.css | 3 + 19 files changed, 108 insertions(+), 101 deletions(-) diff --git a/imp/config/conf.xml b/imp/config/conf.xml index 8c901229a..be0fe8c39 100644 --- a/imp/config/conf.xml +++ b/imp/config/conf.xml @@ -77,18 +77,6 @@ - - - Mailbox Settings - false - - - Message Settings diff --git a/imp/config/prefs.php.dist b/imp/config/prefs.php.dist index f97c944e0..a6e44c2e2 100644 --- a/imp/config/prefs.php.dist +++ b/imp/config/prefs.php.dist @@ -127,15 +127,6 @@ $prefGroups['newmail'] = array( 'members' => array('refresh_time', 'nav_poll_all', 'nav_popup', 'soundselect') ); -if (!empty($GLOBALS['conf']['mailbox']['show_preview'])) { - $prefGroups['mailpreview'] = array( - 'column' => _("Message Options"), - 'label' => _("Mail Previews"), - 'desc' => _("Configure mail preview options."), - 'members' => array('preview_enabled', 'preview_maxlen', 'preview_strip_nl', 'preview_show_unread', 'preview_show_tooltip') - ); -} - if (!$is_pop3) { $prefGroups['flags'] = array( 'column' => _("Message Options"), @@ -204,6 +195,13 @@ $prefGroups['mimp'] = array( 'members' => array('mimp_preview_msg') ); +$prefGroups['standard'] = array( + 'column' => _("Other Options"), + 'label' => _("Standard View Options"), + 'desc' => _("Configure options for the standard view."), + 'members' => array('preview_enabled', 'preview_maxlen', 'preview_strip_nl', 'preview_show_unread', 'preview_show_tooltip') +); + $prefGroups['dimp'] = array( 'column' => _("Other Options"), 'label' => _("Dynamic View Options"), @@ -809,7 +807,7 @@ $_prefs['auto_delete_drafts'] = array( // filter message content? $_prefs['filtering'] = array( 'value' => 0, - 'locked' => false, + 'locked' => true, 'shared' => false, 'type' => 'checkbox', 'desc' => _("Filter message content for profanity?")); @@ -932,7 +930,7 @@ $_prefs['mail_hdr'] = array( 'locked' => false, 'shared' => false, 'type' => 'textarea', - 'desc' => _("Additional headers to display when viewing: (optional, enter each header on a new line)")); + 'desc' => _("Additional headers to display when viewing: (enter each header on a new line)")); // default message character set $_prefs['default_msg_charset'] = array( @@ -1064,57 +1062,6 @@ $_prefs['soundselect'] = array('type' => 'special'); // End New Mail preferences -// Message Preview Preferences - -$_prefs['preview_enabled'] = array( - 'value' => '0', - 'locked' => false, - 'shared' => false, - 'type' => 'checkbox', - 'desc' => _("Enable message previews?") -); - -$_prefs['preview_maxlen'] = array( - 'value' => 250, - 'locked' => false, - 'shared' => false, - 'type' => 'enum', - 'enum' => array( - 100 => _("100 characters"), - 250 => _("250 characters"), - 500 => _("500 characters"), - 1000 => _("1000 characters") - ), - 'desc' => _("Characters to display:") -); - -$_prefs['preview_strip_nl'] = array( - 'value' => 1, - 'locked' => false, - 'shared' => false, - 'type' => 'checkbox', - 'desc' => _("Strip linebreaks?") -); - -$_prefs['preview_show_unread'] = array( - 'value' => 1, - 'locked' => false, - 'shared' => false, - 'type' => 'checkbox', - 'desc' => _("Show previews for unread messages only?") -); - -$_prefs['preview_show_tooltip'] = array( - 'value' => 0, - 'locked' => false, - 'shared' => false, - 'type' => 'checkbox', - 'desc' => _("Show previews in tooltips?") -); - -// End Message Preview - - // IMAP Flag preferences // UI for flag management. @@ -1623,7 +1570,7 @@ $_prefs['smime_additional_cert'] = array( // End S/MIME Options -// MIMP Options +// Minimalist View Options // display only the first 250 characters of a message on first message view? $_prefs['mimp_preview_msg'] = array( @@ -1634,9 +1581,66 @@ $_prefs['mimp_preview_msg'] = array( 'desc' => _("Display only the first 250 characters of a message initially?") ); -// End MIMP Options +// End Minimalist View Options + +// Standard View Options + +// Previews are disabled by default as it can be performance intensive, +// especially without caching. +$_prefs['preview_enabled'] = array( + // Disabled and locked by default + 'value' => 0, + 'locked' => true, + 'shared' => false, + 'type' => 'checkbox', + 'desc' => _("Enable message previews?") +); + +$_prefs['preview_maxlen'] = array( + 'value' => 250, + // Locked by default + 'locked' => true, + 'shared' => false, + 'type' => 'enum', + 'enum' => array( + 100 => _("100 characters"), + 250 => _("250 characters"), + 500 => _("500 characters"), + 1000 => _("1000 characters") + ), + 'desc' => _("Characters to display:") +); + +$_prefs['preview_strip_nl'] = array( + 'value' => 1, + // Locked by default + 'locked' => true, + 'shared' => false, + 'type' => 'checkbox', + 'desc' => _("Strip linebreaks?") +); + +$_prefs['preview_show_unread'] = array( + 'value' => 1, + // Locked by default + 'locked' => true, + 'shared' => false, + 'type' => 'checkbox', + 'desc' => _("Show previews for unread messages only?") +); + +$_prefs['preview_show_tooltip'] = array( + 'value' => 0, + // Locked by default + 'locked' => true, + 'shared' => false, + 'type' => 'checkbox', + 'desc' => _("Show previews in tooltips?") +); + +// End Standard View Options -// DIMP Options +// Dynamic View Options // Login preferences (dimp) $_prefs['dimp_login_view'] = array( @@ -1651,7 +1655,7 @@ $_prefs['dimp_login_view'] = array( 'desc' => _("The page to view immediately after login.") ); -// Other Implicit DIMP preferences +// Other implicit dynamic view preferences $_prefs['dimp_qsearch_field'] = array( 'value' => 'all', 'locked' => false, @@ -1676,7 +1680,7 @@ $_prefs['dimp_toggle_headers'] = array( 'shared' => false, 'type' => 'implicit'); -// End DIMP Options +// End Dynamic View Options // Other entries (used internally in IMP) diff --git a/imp/docs/UPGRADING b/imp/docs/UPGRADING index 7467fc756..17ff4bc53 100644 --- a/imp/docs/UPGRADING +++ b/imp/docs/UPGRADING @@ -23,6 +23,7 @@ supported. TODO ---- +* removed show_preview config (enabled via show_preview pref) * servers.php has changed * hooks.php has changed * imp_hook_vinfo has been removed - use preauth hook instead diff --git a/imp/js/flagprefs.js b/imp/js/flagprefs.js index 466d32ab4..ad93bb061 100644 --- a/imp/js/flagprefs.js +++ b/imp/js/flagprefs.js @@ -37,7 +37,9 @@ var ImpFlagPrefs = { id = elt2.readAttribute('id'); new ColorPicker({ color: $F(elt2), + draggable: true, offsetParent: elt, + resizable: true, update: [[ id, 'value' ], [ id, 'background' ]] }); e.stop(); diff --git a/imp/lib/Contents.php b/imp/lib/Contents.php index 4b7afa238..9ba910846 100644 --- a/imp/lib/Contents.php +++ b/imp/lib/Contents.php @@ -653,7 +653,7 @@ class IMP_Contents (strpos($id, '.') === false)) { $url = Horde_Util::removeParameter(Horde::selfUrl(true), array('actionID', 'imapid', 'index')); $url = Horde_Util::addParameter($url, array('actionID' => 'strip_attachment', 'imapid' => $id, 'index' => $this->_index, 'message_token' => Horde::getRequestToken('imp.impcontents'))); - $part['strip'] = Horde::link($url, _("Strip Attachment"), 'stripAtc', null, "return window.confirm('" . addslashes(_("Are you sure you wish to PERMANENTLY delete this attachment?")) . "');") . ''; + $part['strip'] = Horde::link($url, _("Strip Attachment"), 'deleteImg', null, "return window.confirm('" . addslashes(_("Are you sure you wish to PERMANENTLY delete this attachment?")) . "');") . ''; } return $part; diff --git a/imp/lib/Mime/Viewer/Images.php b/imp/lib/Mime/Viewer/Images.php index ce7d1796a..ec4f582d5 100644 --- a/imp/lib/Mime/Viewer/Images.php +++ b/imp/lib/Mime/Viewer/Images.php @@ -143,7 +143,7 @@ class IMP_Horde_Mime_Viewer_Images extends Horde_Mime_Viewer_Images return array(); } - $status = array(sprintf(_("An image named %s is attached to this message. A thumbnail is below."), $this->_mimepart->getName(true))); + $status = array(sprintf(_("An image named %s is attached to this message."), $this->_mimepart->getName(true))); if ($GLOBALS['browser']->hasFeature('javascript')) { $status[] = $this->_params['contents']->linkViewJS($this->_mimepart, 'view_attach', $this->_outputImgTag('view_thumbnail', _("View Attachment")), null, null, null); diff --git a/imp/lib/Views/ShowMessage.php b/imp/lib/Views/ShowMessage.php index ee553d30d..80d0d392d 100644 --- a/imp/lib/Views/ShowMessage.php +++ b/imp/lib/Views/ShowMessage.php @@ -243,7 +243,7 @@ class IMP_Views_ShowMessage IMP_Contents::SUMMARY_DOWNLOAD_ZIP; $part_info = $part_info_display = array('icon', 'description', 'type', 'size', 'download', 'download_zip'); - if ($show_parts != 'all') { + if ($show_parts == 'atc') { array_unshift($part_info, 'id'); } @@ -260,7 +260,8 @@ class IMP_Views_ShowMessage } if (!($render_mode = $imp_contents->canDisplay($mime_id, IMP_Contents::RENDER_INLINE | IMP_Contents::RENDER_INFO))) { - if (($show_parts == 'atc') && $imp_contents->isAttachment($mime_type)) { + if (($show_parts == 'atc') && + $imp_contents->isAttachment($mime_type)) { $atc_parts[] = $mime_id; } continue; diff --git a/imp/mailbox.php b/imp/mailbox.php index c3223505c..551725e5d 100644 --- a/imp/mailbox.php +++ b/imp/mailbox.php @@ -228,7 +228,7 @@ if ($conf['user']['allow_folders']) { /* Build the list of messages in the mailbox. */ $imp_mailbox = IMP_Mailbox::singleton($imp_mbox['mailbox']); $pageOb = $imp_mailbox->buildMailboxPage(Horde_Util::getFormData('page'), $start); -$show_preview = ($conf['mailbox']['show_preview'] && $prefs->getValue('preview_enabled')); +$show_preview = $prefs->getValue('preview_enabled'); $overview_headers = array('x-priority'); $mbox_info = $imp_mailbox->getMailboxArray(range($pageOb['begin'], $pageOb['end']), array('preview' => $show_preview, 'headers' => $overview_headers, 'structure' => $prefs->getValue('atc_flag'))); @@ -321,7 +321,9 @@ if (isset($filter_url)) { $sort_url = Horde_Util::addParameter($mailbox_imp_url, 'sortdir', ($sortpref['dir']) ? 0 : 1); /* Determine if we are showing previews. */ -$preview_tooltip = ($show_preview) ? $prefs->getValue('preview_show_tooltip') : false; +$preview_tooltip = $show_preview + ? $prefs->getValue('preview_show_tooltip') + : false; if ($preview_tooltip) { Horde::addScriptFile('tooltips.js', 'horde'); } else { diff --git a/imp/message.php b/imp/message.php index 564465c0a..a96390840 100644 --- a/imp/message.php +++ b/imp/message.php @@ -663,10 +663,10 @@ if (!strlen($msgtext)) { /* Build the Attachments menu. */ $a_template->set('atc', Horde::widget('#', _("Attachments"), 'widget hasmenu', '', '', _("Attachments"), true)); -if ($show_parts != 'all') { +if ($show_parts == 'atc') { $a_template->set('show_parts_all', Horde::widget(Horde_Util::addParameter($headersURL, array('show_parts' => 'all')), _("Show All Message Parts"), 'widget', '', '', _("Show All Message Parts"), true)); } -if ($show_parts != 'atc') { +if ($show_parts == 'all') { $a_template->set('show_parts_atc', Horde::widget(Horde_Util::addParameter($headersURL, array('show_parts' => 'atc')), _("Show Attachments Only"), 'widget', '', '', _("Show Attachments Only"), true)); } if (count($display_ids) > 2) { diff --git a/imp/rss.php b/imp/rss.php index fa210568b..b719ef924 100644 --- a/imp/rss.php +++ b/imp/rss.php @@ -59,7 +59,7 @@ $ids = $imp_search->runSearchQuery($query, $mailbox, Horde_Imap_Client::SORT_DAT if (!empty($ids)) { $imp_ui = new IMP_UI_Mailbox($imp_mbox['mailbox']); - $overview = $imp_mailbox->getMailboxArray(array_slice($ids, 0, 20), array('preview' => $conf['mailbox']['show_preview'] && $prefs->getValue('preview_enabled'))); + $overview = $imp_mailbox->getMailboxArray(array_slice($ids, 0, 20), array('preview' => $prefs->getValue('preview_enabled'))); foreach ($overview['overview'] as $ob) { $from_addr = $imp_ui->getFrom($ob['envelope'], array('fullfrom' => true)); diff --git a/imp/smime.php b/imp/smime.php index d5b5a0b1c..677e1ae05 100644 --- a/imp/smime.php +++ b/imp/smime.php @@ -144,6 +144,7 @@ case 'info_public_key': case 'view_personal_public_key': _textWindowOutput('S/MIME Personal Public Key', $imp_smime->getPersonalPublicKey()); exit; + case 'info_personal_public_key': _printKeyInfo($imp_smime->getPersonalPublicKey()); exit; diff --git a/imp/templates/pgp/pgp.html b/imp/templates/pgp/pgp.html index 6f0816bbc..308491727 100644 --- a/imp/templates/pgp/pgp.html +++ b/imp/templates/pgp/pgp.html @@ -1,7 +1,7 @@  
- NOTE: PGP support requires popup windows to be used. If your browser is currently set to disable popup windows, you must change this setting or else the PGP features will not work correctly. + NOTE: PGP support requires popup windows to be used. If your browser is currently set to disable popup windows, you must change this setting or else the PGP features will not work correctly.
checked="checked" />   @@ -44,7 +44,7 @@ -
Key import is not available. File upload is not enabled on this server.
+
Key import is not available. File upload is not enabled on this server.

Key import is not available. You have no address book defined to add your contacts.
diff --git a/imp/templates/prefs/flagmanagement.inc b/imp/templates/prefs/flagmanagement.inc index 20d899bdf..e70da8dcd 100644 --- a/imp/templates/prefs/flagmanagement.inc +++ b/imp/templates/prefs/flagmanagement.inc @@ -5,7 +5,6 @@ $flaglist = $imp_flags->getList(array('div' => true, 'fgcolor' => true)); /* Get the graphics. */ $picker_img = Horde::img('colorpicker.png', _("Color Picker"), '', $registry->getImageDir('horde')); -$delete_img = Horde::img('delete.png'); ?> @@ -46,7 +45,7 @@ $delete_img = Horde::img('delete.png'); - + diff --git a/imp/templates/prefs/soundselect.inc b/imp/templates/prefs/soundselect.inc index c3e2180cb..58bea0917 100644 --- a/imp/templates/prefs/soundselect.inc +++ b/imp/templates/prefs/soundselect.inc @@ -1,6 +1,6 @@ isLocked('nav_audio')): ?> getValue('nav_audio') ?> -

+

  • get('themesfs') . '/graphics/audio/*.wav') as $sound): $sound = basename($sound); ?> diff --git a/imp/templates/smime/smime.html b/imp/templates/smime/smime.html index 36dd343df..c7fa66b78 100644 --- a/imp/templates/smime/smime.html +++ b/imp/templates/smime/smime.html @@ -1,7 +1,7 @@  
    - NOTE: S/MIME support requires popup windows to be used. If your browser is currently set to disable popup windows, you must change this setting or else the S/MIME features will not work correctly. + NOTE: S/MIME support requires popup windows to be used. If your browser is currently set to disable popup windows, you must change this setting or else the S/MIME features will not work correctly.
    checked="checked" />   @@ -36,7 +36,7 @@ - Key import is not available. File upload is not enabled on this server. + Key import is not available. File upload is not enabled on this server. Key import is not available. You have no address book defined to add your contacts. @@ -50,7 +50,7 @@
    - Your S/MIME Public/Private Certificates + Your S/MIME Public/Private Certificate
    @@ -73,8 +73,9 @@

    - Certificate import is not available. File upload is not enabled on this server. + Certificate import is not available. File upload is not enabled on this server. + No certificate available.

    diff --git a/imp/themes/ie6_or_less.css b/imp/themes/ie6_or_less.css index 1707fbbbf..a91d2a735 100644 --- a/imp/themes/ie6_or_less.css +++ b/imp/themes/ie6_or_less.css @@ -3,7 +3,7 @@ */ /* Fixes broken inline-block. */ -div.msgflags, span.spellcheckPopdownImg, span.treeImg, .downloadAtc, .downloadZipAtc, .saveImgAtc, .stripAtc, span.mimePartInfo, .mimeStatusMessage { +div.msgflags, span.spellcheckPopdownImg, span.treeImg, .downloadAtc, .downloadZipAtc, .saveImgAtc, .deleteImg, span.mimePartInfo, .mimeStatusMessage { zoom: 1; *display: inline; } diff --git a/imp/themes/ie7.css b/imp/themes/ie7.css index 856791a5f..5762fcb9e 100644 --- a/imp/themes/ie7.css +++ b/imp/themes/ie7.css @@ -3,7 +3,7 @@ */ /* Fixes broken inline-block. */ -div.msgflags, span.spellcheckPopdownImg, span.treeImg, .downloadAtc, .downloadZipAtc, .saveImgAtc, .stripAtc, span.mimePartInfo, .mimeStatusMessage { +div.msgflags, span.spellcheckPopdownImg, span.treeImg, .downloadAtc, .downloadZipAtc, .saveImgAtc, .deleteImg, span.mimePartInfo, .mimeStatusMessage { zoom: 1; *display: inline; } diff --git a/imp/themes/screen.css b/imp/themes/screen.css index 253a3f4ba..f3d14d044 100644 --- a/imp/themes/screen.css +++ b/imp/themes/screen.css @@ -349,6 +349,11 @@ table.accountsmanagement td.noneconfigured { font-style: italic; } +/* PGP & S/MIME prefs styles. */ +.redText { + color: red; +} + .folderunsub { background: #bbb; font-style: italic; @@ -585,7 +590,7 @@ td.addressTr span.loadingImg { white-space: nowrap; } -.downloadAtc, .downloadZipAtc, .saveImgAtc, .closeImg, .stripAtc, .foldersImg, .searchuiImg { +.downloadAtc, .downloadZipAtc, .saveImgAtc, .closeImg, .deleteImg, .foldersImg, .searchuiImg { display: -moz-inline-stack; display: inline-block; height: 16px; @@ -603,7 +608,7 @@ td.addressTr span.loadingImg { .saveImgAtc { background-image: url("graphics/gallery.png"); } -.stripAtc { +.deleteImg { background-image: url("graphics/delete.png"); } .closeImg, .searchuiDelete { diff --git a/imp/themes/silver/screen.css b/imp/themes/silver/screen.css index ec3b0ff92..a0c483282 100644 --- a/imp/themes/silver/screen.css +++ b/imp/themes/silver/screen.css @@ -86,3 +86,6 @@ span.trashImg { .searchuiCalendar { background-image: url("graphics/calendar.png"); } +.deleteImg { + background-image: url("graphics/delete.png"); +} -- 2.11.0