25 if (Helper::getInstance()->enabledZipMod())
27 $postfix = $this->
getRequest()->getQuery(
'postfix');
30 $context = Helper::getInstance()->getContextUser($postfix);
31 $setting =
new Setting($context);
33 if ($access[
'result'] ===
true)
37 $name = $structure->getArchiveName();
40 $name = Helper::DEFAULT_ARCHIVE_NAME;
42 $name .=
'.' . Helper::DEFAULT_ARCHIVE_FILE_EXTENSIONS;
47 $fileList = $structure->getFileList();
48 $archiveEntryBuilder =
new Zip\EntryBuilder();
49 if (is_array($fileList))
51 $folderName = Helper::STRUCTURE_FILES_NAME;
52 foreach ($fileList as $file)
54 $id = (int)$file[
'ID'];
55 $fileArray = \CFile::getFileArray($id);
58 $entry = $archiveEntryBuilder->createFromFileArray($fileArray, $folderName .
'/' . $id);
59 $files[$id] = array_merge(
61 'NAME' => $fileArray[
'ORIGINAL_NAME'],
65 $archive->addEntry($entry);
72 $structure->saveContent(
false, Helper::STRUCTURE_FILES_NAME, $files);
75 $smallFilesList = $structure->listSmallFile();
78 $structure->saveContent(
false, Helper::STRUCTURE_SMALL_FILES_NAME, $smallFilesList);
81 $folderFiles = $structure->getConfigurationFileList();
82 foreach ($folderFiles as $file)
84 $entry = $archiveEntryBuilder->createFromFileId((
int)$file[
'ID'], $file[
'NAME']);
87 $archive->addEntry($entry);