'type' => 'enum',
'enum' => array(
'all' => _("Show all parts"),
- 'atc' => _("Show attachments")
+ 'atc' => _("Show all attachments"),
+ 'none' => _("Do not show parts")
),
'desc' => _("Which message parts do you want to display in the summary?"));
* @param integer $contents_mask The mask needed for a
* IMP_Contents::getSummary() call.
* @param array $part_info_display The list of summary fields to display.
- * @param string $show_parts The value of the 'show_parts' pref.
+ * @param string $show_parts The value of the 'parts_display' pref.
*
* @return array An array with the following keys:
* <pre>
continue;
}
- if (!($render_mode = $imp_contents->canDisplay($mime_id, IMP_Contents::RENDER_INLINE | IMP_Contents::RENDER_INFO))) {
+ if ($render_mode = $imp_contents->canDisplay($mime_id, IMP_Contents::RENDER_INLINE | IMP_Contents::RENDER_INFO)) {
+ if (($show_parts == 'atc') &&
+ !($render_mode & IMP_Contents::RENDER_INLINE) &&
+ $imp_contents->isAttachment($mime_type)) {
+ $atc_parts[] = $mime_id;
+ }
+ } else {
if ($imp_contents->isAttachment($mime_type)) {
if ($show_parts == 'atc') {
$atc_parts[] = $mime_id;
$a_template->set('atc', Horde::widget('#', _("Attachments"), 'widget hasmenu', '', '', _("Attachments"), true));
if ($show_parts == 'atc') {
$a_template->set('show_parts_all', Horde::widget($headersURL->copy()->add(array('show_parts' => 'all')), _("Show All Message Parts"), 'widget', '', '', _("Show All Message Parts"), true));
-}
-if ($show_parts == 'all') {
+} elseif ($show_parts == 'all') {
$a_template->set('show_parts_atc', Horde::widget($headersURL->copy()->add(array('show_parts' => 'atc')), _("Show Attachments Only"), 'widget', '', '', _("Show Attachments Only"), true));
}
if (count($inlineout['display_ids']) > 2) {
}
}
-/* Show attachment information in headers? */
+/* Show attachment information in headers? 'atc_parts' will be empty if
+ * 'parts_display' pref is 'none'. */
if (!empty($inlineout['atc_parts'])) {
$tmp = array();