summaryrefslogtreecommitdiff
path: root/plugins/zipdownload/zipdownload.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/zipdownload/zipdownload.php')
-rw-r--r--plugins/zipdownload/zipdownload.php27
1 files changed, 11 insertions, 16 deletions
diff --git a/plugins/zipdownload/zipdownload.php b/plugins/zipdownload/zipdownload.php
index 59431267d..443fef728 100644
--- a/plugins/zipdownload/zipdownload.php
+++ b/plugins/zipdownload/zipdownload.php
@@ -62,14 +62,11 @@ class zipdownload extends rcube_plugin
// only show the link if there is more than the configured number of attachments
if (substr_count($p['content'], '<li') > $rcmail->config->get('zipdownload_attachments', 1)) {
- $href = $rcmail->url(array(
- '_action' => 'plugin.zipdownload.zip_attachments',
- '_mbox' => $rcmail->output->env['mailbox'],
- '_uid' => $rcmail->output->env['uid'],
- ));
-
- $link = html::a(array('href' => $href, 'class' => 'button zipdownload'),
- rcube::Q($this->gettext('downloadall'))
+ $link = html::a(array(
+ 'href' => rcmail_url('plugin.zipdownload.zip_attachments', array('_mbox' => $rcmail->output->env['mailbox'], '_uid' => $rcmail->output->env['uid'])),
+ 'class' => 'button zipdownload',
+ ),
+ Q($this->gettext('downloadall'))
);
// append link to attachments list, slightly different in some skins
@@ -99,7 +96,7 @@ class zipdownload extends rcube_plugin
$temp_dir = $rcmail->config->get('temp_dir');
$tmpfname = tempnam($temp_dir, 'zipdownload');
$tempfiles = array($tmpfname);
- $message = new rcube_message(rcube_utils::get_input_value('_uid', rcube_utils::INPUT_GET));
+ $message = new rcube_message(get_input_value('_uid', RCUBE_INPUT_GET));
// open zip file
$zip = new ZipArchive();
@@ -143,7 +140,7 @@ class zipdownload extends rcube_plugin
public function download_selection()
{
if (isset($_REQUEST['_uid'])) {
- $uids = explode(",", rcube_utils::get_input_value('_uid', rcube_utils::INPUT_GPC));
+ $uids = explode(",", get_input_value('_uid', RCUBE_INPUT_GPC));
if (sizeof($uids) > 0)
$this->_download_messages($uids);
@@ -160,7 +157,7 @@ class zipdownload extends rcube_plugin
// initialize searching result if search_filter is used
if ($_SESSION['search_filter'] && $_SESSION['search_filter'] != 'ALL') {
- $imap->search($mbox_name, $_SESSION['search_filter'], RCUBE_CHARSET);
+ $imap->search($mbox_name, $_SESSION['search_filter'], RCMAIL_CHARSET);
}
// fetch message headers for all pages
@@ -169,7 +166,7 @@ class zipdownload extends rcube_plugin
for ($i = 0; ($i * $imap->get_pagesize()) <= $count; $i++) {
$a_headers = $imap->list_messages($mbox_name, ($i + 1));
- foreach ($a_headers as $header) {
+ foreach ($a_headers as $n => $header) {
if (empty($header))
continue;
@@ -199,7 +196,7 @@ class zipdownload extends rcube_plugin
$zip = new ZipArchive();
$zip->open($tmpfname, ZIPARCHIVE::OVERWRITE);
- foreach ($uids as $uid){
+ foreach ($uids as $key => $uid){
$headers = $imap->get_message_headers($uid);
$subject = rcube_mime::decode_mime_string((string)$headers->subject);
$subject = $this->_convert_filename($subject);
@@ -237,9 +234,7 @@ class zipdownload extends rcube_plugin
private function _deliver_zipfile($tmpfname, $filename)
{
$browser = new rcube_browser;
- $rcmail = rcmail::get_instance();
-
- $rcmail->output->nocacheing_headers();
+ send_nocacheing_headers();
if ($browser->ie && $browser->ver < 7)
$filename = rawurlencode(abbreviate_string($filename, 55));