19 declare(strict_types=1);
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();
92 $result_array = $this->
upload->getResults();
93 $result = end($result_array);
95 if (!($result instanceof
UploadResult) || !$result->isOK()) {
98 HandlerResult::STATUS_FAILED,
100 $result->getStatus()->getMessage()
104 $status = HandlerResult::STATUS_OK;
106 if ($this->rid ===
null) {
107 $i = $this->storage->manage()->upload($result, $this->stakeholder);
110 $this->storage->manage()->replaceWithUpload(
117 $this->storage->flavours()->ensure($i, $this->flavour);
129 if ($this->has_access ===
false) {
130 return $this->getAccessFailureResult(
139 HandlerResult::STATUS_OK,
141 "We just don't do anything here." 147 if (
null !== (
$id = $this->storage->manage()->find($identifier))) {
148 $revision = $this->storage->manage()->getCurrentRevision(
$id)->getInformation();
149 $title = $revision->getTitle();
151 $mime = $revision->getMimeType();
153 $title = $mime =
'unknown';
172 foreach ($file_ids as $identifier) {
176 return $info_results;
ResourceIdentification $rid
FlavourDefinition $flavour
ResourceStorageServices $storage
getRemoveResult(string $identifier)
__construct()
ilUIDemoFileUploadHandlerGUI constructor.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ResourceIdentification.
getFileIdentifierParameterName()
Class BasicHandlerResult.
Interface FileInfoResult.
Class ilCtrlAwareUploadHandler.
getInfoResult(string $identifier)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
__construct(Container $dic, ilPlugin $plugin)
language()
description: > Example for rendring a language glyph.
getInfoForExistingFiles(array $file_ids)
Class BasicFileInfoResult.