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

Public Member Functions

 __construct (private ilObjectCustomIconFactory $custom_icon_factory, private ObjectTypeSpecificPropertiesFactory $object_type_specific_properties_factory)
 
 getFor (int $object_id)
 
 store (ilObjectAdditionalProperties $properties)
 

Private Member Functions

 getDefaultAdditionalProperties ()
 
 getTitleAndIconVisibility (int $object_id)
 
 storeTitleAndIconVisibility (int $object_id, bool $visibility)
 
 getHeaderActionVisibility (int $object_id)
 
 storeHeaderActionVisibility (int $object_id, bool $visibility)
 
 getInfoTabVisibility (int $object_id)
 
 storeInfoTabVisibility (int $object_id, bool $visibility)
 
 areCustomIconsEnabled ()
 
 storeIcon (ilObjectPropertyIcon $property_icon)
 

Detailed Description

Author
Stephan Kergomard

Definition at line 27 of file ilObjectAdditionalPropertiesLegacyRepository.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjectAdditionalPropertiesLegacyRepository::__construct ( private ilObjectCustomIconFactory  $custom_icon_factory,
private ObjectTypeSpecificPropertiesFactory  $object_type_specific_properties_factory 
)

Definition at line 29 of file ilObjectAdditionalPropertiesLegacyRepository.php.

32  {
33  }

Member Function Documentation

◆ areCustomIconsEnabled()

ilObjectAdditionalPropertiesLegacyRepository::areCustomIconsEnabled ( )
private

Definition at line 154 of file ilObjectAdditionalPropertiesLegacyRepository.php.

References ilSetting\_lookupValue().

Referenced by getDefaultAdditionalProperties(), and getFor().

154  : bool
155  {
156  return (bool) ilSetting::_lookupValue('common', 'custom_icons');
157  }
static _lookupValue(string $a_module, string $a_keyword)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDefaultAdditionalProperties()

◆ getFor()

ilObjectAdditionalPropertiesLegacyRepository::getFor ( int  $object_id)

Implements ilObjectAdditionalPropertiesRepository.

Definition at line 35 of file ilObjectAdditionalPropertiesLegacyRepository.php.

References ilObject\_lookupType(), areCustomIconsEnabled(), getDefaultAdditionalProperties(), getHeaderActionVisibility(), getInfoTabVisibility(), getTitleAndIconVisibility(), and null.

36  {
37  if ($object_id === 0) {
38  return $this->getDefaultAdditionalProperties();
39  }
40 
41  $type = ilObject::_lookupType($object_id);
42  $object_type_specific_properties = $this->object_type_specific_properties_factory->getForObjectTypeString($type);
43  $providers = null;
44  if ($object_type_specific_properties !== null) {
45  $providers = $object_type_specific_properties->getProviders();
46  }
47 
53  $this->areCustomIconsEnabled(),
54  $this->custom_icon_factory->getByObjId($object_id),
55  $providers
56  ),
57  $object_id
58  );
59  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:

◆ getHeaderActionVisibility()

ilObjectAdditionalPropertiesLegacyRepository::getHeaderActionVisibility ( int  $object_id)
private

Definition at line 124 of file ilObjectAdditionalPropertiesLegacyRepository.php.

References ilContainer\_lookupContainerSetting().

Referenced by getFor().

124  : bool
125  {
126  return !((bool) ilContainer::_lookupContainerSetting($object_id, 'hide_top_actions'));
127  }
static _lookupContainerSetting(int $a_id, string $a_keyword, ?string $a_default_value=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInfoTabVisibility()

ilObjectAdditionalPropertiesLegacyRepository::getInfoTabVisibility ( int  $object_id)
private

Definition at line 139 of file ilObjectAdditionalPropertiesLegacyRepository.php.

References ilContainer\_lookupContainerSetting().

Referenced by getFor().

139  : bool
140  {
141  return ((bool) ilContainer::_lookupContainerSetting($object_id, 'cont_show_info_tab'));
142  }
static _lookupContainerSetting(int $a_id, string $a_keyword, ?string $a_default_value=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTitleAndIconVisibility()

ilObjectAdditionalPropertiesLegacyRepository::getTitleAndIconVisibility ( int  $object_id)
private

Definition at line 109 of file ilObjectAdditionalPropertiesLegacyRepository.php.

References ilContainer\_lookupContainerSetting().

Referenced by getFor().

109  : bool
110  {
111  return !((bool) ilContainer::_lookupContainerSetting($object_id, 'hide_header_icon_and_title'));
112  }
static _lookupContainerSetting(int $a_id, string $a_keyword, ?string $a_default_value=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ store()

ilObjectAdditionalPropertiesLegacyRepository::store ( ilObjectAdditionalProperties  $properties)

Implements ilObjectAdditionalPropertiesRepository.

Definition at line 61 of file ilObjectAdditionalPropertiesLegacyRepository.php.

References ilObjectAdditionalProperties\getObjectId(), ilObjectAdditionalProperties\getPropertyHeaderActionVisibility(), ilObjectAdditionalProperties\getPropertyIcon(), ilObjectAdditionalProperties\getPropertyInfoTabVisibility(), ilObjectAdditionalProperties\getPropertyTitleAndIconVisibility(), null, storeHeaderActionVisibility(), storeIcon(), storeInfoTabVisibility(), storeTitleAndIconVisibility(), ilObjectAdditionalProperties\wasPropertyHeaderActionVisbilityUpdated(), ilObjectAdditionalProperties\wasPropertyIconUpdated(), ilObjectAdditionalProperties\wasPropertyInfoTabVisbilityUpdated(), ilObjectAdditionalProperties\wasPropertyTitleAndIconVisibilityUpdated(), and ilObjectAdditionalProperties\withResetUpdatedFlags().

62  {
63  if ($properties->getObjectId() === null) {
64  throw new \Exception('The current configuration cannot be saved.');
65  }
66 
67  $object_id = $properties->getObjectId();
68 
69  if ($properties->wasPropertyTitleAndIconVisibilityUpdated()) {
71  $object_id,
72  $properties->getPropertyTitleAndIconVisibility()->getVisibility()
73  );
74  }
75 
76  if ($properties->wasPropertyHeaderActionVisbilityUpdated()) {
78  $object_id,
79  $properties->getPropertyHeaderActionVisibility()->getVisibility()
80  );
81  }
82 
83  if ($properties->wasPropertyInfoTabVisbilityUpdated()) {
85  $object_id,
86  $properties->getPropertyInfoTabVisibility()->getVisibility()
87  );
88  }
89 
90  if ($properties->wasPropertyIconUpdated()) {
91  $this->storeIcon($properties->getPropertyIcon());
92  }
93 
94  return $properties->withResetUpdatedFlags();
95  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ storeHeaderActionVisibility()

ilObjectAdditionalPropertiesLegacyRepository::storeHeaderActionVisibility ( int  $object_id,
bool  $visibility 
)
private

Definition at line 129 of file ilObjectAdditionalPropertiesLegacyRepository.php.

References ilContainer\_writeContainerSetting().

Referenced by store().

129  : void
130  {
131  $hide_top_actions = $visibility ? '' : '1';
133  $object_id,
134  'hide_top_actions',
135  $hide_top_actions
136  );
137  }
static _writeContainerSetting(int $a_id, string $a_keyword, string $a_value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ storeIcon()

ilObjectAdditionalPropertiesLegacyRepository::storeIcon ( ilObjectPropertyIcon  $property_icon)
private

Definition at line 159 of file ilObjectAdditionalPropertiesLegacyRepository.php.

References ilObjectPropertyIcon\getCustomIcon(), ilObjectPropertyIcon\getDeletedFlag(), and ilObjectPropertyIcon\getTempFileName().

Referenced by store().

159  : void
160  {
161  if ($property_icon->getDeletedFlag()) {
162  $property_icon->getCustomIcon()->remove();
163  }
164 
165  if ($property_icon->getTempFileName()) {
166  $property_icon->getCustomIcon()->saveFromTempFileName($property_icon->getTempFileName());
167  }
168  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ storeInfoTabVisibility()

ilObjectAdditionalPropertiesLegacyRepository::storeInfoTabVisibility ( int  $object_id,
bool  $visibility 
)
private

Definition at line 144 of file ilObjectAdditionalPropertiesLegacyRepository.php.

References ilContainer\_writeContainerSetting().

Referenced by store().

144  : void
145  {
146  $show_info_tab = $visibility ? '1' : '';
148  $object_id,
149  'cont_show_info_tab',
150  $show_info_tab
151  );
152  }
static _writeContainerSetting(int $a_id, string $a_keyword, string $a_value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ storeTitleAndIconVisibility()

ilObjectAdditionalPropertiesLegacyRepository::storeTitleAndIconVisibility ( int  $object_id,
bool  $visibility 
)
private

Definition at line 114 of file ilObjectAdditionalPropertiesLegacyRepository.php.

References ilContainer\_writeContainerSetting().

Referenced by store().

114  : void
115  {
116  $hide_header_icon_and_title = $visibility ? '' : '1';
118  $object_id,
119  'hide_header_icon_and_title',
120  $hide_header_icon_and_title
121  );
122  }
static _writeContainerSetting(int $a_id, string $a_keyword, string $a_value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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