plugin->test_constructor_gatekeeper(); $ids = get_input('item'); if (!is_array($ids)) $ids = array($ids); $forward_to = "items/view"; $input_values = get_inputs(); $_SESSION['input_values'] = $input_values; if (empty($ids)) { forward(""); } if (get_input('delete_button', false) && $ids) { $delete_failed = false; $tester = new Tester(); foreach ($ids as $id) { if (!$tester->deleteType("", $id)) { $delete_failed = true; } } if ($delete_failed) { $TeKe->add_system_message(_("At least one of the deletions failed."), 'error'); forward($forward_to); } $TeKe->add_system_message(_("Deleted")); } else if (get_input('export_button', false) && $ids) { $exporter = new Exporter(); $filename = $exporter->export($ids); /*$zip = new ZipArchive; $res = $zip->open("items.zip", ZipArchive::CREATE); if ($res === true) { foreach ($ids as $id) { $item = $TeKe->plugin->loadType("", $id); $itemXML = $item->getXML(); $zip->addFromString("{$id}.xml", $itemXML); } $zip->close(); }*/ header("Content-type: application/zip"); header("Content-Disposition: attachment; filename=items.zip"); header("Pragma: no-cache"); header("Expires: 0"); readfile($filename); unlink($filename); //header("Location: items.zip"); exit; //echo $zipcontent; } else { $TeKe->add_system_message(_("No action")); } forward($forward_to); ?>