Re-add atc_display preference
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 30 Oct 2009 21:38:30 +0000 (15:38 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 30 Oct 2009 21:38:30 +0000 (15:38 -0600)
imp/config/prefs.php.dist
imp/lib/Views/ShowMessage.php
imp/message.php

index ff09619..e5adb92 100644 (file)
@@ -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(
index fefa932..d8d1bac 100644 (file)
@@ -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;
             }
index 826c76d..f72a406 100644 (file)
@@ -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;
     }