ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
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 Stakeholder $stakeholder, private FlavourDefinition $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 36 of file class.ilObjectCommonSettingFormAdapter.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

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

47  {
48  $this->language->loadLanguageModule('obj');
49  $this->language->loadLanguageModule('cntr');
50  }
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 52 of file class.ilObjectCommonSettingFormAdapter.php.

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

53  {
54  $icon = $this->common_settings->getPropertyIcon()->toLegacyForm($this->language);
55  if (!is_null($this->legacy_form) && $icon !== null) {
56  $this->legacy_form->addItem($icon);
57  }
58 
59  return $this->legacy_form;
60  }
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 91 of file class.ilObjectCommonSettingFormAdapter.php.

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

92  {
93  if (!is_null($this->legacy_form)) {
94  $timg = $this->common_settings->getPropertyTileImage()->toLegacyForm($this->language);
95  $this->legacy_form->addItem($timg);
96  }
97 
98  return $this->legacy_form;
99  }
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 157 of file class.ilObjectCommonSettingFormAdapter.php.

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

158  {
159  $title_and_icon_visibility_input = $this->common_settings->getPropertyTitleAndIconVisibility()
160  ->toLegacyForm($this->language);
161  $this->legacy_form->addItem($title_and_icon_visibility_input);
162 
163  return $this->legacy_form;
164  }
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 177 of file class.ilObjectCommonSettingFormAdapter.php.

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

178  {
179  $top_actions_visibility_input = $this->common_settings->getPropertyHeaderActionVisibility()
180  ->toLegacyForm($this->language);
181  $this->legacy_form->addItem($top_actions_visibility_input);
182 
183  return $this->legacy_form;
184  }
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 62 of file class.ilObjectCommonSettingFormAdapter.php.

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

62  : void
63  {
64  if (is_null($this->legacy_form)) {
65  return;
66  }
67 
68  $item = $this->legacy_form->getItemByPostVar('icon');
69  if ($item && $item->getDeletionFlag()) {
70  $this->common_settings->storePropertyIcon(
71  $this->common_settings->getPropertyIcon()->withDeletedFlag()
72  );
73  return;
74  }
75 
76  $file_data = (array) $this->legacy_form->getInput('icon');
77  if (isset($file_data['tmp_name']) && $file_data['tmp_name']) {
78  $tempfile = ilFileUtils::ilTempnam();
79  if (!$this->upload->hasBeenProcessed()) {
80  $this->upload->process();
81  }
82 
83  rename($file_data['tmp_name'], $tempfile);
84 
85  $this->common_settings->storePropertyIcon(
86  $this->common_settings->getPropertyIcon()->withTempFileName(basename($tempfile))
87  );
88  }
89  }
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 166 of file class.ilObjectCommonSettingFormAdapter.php.

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

◆ saveTopActionsVisibility()

ilObjectCommonSettingFormAdapter::saveTopActionsVisibility ( )

Save top actions visibility setting from form.

Implements ilObjectCommonSettingFormAdapterInterface.

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

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

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