From: Michael M Slusarz Date: Fri, 30 Oct 2009 21:38:30 +0000 (-0600) Subject: Re-add atc_display preference X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=881ad52ecffee5f617b7bc5f16f584641afb041a;p=horde.git Re-add atc_display preference --- diff --git a/imp/config/prefs.php.dist b/imp/config/prefs.php.dist index ff0961962..e5adb9237 100644 --- a/imp/config/prefs.php.dist +++ b/imp/config/prefs.php.dist @@ -101,7 +101,8 @@ $prefGroups['viewing'] = array( 'html_image_replacement', 'html_image_addrbook', 'highlight_text', 'highlight_simple_markup', 'show_quoteblocks', 'dim_signature', 'emoticons', - 'parts_display', 'mail_hdr', 'default_msg_charset') + 'parts_display', 'atc_display', 'mail_hdr', + 'default_msg_charset') ); if (!empty($GLOBALS['conf']['maillog']['use_maillog'])) { $prefGroups['viewing']['members'] = array_merge($prefGroups['viewing']['members'], array('disposition_send_mdn')); @@ -922,6 +923,14 @@ $_prefs['parts_display'] = array( ), 'desc' => _("Which message parts do you want to display in the summary?")); +// Should attachment summaries be displayed inline? +$_prefs['atc_display'] = array( + 'value' => 1, + 'locked' => false, + 'shared' => false, + 'type' => 'checkbox', + 'desc' => _("Display attachment summary information within the message text?")); + // Display custom headers (configured via the identity screen) when viewing // messages? $_prefs['mail_hdr'] = array( diff --git a/imp/lib/Views/ShowMessage.php b/imp/lib/Views/ShowMessage.php index fefa932e4..d8d1bacaa 100644 --- a/imp/lib/Views/ShowMessage.php +++ b/imp/lib/Views/ShowMessage.php @@ -267,10 +267,16 @@ class IMP_Views_ShowMessage continue; } + 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)) { - $atc_parts[] = $mime_id; + if ($imp_contents->isAttachment($mime_type)) { + if ($show_parts == 'atc') { + $atc_parts[] = $mime_id; + } + + if ($GLOBALS['prefs']->getValue('atc_display')) { + $result['msgtext'] .= $imp_ui->formatSummary($imp_contents->getSummary($mime_id, $contents_mask), $part_info_display); + } } continue; } diff --git a/imp/message.php b/imp/message.php index 826c76d6e..f72a40644 100644 --- a/imp/message.php +++ b/imp/message.php @@ -603,8 +603,14 @@ foreach ($parts_list as $mime_id => $mime_type) { } 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)) { - $atc_parts[] = $mime_id; + if ($imp_contents->isAttachment($mime_type)) { + if ($show_parts == 'atc') { + $atc_parts[] = $mime_id; + } + + if ($prefs->getValue('atc_display')) { + $msgtext .= $imp_ui->formatSummary($imp_contents->getSummary($mime_id, $contents_mask), $part_info_display); + } } continue; }