19declare(strict_types=1);
21use ILIAS\ILIASObject\Properties\UploadSecurityFunctionsTrait;
40 use UploadSecurityFunctionsTrait;
58 if (
$DIC->http()->wrapper()->query()->has(
'ref_id')) {
59 $transformation =
$DIC->refinery()->kindlyTo()->int();
60 $ref_id =
$DIC->http()->wrapper()->query()->retrieve(
'ref_id', $transformation);
63 $this->has_access = $this->getAccess(
68 if (
$DIC->http()->wrapper()->post()->has(
'rid')) {
69 $id =
$DIC->http()->wrapper()->post()->retrieve(
71 $DIC->refinery()->to()->string()
73 $this->rid =
$DIC->resourceStorage()->manage()->find(
$id);
76 $DIC->ctrl()->setParameterByClass(self::class,
'ref_id',
$ref_id);
78 $this->storage =
$DIC->resourceStorage();
90 if ($this->has_access ===
false) {
91 return $this->getAccessFailureResult(
100 $result_array = $this->
upload->getResults();
101 $result = end($result_array);
104 || !in_array($result->getMimeType(), TileImage::SUPPORTED_MIME_TYPES)
105 || !$result->isOK()) {
108 HandlerResult::STATUS_FAILED,
110 $result->getStatus()->getMessage()
114 $status = HandlerResult::STATUS_OK;
115 $message =
"file upload OK";
116 if ($this->rid ===
null) {
117 $i = $this->storage->manage()->upload($result, $this->stakeholder);
120 $this->storage->manage()->replaceWithUpload(
127 $this->storage->flavours()->ensure($i, $this->flavour);
139 if ($this->has_access ===
false) {
140 return $this->getAccessFailureResult(
149 HandlerResult::STATUS_OK,
151 "We just don't do anything here."
157 if (
null !== (
$id = $this->storage->manage()->find($identifier))) {
158 $revision = $this->storage->manage()->getCurrentRevision(
$id)->getInformation();
159 $title = $revision->getTitle();
161 $mime = $revision->getMimeType();
163 $title = $mime =
'unknown';
182 foreach ($file_ids as $identifier) {
186 return $info_results;
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Class ilCtrlAwareUploadHandler.
getFileIdentifierParameterName()
@inheritDoc
__construct()
ilUIDemoFileUploadHandlerGUI constructor.
Class BasicFileInfoResult.
Class BasicHandlerResult.
Class ResourceIdentification.
ResourceIdentification $rid
getInfoResult(string $identifier)
FlavourDefinition $flavour
getRemoveResult(string $identifier)
ResourceStorageServices $storage
getInfoForExistingFiles(array $file_ids)
getUploadResult()
@inheritDoc
Interface FileInfoResult.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc