| | |
| | | |
| | | $rcmail = rcmail::get_instance(); |
| | | $menu = array(); |
| | | $ul_attr = $rcmail->config->get('skin') == 'classic' ? null : array('class' => 'toolbarmenu'); |
| | | $ul_attr = array('role' => 'menu', 'aria-labelledby' => 'aria-label-zipdownloadmenu'); |
| | | if ($rcmail->config->get('skin') != 'classic') { |
| | | $ul_attr['class'] = 'toolbarmenu'; |
| | | } |
| | | |
| | | foreach (array('eml', 'mbox', 'maildir') as $type) { |
| | | $menu[] = html::tag('li', null, $rcmail->output->button(array( |
| | |
| | | ))); |
| | | } |
| | | |
| | | $rcmail->output->add_footer(html::div(array('id' => 'zipdownload-menu', 'class' => 'popupmenu'), |
| | | $rcmail->output->add_footer(html::div(array('id' => 'zipdownload-menu', 'class' => 'popupmenu', 'aria-hidden' => 'true'), |
| | | html::tag('h2', array('class' => 'voice', 'id' => 'aria-label-zipdownloadmenu'), "Message Download Options Menu") . |
| | | html::tag('ul', $ul_attr, implode('', $menu)))); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | $disp_name = $this->_convert_filename($filename); |
| | | $disp_name = $this->_convert_filename($filename); |
| | | $tmpfn = tempnam($temp_dir, 'zipattach'); |
| | | $tmpfp = fopen($tmpfn, 'w'); |
| | | $tempfiles[] = $tmpfn; |
| | | |
| | | if ($part->body) { |
| | | $orig_message_raw = $part->body; |
| | | $zip->addFromString($disp_name, $orig_message_raw); |
| | | } |
| | | else { |
| | | $tmpfn = tempnam($temp_dir, 'zipattach'); |
| | | $tmpfp = fopen($tmpfn, 'w'); |
| | | $imap->get_message_part($message->uid, $part->mime_id, $part, null, $tmpfp, true); |
| | | $tempfiles[] = $tmpfn; |
| | | fclose($tmpfp); |
| | | $zip->addFile($tmpfn, $disp_name); |
| | | } |
| | | $message->get_part_body($part->mime_id, false, 0, $tmpfp); |
| | | $zip->addFile($tmpfn, $disp_name); |
| | | fclose($tmpfp); |
| | | } |
| | | |
| | | $zip->close(); |