19declare(strict_types=1);
21use ILIAS\ILIASObject\Properties\UploadSecurityFunctionsTrait;
38 use UploadSecurityFunctionsTrait;
44 protected ?
Custom $custom_icon =
null
51 if (
$DIC->http()->wrapper()->query()->has(
'ref_id')) {
52 $transformation =
$DIC->refinery()->kindlyTo()->int();
53 $ref_id =
$DIC->http()->wrapper()->query()->retrieve(
'ref_id', $transformation);
56 $this->has_access = $this->getAccess(
61 $DIC->ctrl()->setParameterByClass(self::class,
'ref_id',
$ref_id);
72 if ($this->has_access ===
false) {
73 return $this->getAccessFailureResult(
82 $result_array = $this->
upload->getResults();
83 $result = end($result_array);
86 && in_array($result->getMimeType(), Icon::SUPPORTED_MIME_TYPES)
88 $status = HandlerResult::STATUS_OK;
91 rename($result->getPath(), $tempfile);
93 $status = HandlerResult::STATUS_FAILED;
94 $message = $result->getStatus()->getMessage();
107 if ($this->has_access ===
false) {
108 return $this->getAccessFailureResult(
117 HandlerResult::STATUS_OK,
119 'There is nothing to do here.'
125 if ($this->has_access ===
false) {
134 $this->
language->txt(
'custom_icon'),
135 filesize($file_path),
136 MimeType::IMAGE__SVG_XML
getRemoveResult(string $file_name)
getUploadResult()
@inheritDoc
getInfoForExistingFiles(array $file_names)
getInfoResult(string $file_name)
Class ilCtrlAwareUploadHandler.
getFileIdentifierParameterName()
@inheritDoc
__construct()
ilUIDemoFileUploadHandlerGUI constructor.
Class BasicFileInfoResult.
Class BasicHandlerResult.
static ilTempnam(?string $a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory.
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