19 declare(strict_types=1);
50 ilExportHandlerConsumerContextInterface
$context,
51 ilExportHandlerConsumerFileIdentifierCollectionInterface $file_identifiers
53 foreach ($file_identifiers as $file_identifier) {
54 $file = explode(
":", $file_identifier->getIdentifier());
55 $file[1] = basename($file[1]);
57 $context->exportObject()->getId(),
58 str_replace(
"..",
"", $file[0]),
59 $context->exportObject()->getType()
61 $exp_file = $export_dir .
"/" . str_replace(
"..",
"", $file[1]);
62 $exp_dir = $export_dir .
"/" . substr($file[1], 0, strlen($file[1]) - 4);
63 if (is_file($exp_file)) {
68 count(scandir($exp_dir)) === 2
76 ilExportHandlerConsumerContextInterface
$context,
77 ilExportHandlerConsumerFileIdentifierCollectionInterface $file_identifiers
79 foreach ($file_identifiers as $file_identifier) {
80 $file = explode(
":", trim($file_identifier->getIdentifier()));
82 $context->exportObject()->getId(),
83 str_replace(
"..",
"", $file[0]),
84 $context->exportObject()->getType()
86 $file[1] = basename($file[1]);
88 $export_dir .
"/" . $file[1],
96 ilExportHandlerConsumerFileIdentifierInterface $file_identifier
98 $object_id = $reference_id->
toObjectId()->toInt();
100 $file = explode(
":", trim($file_identifier->getIdentifier()));
103 str_replace(
"..",
"", $file[0]),
106 $file[1] = basename($file[1]);
108 $export_dir .
"/" . $file[1],
114 ilExportHandlerConsumerContextInterface
$context,
115 ilExportHandlerConsumerFileIdentifierCollectionInterface $file_identifiers
116 ): ilExportHandlerFileInfoCollectionInterface {
117 $collection_builder = $context->fileCollectionBuilder();
118 $file_identifiers_array = $file_identifiers->toStringArray();
119 foreach ($this->
getFiles($context) as $file) {
120 if (in_array($file->getFileIdentifier(), $file_identifiers_array)) {
121 $collection_builder = $collection_builder->withFileInfo($file);
124 return $collection_builder->collection();
128 ilExportHandlerConsumerContextInterface
$context 129 ): ilExportHandlerFileInfoCollectionInterface {
130 $collection_builder = $context->fileCollectionBuilder();
132 $context->exportObject()->getId(),
133 $this->getExportType(),
134 $context->exportObject()->getType()
137 $context->exportObject()->getId(),
138 [$this->getExportType()],
139 $context->exportObject()->getType()
141 $object_id = $this->data_factory->objId($context->exportObject()->getId());
142 foreach ($file_infos as $file_name => $file_info) {
143 $collection_builder = $collection_builder->withSPLFileInfo(
144 new SplFileInfo($dir . DIRECTORY_SEPARATOR . $file_info[
"file"]),
149 return $collection_builder->collection();
static _getExportDirectory(int $a_obj_id, string $a_type="xml", string $a_obj_type="", string $a_entity="")
Get export directory for an repository object
Customizing of pimple-DIC for ILIAS.
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
getFileSelection(ilExportHandlerConsumerContextInterface $context, ilExportHandlerConsumerFileIdentifierCollectionInterface $file_identifiers)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
onDownloadFiles(ilExportHandlerConsumerContextInterface $context, ilExportHandlerConsumerFileIdentifierCollectionInterface $file_identifiers)
static _getExportFiles(int $a_obj_id, $a_export_types="", string $a_obj_type="")
onDeleteFiles(ilExportHandlerConsumerContextInterface $context, ilExportHandlerConsumerFileIdentifierCollectionInterface $file_identifiers)
getFiles(ilExportHandlerConsumerContextInterface $context)
onDownloadWithLink(ReferenceId $reference_id, ilExportHandlerConsumerFileIdentifierInterface $file_identifier)
ctrl()
Get the interface to the control structure.
static _lookupType(int $id, bool $reference=false)
ilDataFactory $data_factory