19 declare(strict_types=1);
46 $this->
language->loadLanguageModule(
'obj');
47 $this->
language->loadLanguageModule(
'cntr');
52 $icon = $this->common_settings->getPropertyIcon()->toLegacyForm($this->
language);
53 if (!is_null($this->legacy_form) && $icon !== null) {
54 $this->legacy_form->addItem($icon);
57 return $this->legacy_form;
62 if (is_null($this->legacy_form)) {
66 $item = $this->legacy_form->getItemByPostVar(
'icon');
67 if ($item && $item->getDeletionFlag()) {
68 $this->common_settings->storePropertyIcon(
69 $this->common_settings->getPropertyIcon()->withDeletedFlag()
74 $file_data = (array) $this->legacy_form->getInput(
'icon');
75 if (isset($file_data[
'tmp_name']) && $file_data[
'tmp_name']) {
77 if (!$this->
upload->hasBeenProcessed()) {
81 rename($file_data[
'tmp_name'], $tempfile);
83 $this->common_settings->storePropertyIcon(
84 $this->common_settings->getPropertyIcon()->withTempFileName(basename($tempfile))
91 if (!is_null($this->legacy_form)) {
92 $timg = $this->common_settings->getPropertyTileImage()->toLegacyForm($this->
language);
93 $this->legacy_form->addItem($timg);
96 return $this->legacy_form;
101 if (is_null($this->legacy_form)) {
105 $item = $this->legacy_form->getItemByPostVar(
'tile_image');
106 if ($item && $item->getDeletionFlag()) {
107 $this->common_settings->storePropertyTileImage(
108 $this->common_settings->getPropertyTileImage()->withDeletedFlag()
114 if (!$this->
upload->hasBeenProcessed()) {
117 $result_array = $this->
upload->getResults();
125 $file = $this->
http->request()->getUploadedFiles()[
'tile_image'];
126 if ($file->getClientFilename() ===
'') {
130 $temp_name = $file->getStream()->getMetadata(
'uri');
131 $result = $result_array[$temp_name] ?? null;
133 if (!($result instanceof
UploadResult) || !$result->isOK()) {
137 if ($item->getValue() === null || $item->getValue() ===
'') {
138 $i = $this->storage->manage()->upload($result, $this->stakeholder);
139 $this->storage->flavours()->ensure($i, $this->flavour);
140 $new_tile_image = $this->common_settings->getPropertyTileImage()
141 ->getTileImage()->withRid($i->serialize());
142 $this->common_settings->storePropertyTileImage(
143 $this->common_settings->getPropertyTileImage()->withTileImage($new_tile_image)
146 $i = $this->storage->manage()->find($item->getValue());
147 $this->storage->manage()->replaceWithUpload(
157 $title_and_icon_visibility_input = $this->common_settings->getPropertyTitleAndIconVisibility()
159 $this->legacy_form->addItem($title_and_icon_visibility_input);
161 return $this->legacy_form;
166 if (is_null($this->legacy_form)) {
170 $this->common_settings->storePropertyTitleAndIconVisibility(
177 $top_actions_visibility_input = $this->common_settings->getPropertyHeaderActionVisibility()
179 $this->legacy_form->addItem($top_actions_visibility_input);
181 return $this->legacy_form;
186 if (is_null($this->legacy_form)) {
190 $this->common_settings->storePropertyHeaderActionVisibility(
static http()
Fetches the global http state from ILIAS.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static ilTempnam(?string $a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory.