ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilObjectCommonSettingFormAdapter Class Reference

Common settings form adapter. More...

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

Public Member Functions

 __construct (ilObjectService $service, ilObject $object, ilPropertyFormGUI $legacy_form=null)
 Constructor. More...
 
 addIcon ()
 Add icon setting to form.
Returns
null|ilPropertyFormGUI
More...
 
 saveIcon ()
 Save icon setting from form. More...
 
 addTileImage ()
 Add tile image setting to form.
Returns
null|ilPropertyFormGUI
More...
 
 addTitleIconVisibility ()
 Add title icon visibility setting to form.
Returns
null|ilPropertyFormGUI
More...
 
 saveTitleIconVisibility ()
 Save title icon visibility setting from form. More...
 
 addTopActionsVisibility ()
 Add top actions visibility setting to form.
Returns
null|ilPropertyFormGUI
More...
 
 saveTopActionsVisibility ()
 Save top actions visibility setting from form. More...
 
- Public Member Functions inherited from ilObjectCommonSettingFormAdapterInterface
 saveTileImage ()
 Save tile image setting from form. More...
 

Protected Attributes

 $service
 
 $legacy_form
 
 $object
 

Detailed Description

Common settings form adapter.

Helps to add and save common object settings for repository objects.

Author
killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 11 of file class.ilObjectCommonSettingsFormAdapter.php.

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

Definition at line 31 of file class.ilObjectCommonSettingsFormAdapter.php.

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

32  {
33  $this->service = $service;
34  $this->legacy_form = $legacy_form;
35  $this->object = $object;
36 
37  $lng = $this->service->language();
38  $lng->loadLanguageModule("obj");
39  $lng->loadLanguageModule("cntr");
40  }
$lng

Member Function Documentation

◆ addIcon()

ilObjectCommonSettingFormAdapter::addIcon ( )

Add icon setting to form.

Returns
null|ilPropertyFormGUI

Implements ilObjectCommonSettingFormAdapterInterface.

Definition at line 45 of file class.ilObjectCommonSettingsFormAdapter.php.

References $DIC, and $legacy_form.

46  {
47  global $DIC;
48 
49  if ($this->service->settings()->get('custom_icons')) {
50  if (!is_null($this->legacy_form)) {
51  // we do not clone for legacy forms, since initEditCustomForm relies on "call by reference" behaviour
52  //$this->legacy_form = clone $this->legacy_form;
53  require_once 'Services/Object/Icon/classes/class.ilObjectCustomIconConfigurationGUI.php';
54  $gui = new \ilObjectCustomIconConfigurationGUI($DIC, null, $this->object);
55  $gui->addSettingsToForm($this->legacy_form);
56  }
57  }
58  return $this->legacy_form;
59  }
This class represents a property form user interface.
global $DIC
Definition: saml.php:7

◆ addTileImage()

ilObjectCommonSettingFormAdapter::addTileImage ( )

Add tile image setting to form.

Returns
null|ilPropertyFormGUI

Implements ilObjectCommonSettingFormAdapterInterface.

Definition at line 81 of file class.ilObjectCommonSettingsFormAdapter.php.

References $legacy_form, $lng, and ilObjectCommonSettingFormAdapterInterface\saveTileImage().

82  {
83  $lng = $this->service->language();
84  $tile_image_fac = $this->service->commonSettings()->tileImage();
85 
86  if (!is_null($this->legacy_form)) {
87  // we do not clone for legacy forms, since initEditCustomForm relies on "call by reference" behaviour
88  //$this->legacy_form = clone $this->legacy_form;
89 
90  $tile_image = $tile_image_fac->getByObjId($this->object->getId());
91  $timg = new \ilImageFileInputGUI($lng->txt('obj_tile_image'), 'tile_image');
92  $timg->setInfo($lng->txt('obj_tile_image_info'));
93  $timg->setSuffixes($tile_image_fac->getSupportedFileExtensions());
94  $timg->setUseCache(false);
95  if ($tile_image->exists()) {
96  $timg->setImage($tile_image->getFullPath());
97  } else {
98  $timg->setImage('');
99  }
100  $this->legacy_form->addItem($timg);
101 
102  /*
103  $file = new ilFileStandardDropzoneInputGUI($lng->txt('obj_tile_image'), 'tile_image');
104  $file->setRequired(false);
105  $file->setSuffixes($tile_image_fac->getSupportedFileExtensions());
106  $this->legacy_form->addItem($file);*/
107  }
108 
109  return $this->legacy_form;
110  }
This class represents a property form user interface.
$lng
+ Here is the call graph for this function:

◆ addTitleIconVisibility()

ilObjectCommonSettingFormAdapter::addTitleIconVisibility ( )

Add title icon visibility setting to form.

Returns
null|ilPropertyFormGUI

Implements ilObjectCommonSettingFormAdapterInterface.

Definition at line 138 of file class.ilObjectCommonSettingsFormAdapter.php.

References $legacy_form, $lng, ilContainer\_lookupContainerSetting(), and ilCheckboxInputGUI\setChecked().

139  {
140  $lng = $this->service->language();
141  $hide = new ilCheckboxInputGUI($lng->txt("obj_show_title_and_icon"), "show_header_icon_and_title");
142  $hide->setChecked(!ilContainer::_lookupContainerSetting($this->object->getId(), "hide_header_icon_and_title"));
143  $this->legacy_form->addItem($hide);
144  return $this->legacy_form;
145  }
This class represents a property form user interface.
This class represents a checkbox property in a property form.
setChecked($a_checked)
Set Checked.
$lng
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
+ Here is the call graph for this function:

◆ addTopActionsVisibility()

ilObjectCommonSettingFormAdapter::addTopActionsVisibility ( )

Add top actions visibility setting to form.

Returns
null|ilPropertyFormGUI

Implements ilObjectCommonSettingFormAdapterInterface.

Definition at line 165 of file class.ilObjectCommonSettingsFormAdapter.php.

References $legacy_form, $lng, ilContainer\_lookupContainerSetting(), and ilCheckboxInputGUI\setChecked().

166  {
167  $lng = $this->service->language();
168  $hide = new ilCheckboxInputGUI($lng->txt("obj_show_header_actions"), "show_top_actions");
169  $hide->setChecked(!ilContainer::_lookupContainerSetting($this->object->getId(), "hide_top_actions"));
170  $this->legacy_form->addItem($hide);
171  return $this->legacy_form;
172  }
This class represents a property form user interface.
This class represents a checkbox property in a property form.
setChecked($a_checked)
Set Checked.
$lng
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
+ Here is the call graph for this function:

◆ saveIcon()

ilObjectCommonSettingFormAdapter::saveIcon ( )

Save icon setting from form.

Implements ilObjectCommonSettingFormAdapterInterface.

Definition at line 64 of file class.ilObjectCommonSettingsFormAdapter.php.

References $DIC, and $legacy_form.

65  {
66  global $DIC;
67 
68  if ($this->service->settings()->get('custom_icons')) {
69  if (!is_null($this->legacy_form)) {
70  $this->legacy_form = clone $this->legacy_form;
71  require_once 'Services/Object/Icon/classes/class.ilObjectCustomIconConfigurationGUI.php';
72  $gui = new \ilObjectCustomIconConfigurationGUI($DIC, null, $this->object);
73  $gui->saveIcon($this->legacy_form);
74  }
75  }
76  }
global $DIC
Definition: saml.php:7

◆ saveTitleIconVisibility()

ilObjectCommonSettingFormAdapter::saveTitleIconVisibility ( )

Save title icon visibility setting from form.

Implements ilObjectCommonSettingFormAdapterInterface.

Definition at line 150 of file class.ilObjectCommonSettingsFormAdapter.php.

References ilContainer\_writeContainerSetting().

151  {
152  if (!is_null($this->legacy_form)) {
153  // hide icon/title
155  $this->object->getId(),
156  "hide_header_icon_and_title",
157  !$this->legacy_form->getInput("show_header_icon_and_title")
158  );
159  }
160  }
static _writeContainerSetting($a_id, $a_keyword, $a_value)
+ Here is the call graph for this function:

◆ saveTopActionsVisibility()

ilObjectCommonSettingFormAdapter::saveTopActionsVisibility ( )

Save top actions visibility setting from form.

Implements ilObjectCommonSettingFormAdapterInterface.

Definition at line 177 of file class.ilObjectCommonSettingsFormAdapter.php.

References ilContainer\_writeContainerSetting().

178  {
179  if (!is_null($this->legacy_form)) {
180  // hide icon/title
182  $this->object->getId(),
183  "hide_top_actions",
184  !$this->legacy_form->getInput("show_top_actions")
185  );
186  }
187  }
static _writeContainerSetting($a_id, $a_keyword, $a_value)
+ Here is the call graph for this function:

Field Documentation

◆ $legacy_form

ilObjectCommonSettingFormAdapter::$legacy_form
protected

◆ $object

ilObjectCommonSettingFormAdapter::$object
protected

Definition at line 26 of file class.ilObjectCommonSettingsFormAdapter.php.

Referenced by __construct().

◆ $service

ilObjectCommonSettingFormAdapter::$service
protected

Definition at line 16 of file class.ilObjectCommonSettingsFormAdapter.php.

Referenced by __construct().


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