mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 12:41:30 +00:00
if $_GE['export'] is set the search result will be downloaded as a
zipfile
This commit is contained in:
parent
a6085279c9
commit
11bac92d2f
|
@ -414,6 +414,27 @@ if(isset($_GET["fullsearch"]) && $_GET["fullsearch"]) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if($_GET['export']) {
|
||||||
|
include("../inc/inc.ClassDownloadMgr.php");
|
||||||
|
$downmgr = new SeedDMS_Download_Mgr();
|
||||||
|
foreach($entries as $entry) {
|
||||||
|
if(get_class($entry) == $dms->getClassname('document')) {
|
||||||
|
$downmgr->addItem($entry->getLatestContent());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$filename = tempnam('/tmp', '');
|
||||||
|
$downmgr->createArchive($filename);
|
||||||
|
header("Content-Transfer-Encoding: binary");
|
||||||
|
header("Content-Length: " . filesize($filename));
|
||||||
|
header("Content-Disposition: attachment; filename=\"export-" .date('Y-m-d') . ".zip\"");
|
||||||
|
header("Content-Type: application/zip");
|
||||||
|
header("Cache-Control: must-revalidate");
|
||||||
|
|
||||||
|
readfile($filename);
|
||||||
|
unlink($filename);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
$totalPages = (int) (count($entries)/$limit);
|
$totalPages = (int) (count($entries)/$limit);
|
||||||
if(count($entries)%$limit)
|
if(count($entries)%$limit)
|
||||||
$totalPages++;
|
$totalPages++;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user