19 declare(strict_types=1);
48 $this->
language->loadLanguageModule(
'obj');
49 $this->
language->loadLanguageModule(
'cntr');
54 $icon = $this->common_settings->getPropertyIcon()->toLegacyForm($this->
language);
55 if (!is_null($this->legacy_form) && $icon !==
null) {
56 $this->legacy_form->addItem($icon);
59 return $this->legacy_form;
64 if (is_null($this->legacy_form)) {
68 $item = $this->legacy_form->getItemByPostVar(
'icon');
69 if ($item && $item->getDeletionFlag()) {
70 $this->common_settings->storePropertyIcon(
71 $this->common_settings->getPropertyIcon()->withDeletedFlag()
76 $file_data = (array) $this->legacy_form->getInput(
'icon');
77 if (isset($file_data[
'tmp_name']) && $file_data[
'tmp_name']) {
79 if (!$this->
upload->hasBeenProcessed()) {
83 rename($file_data[
'tmp_name'], $tempfile);
85 $this->common_settings->storePropertyIcon(
86 $this->common_settings->getPropertyIcon()->withTempFileName(basename($tempfile))
93 if (!is_null($this->legacy_form)) {
94 $timg = $this->common_settings->getPropertyTileImage()->toLegacyForm($this->
language);
95 $this->legacy_form->addItem($timg);
98 return $this->legacy_form;
103 if (is_null($this->legacy_form)) {
107 $item = $this->legacy_form->getItemByPostVar(
'tile_image');
108 if ($item && $item->getDeletionFlag()) {
109 $this->common_settings->storePropertyTileImage(
110 $this->common_settings->getPropertyTileImage()->withDeletedFlag()
116 if (!$this->
upload->hasBeenProcessed()) {
119 $result_array = $this->
upload->getResults();
127 $file = $this->
http->request()->getUploadedFiles()[
'tile_image'];
128 if ($file->getClientFilename() ===
'') {
132 $temp_name = $file->getStream()->getMetadata(
'uri');
133 $result = $result_array[$temp_name] ??
null;
135 if (!($result instanceof
UploadResult) || !$result->isOK()) {
139 if ($item->getValue() === null || $item->getValue() ===
'') {
140 $i = $this->storage->manage()->upload($result, $this->stakeholder);
141 $this->storage->flavours()->ensure($i, $this->flavour);
142 $new_tile_image = $this->common_settings->getPropertyTileImage()
143 ->getTileImage()->withRid($i->serialize());
144 $this->common_settings->storePropertyTileImage(
145 $this->common_settings->getPropertyTileImage()->withTileImage($new_tile_image)
148 $i = $this->storage->manage()->find($item->getValue());
149 $this->storage->manage()->replaceWithUpload(
159 $title_and_icon_visibility_input = $this->common_settings->getPropertyTitleAndIconVisibility()
161 $this->legacy_form->addItem($title_and_icon_visibility_input);
163 return $this->legacy_form;
168 if (is_null($this->legacy_form)) {
172 $this->common_settings->storePropertyTitleAndIconVisibility(
179 $top_actions_visibility_input = $this->common_settings->getPropertyHeaderActionVisibility()
181 $this->legacy_form->addItem($top_actions_visibility_input);
183 return $this->legacy_form;
188 if (is_null($this->legacy_form)) {
192 $this->common_settings->storePropertyHeaderActionVisibility(
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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.
language()
description: > Example for rendring a language glyph.