public function downloadAll() { $strFile = 'download_' . $this->strHash; $objZip = new \ZipWriter('system/tmp/' . $strFile); while (list($id, $item) = each($this->arrItems)) { // get view class by type $strClass = $GLOBALS['WLV'][$item->type]; if (!class_exists($strClass)) { continue; } $strategy = new $strClass(); $view = new WatchlistItemView($strategy); $objZip = $view->generateArchiveOutput($item, $objZip); } $objZip->close(); // Open the "save as …" dialogue $objFile = new \File('system/tmp/' . $strFile, true); $objFile->sendToBrowser($strFile . '.zip'); }