ILIAS  release_8 Revision v8.24
ilObjectCommonSettingFormAdapter Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilObjectCommonSettingFormAdapter:
+ Collaboration diagram for ilObjectCommonSettingFormAdapter:

Public Member Functions

 __construct (ilObjectService $service, ilObject $object, 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
 addIcon ()
 Add icon setting to form. More...
 
 saveIcon ()
 Save icon setting from form. More...
 
 addTileImage ()
 Add tile image setting to form. More...
 
 saveTileImage ()
 Save tile image setting from 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...
 

Protected Attributes

ilObjectService $service
 
ilObject $object
 
ilPropertyFormGUI $legacy_form
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

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

Constructor & Destructor Documentation

◆ __construct()

ilObjectCommonSettingFormAdapter::__construct ( ilObjectService  $service,
ilObject  $object,
ilPropertyFormGUI  $legacy_form = null 
)

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

28 {
29 $this->service = $service;
30 $this->legacy_form = $legacy_form;
31 $this->object = $object;
32
33 $lng = $this->service->language();
34 $lng->loadLanguageModule('obj');
35 $lng->loadLanguageModule('cntr');
36 }
$lng

References $legacy_form, $lng, $object, and $service.

Member Function Documentation

◆ addIcon()

ilObjectCommonSettingFormAdapter::addIcon ( )

Add icon setting to form.

Implements ilObjectCommonSettingFormAdapterInterface.

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

39 {
40 global $DIC;
41
42 if (!is_null($this->legacy_form) && $this->service->settings()->get('custom_icons')) {
43 // we do not clone for legacy forms, since initEditCustomForm relies on 'call by reference' behaviour
44 //$this->legacy_form = clone $this->legacy_form;
45 $gui = new ilObjectCustomIconConfigurationGUI($DIC, null, $this->object);
46 $gui->addSettingsToForm($this->legacy_form);
47 }
48
49 return $this->legacy_form;
50 }
This class represents a property form user interface.
global $DIC
Definition: feed.php:28

References $DIC, and $legacy_form.

◆ addTileImage()

ilObjectCommonSettingFormAdapter::addTileImage ( )

Add tile image setting to form.

Implements ilObjectCommonSettingFormAdapterInterface.

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

64 {
65 $lng = $this->service->language();
66 $tile_image_fac = $this->service->commonSettings()->tileImage();
67
68 if (!is_null($this->legacy_form)) {
69 // we do not clone for legacy forms, since initEditCustomForm relies on 'call by reference' behaviour
70 //$this->legacy_form = clone $this->legacy_form;
71
72 $tile_image = $tile_image_fac->getByObjId($this->object->getId());
73 $timg = new ilImageFileInputGUI($lng->txt('obj_tile_image'), 'tile_image');
74 $timg->setInfo($lng->txt('obj_tile_image_info'));
75 $timg->setSuffixes($tile_image_fac->getSupportedFileExtensions());
76 $timg->setUseCache(false);
77 if ($tile_image->exists()) {
78 $timg->setImage($tile_image->getFullPath());
79 } else {
80 $timg->setImage('');
81 }
82 $this->legacy_form->addItem($timg);
83 }
84
85 return $this->legacy_form;
86 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $legacy_form, $lng, and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ addTitleIconVisibility()

ilObjectCommonSettingFormAdapter::addTitleIconVisibility ( )

Add title icon visibility setting to form.

Implements ilObjectCommonSettingFormAdapterInterface.

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

110 {
111 $hide = new ilCheckboxInputGUI(
112 $this->service->language()->txt('obj_show_title_and_icon'),
113 'show_header_icon_and_title'
114 );
115 $hide->setValue('1');
116 $hide->setChecked(
117 !((bool) ilContainer::_lookupContainerSetting($this->object->getId(), 'hide_header_icon_and_title'))
118 );
119 $this->legacy_form->addItem($hide);
120
121 return $this->legacy_form;
122 }
This class represents a checkbox property in a property form.
static _lookupContainerSetting(int $a_id, string $a_keyword, string $a_default_value=null)

References $legacy_form, ilContainer\_lookupContainerSetting(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ addTopActionsVisibility()

ilObjectCommonSettingFormAdapter::addTopActionsVisibility ( )

Add top actions visibility setting to form.

Implements ilObjectCommonSettingFormAdapterInterface.

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

137 {
138 $hide = new ilCheckboxInputGUI(
139 $this->service->language()->txt('obj_show_header_actions'),
140 'show_top_actions'
141 );
142 $hide->setValue('1');
143 $hide->setChecked(
144 !((bool) ilContainer::_lookupContainerSetting($this->object->getId(), 'hide_top_actions'))
145 );
146 $this->legacy_form->addItem($hide);
147
148 return $this->legacy_form;
149 }

References $legacy_form, ilContainer\_lookupContainerSetting(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ saveIcon()

ilObjectCommonSettingFormAdapter::saveIcon ( )

Save icon setting from form.

Implements ilObjectCommonSettingFormAdapterInterface.

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

52 : void
53 {
54 global $DIC;
55
56 if (!is_null($this->legacy_form) && $this->service->settings()->get('custom_icons')) {
57 $this->legacy_form = clone $this->legacy_form;
58 $gui = new ilObjectCustomIconConfigurationGUI($DIC, null, $this->object);
59 $gui->saveIcon($this->legacy_form);
60 }
61 }

References $DIC, and $legacy_form.

◆ saveTitleIconVisibility()

ilObjectCommonSettingFormAdapter::saveTitleIconVisibility ( )

Save title icon visibility setting from form.

Implements ilObjectCommonSettingFormAdapterInterface.

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

124 : void
125 {
126 if (!is_null($this->legacy_form)) {
127 // hide icon/title
129 $this->object->getId(),
130 'hide_header_icon_and_title',
131 (string) !$this->legacy_form->getInput('show_header_icon_and_title')
132 );
133 }
134 }
static _writeContainerSetting(int $a_id, string $a_keyword, string $a_value)

References ilContainer\_writeContainerSetting(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ saveTopActionsVisibility()

ilObjectCommonSettingFormAdapter::saveTopActionsVisibility ( )

Save top actions visibility setting from form.

Implements ilObjectCommonSettingFormAdapterInterface.

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

151 : void
152 {
153 if (!is_null($this->legacy_form)) {
154 // hide icon/title
156 $this->object->getId(),
157 'hide_top_actions',
158 (string) !$this->legacy_form->getInput('show_top_actions')
159 );
160 }
161 }

References ilContainer\_writeContainerSetting(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

Field Documentation

◆ $legacy_form

ilPropertyFormGUI ilObjectCommonSettingFormAdapter::$legacy_form
protected

◆ $object

ilObject ilObjectCommonSettingFormAdapter::$object
protected

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

Referenced by __construct().

◆ $service

ilObjectService ilObjectCommonSettingFormAdapter::$service
protected

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

Referenced by __construct().


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