downloadAllList() public method

Get download all list.
public downloadAllList ( ) : array
return array An array of downloadable parts.
Example #1
0
 /**
  */
 public function downloadAll()
 {
     global $page_output, $session;
     $headers = $this->_contents->getHeader();
     $zipfile = trim(preg_replace('/[^\\pL\\pN-+_. ]/u', '_', $headers->getValue('subject')), ' _');
     if (empty($zipfile)) {
         $zipfile = _("attachments.zip");
     } else {
         $zipfile .= '.zip';
     }
     $page_output->disableCompression();
     $session->close();
     $tosave = array();
     foreach ($this->_contents->downloadAllList() as $val) {
         $mime = $this->_getRawDownloadPart($val);
         if (!($name = $mime->getName(true))) {
             $name = sprintf(_("part %s"), $val);
         }
         $tosave[] = array('data' => $mime->getContents(array('stream' => true)), 'name' => $name);
     }
     if (empty($tosave)) {
         return array();
     }
     return array('data' => Horde_Compress::factory('Zip')->compress($tosave, array('stream' => true)), 'name' => $zipfile, 'type' => 'application/zip');
 }