? _("Parts")
: sprintf(ngettext("%d Attachment", "%d Attachments", $atc_parts), $atc_parts);
$result['atc_download'] = (count($display_ids) > 2)
- ? Horde::link($imp_contents->urlView($imp_contents->getMIMEMessage(), 'download_all', array('params' => array('download_ids' => serialize($atc_parts))))) . '[' . _("Save All") . ']</a>'
+ ? Horde::link($imp_contents->urlView($imp_contents->getMIMEMessage(), 'download_all')) . '[' . _("Save All") . ']</a>'
: '';
}
}
break;
-case 'strip_attachment':
- $imp_message = &IMP_Message::singleton();
- $result = $imp_message->stripPart($imp_mailbox, Util::getFormData('imapid'));
- if (is_a($result, 'PEAR_Error')) {
- $notification->push($result, 'horde.error');
- }
-
- break;
-
case 'strip_all':
+case 'strip_attachment':
$imp_message = &IMP_Message::singleton();
- $result = $imp_message->stripPart($imp_mailbox);
+ $result = $imp_message->stripPart($imp_mailbox, ($actionID == 'strip_all') ? null : Util::getFormData('imapid'));
if (is_a($result, 'PEAR_Error')) {
$notification->push($result, 'horde.error');
}
-
break;
}
$a_template->set('show_parts_atc', Horde::widget(Util::addParameter($headersURL, array('show_parts' => 'atc')), _("Show Attachments Only"), 'widget', '', '', _("Show Attachments Only"), true));
}
if (count($display_ids) > 2) {
- $a_template->set('download_all', Horde::widget($imp_contents->urlView($imp_contents->getMIMEMessage(), 'download_all', array('params' => array('download_ids' => serialize($atc_parts)))), _("Download All Attachments (in .zip file)"), 'widget', '', '', _("Download All Attachments (in .zip file)"), true));
+ $a_template->set('download_all', Horde::widget($imp_contents->urlView($imp_contents->getMIMEMessage(), 'download_all'), _("Download All Attachments (in .zip file)"), 'widget', '', '', _("Download All Attachments (in .zip file)"), true));
if ($strip_atc) {
$a_template->set('strip_all', Horde::widget(Util::addParameter(Util::removeParameter(Horde::selfUrl(true), array('actionID')), array('actionID' => 'strip_all', 'message_token' => $message_token)), _("Strip All Attachments"), 'widget', '', "return window.confirm('" . addslashes(_("Are you sure you wish to PERMANENTLY delete all attachments?")) . "');", _("Strip All Attachments"), true));
}
* 'view_source'
* 'ctype' - (string) The content-type to use instead of the content-type
* found in the original Horde_Mime_Part object.
- * 'download_ids' - (string) For 'download_all', the serialized list of IDs to
- * download.
* 'id' - (string) The MIME part ID to display.
* 'index - (integer) The index of the message.
* 'mailbox' - (string) The mailbox of the message.
}
$tosave = array();
- foreach (unserialize(Util::getFormData('download_ids')) as $val) {
+ foreach ($contents->downloadAllList() as $val) {
$mime = $contents->getMIMEPart($val);
$name = $mime->getName(true);
if (!$name) {
$tosave[] = array('data' => $mime->getContents(), 'name' => $name);
}
- $horde_compress = &Horde_Compress::singleton('zip');
- $body = $horde_compress->compress($tosave);
- $browser->downloadHeaders($zipfile, 'application/zip', false, strlen($body));
- echo $body;
+ if (!empty($tosave)) {
+ $horde_compress = &Horde_Compress::singleton('zip');
+ $body = $horde_compress->compress($tosave);
+ $browser->downloadHeaders($zipfile, 'application/zip', false, strlen($body));
+ echo $body;
+ }
exit;
case 'download_attach':