ILIAS  trunk Revision v11.0_alpha-1843-g9e1fad99175
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilObjectCommonSettingFormAdapter Class Reference
+ Inheritance diagram for ilObjectCommonSettingFormAdapter:
+ Collaboration diagram for ilObjectCommonSettingFormAdapter:

Public Member Functions

 __construct (private ilLanguage $language, private FileUpload $upload, private ResourceStorageServices $storage, private ilObjectTileImageStakeholder $stakeholder, private ilObjectTileImageFlavourDefinition $flavour, private ilObjectCommonSettings $common_settings, private Services $http, private ?ilPropertyFormGUI $legacy_form=null)
 
 addIcon ()
 Add icon setting to form. More...
 
 saveIcon ()
 Save icon setting from form. More...
 
 addTileImage ()
 Add tile image setting to form. More...
 
 addTitleIconVisibility ()
 Add title icon visibility setting to form. More...
 
 saveTitleIconVisibility ()
 Save title icon visibility setting from form. More...
 
 addTopActionsVisibility ()
 Add top actions visibility setting to form. More...
 
 saveTopActionsVisibility ()
 Save top actions visibility setting from form. More...
 
- Public Member Functions inherited from ilObjectCommonSettingFormAdapterInterface
 saveTileImage ()
 Save tile image setting from form. More...
 

Detailed Description

Deprecated:
11: This class will be remove with ILIAS 11.

Please use the corresponding implementation of ilObjectProperty instead.

Definition at line 34 of file class.ilObjectCommonSettingFormAdapter.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjectCommonSettingFormAdapter::__construct ( private ilLanguage  $language,
private FileUpload  $upload,
private ResourceStorageServices  $storage,
private ilObjectTileImageStakeholder  $stakeholder,
private ilObjectTileImageFlavourDefinition  $flavour,
private ilObjectCommonSettings  $common_settings,
private Services  $http,
private ?ilPropertyFormGUI  $legacy_form = null 
)

Definition at line 36 of file class.ilObjectCommonSettingFormAdapter.php.

References ILIAS\UI\examples\Symbol\Glyph\Language\language().

45  {
46  $this->language->loadLanguageModule('obj');
47  $this->language->loadLanguageModule('cntr');
48  }
language()
description: > Example for rendring a language glyph.
Definition: language.php:41
+ Here is the call graph for this function:

Member Function Documentation

◆ addIcon()

ilObjectCommonSettingFormAdapter::addIcon ( )

Add icon setting to form.

Implements ilObjectCommonSettingFormAdapterInterface.

Definition at line 50 of file class.ilObjectCommonSettingFormAdapter.php.

References ILIAS\UI\examples\Symbol\Glyph\Language\language(), and null.

51  {
52  $icon = $this->common_settings->getPropertyIcon()->toLegacyForm($this->language);
53  if (!is_null($this->legacy_form) && $icon !== null) {
54  $this->legacy_form->addItem($icon);
55  }
56 
57  return $this->legacy_form;
58  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
language()
description: > Example for rendring a language glyph.
Definition: language.php:41
+ Here is the call graph for this function:

◆ addTileImage()

ilObjectCommonSettingFormAdapter::addTileImage ( )

Add tile image setting to form.

Implements ilObjectCommonSettingFormAdapterInterface.

Definition at line 89 of file class.ilObjectCommonSettingFormAdapter.php.

References ILIAS\FileDelivery\http(), ILIAS\UI\examples\Symbol\Glyph\Language\language(), null, ilObjectCommonSettingFormAdapterInterface\saveTileImage(), and ILIAS\Repository\upload().

90  {
91  if (!is_null($this->legacy_form)) {
92  $timg = $this->common_settings->getPropertyTileImage()->toLegacyForm($this->language);
93  $this->legacy_form->addItem($timg);
94  }
95 
96  return $this->legacy_form;
97  }
language()
description: > Example for rendring a language glyph.
Definition: language.php:41
+ Here is the call graph for this function:

◆ addTitleIconVisibility()

ilObjectCommonSettingFormAdapter::addTitleIconVisibility ( )

Add title icon visibility setting to form.

Implements ilObjectCommonSettingFormAdapterInterface.

Definition at line 155 of file class.ilObjectCommonSettingFormAdapter.php.

References ILIAS\UI\examples\Symbol\Glyph\Language\language().

156  {
157  $title_and_icon_visibility_input = $this->common_settings->getPropertyTitleAndIconVisibility()
158  ->toLegacyForm($this->language);
159  $this->legacy_form->addItem($title_and_icon_visibility_input);
160 
161  return $this->legacy_form;
162  }
language()
description: > Example for rendring a language glyph.
Definition: language.php:41
+ Here is the call graph for this function:

◆ addTopActionsVisibility()

ilObjectCommonSettingFormAdapter::addTopActionsVisibility ( )

Add top actions visibility setting to form.

Implements ilObjectCommonSettingFormAdapterInterface.

Definition at line 175 of file class.ilObjectCommonSettingFormAdapter.php.

References ILIAS\UI\examples\Symbol\Glyph\Language\language().

176  {
177  $top_actions_visibility_input = $this->common_settings->getPropertyHeaderActionVisibility()
178  ->toLegacyForm($this->language);
179  $this->legacy_form->addItem($top_actions_visibility_input);
180 
181  return $this->legacy_form;
182  }
language()
description: > Example for rendring a language glyph.
Definition: language.php:41
+ Here is the call graph for this function:

◆ saveIcon()

ilObjectCommonSettingFormAdapter::saveIcon ( )

Save icon setting from form.

Implements ilObjectCommonSettingFormAdapterInterface.

Definition at line 60 of file class.ilObjectCommonSettingFormAdapter.php.

References ilFileUtils\ilTempnam(), and ILIAS\Repository\upload().

60  : void
61  {
62  if (is_null($this->legacy_form)) {
63  return;
64  }
65 
66  $item = $this->legacy_form->getItemByPostVar('icon');
67  if ($item && $item->getDeletionFlag()) {
68  $this->common_settings->storePropertyIcon(
69  $this->common_settings->getPropertyIcon()->withDeletedFlag()
70  );
71  return;
72  }
73 
74  $file_data = (array) $this->legacy_form->getInput('icon');
75  if (isset($file_data['tmp_name']) && $file_data['tmp_name']) {
76  $tempfile = ilFileUtils::ilTempnam();
77  if (!$this->upload->hasBeenProcessed()) {
78  $this->upload->process();
79  }
80 
81  rename($file_data['tmp_name'], $tempfile);
82 
83  $this->common_settings->storePropertyIcon(
84  $this->common_settings->getPropertyIcon()->withTempFileName(basename($tempfile))
85  );
86  }
87  }
static ilTempnam(?string $a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory.
+ Here is the call graph for this function:

◆ saveTitleIconVisibility()

ilObjectCommonSettingFormAdapter::saveTitleIconVisibility ( )

Save title icon visibility setting from form.

Implements ilObjectCommonSettingFormAdapterInterface.

Definition at line 164 of file class.ilObjectCommonSettingFormAdapter.php.

164  : void
165  {
166  if (is_null($this->legacy_form)) {
167  return;
168  }
169 
170  $this->common_settings->storePropertyTitleAndIconVisibility(
171  new ilObjectPropertyTitleAndIconVisibility((bool) $this->legacy_form->getInput('show_header_icon_and_title'))
172  );
173  }

◆ saveTopActionsVisibility()

ilObjectCommonSettingFormAdapter::saveTopActionsVisibility ( )

Save top actions visibility setting from form.

Implements ilObjectCommonSettingFormAdapterInterface.

Definition at line 184 of file class.ilObjectCommonSettingFormAdapter.php.

184  : void
185  {
186  if (is_null($this->legacy_form)) {
187  return;
188  }
189 
190  $this->common_settings->storePropertyHeaderActionVisibility(
191  new ilObjectPropertyHeaderActionVisibility((bool) $this->legacy_form->getInput('show_top_actions'))
192  );
193  }

The documentation for this class was generated from the following file: