ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilFooterCustomItemInformation Class Reference
+ Inheritance diagram for ilFooterCustomItemInformation:
+ Collaboration diagram for ilFooterCustomItemInformation:

Public Member Functions

 __construct (private readonly Container $dic)
 
 isItemActive (isItem $item)
 
 customPosition (isItem $item)
 
 customTranslationForUser (hasTitle $item)
 
 getParent (isItem $item)
 
 isItemActive (isItem $item)
 
 customPosition (isItem $item)
 
 customTranslationForUser (hasTitle $item)
 
 getParent (isItem $item)
 

Private Member Functions

 translations ()
 
 userLanguage ()
 
 groups ()
 
 entries ()
 
 id ()
 
 maybeGetItem (isItem $item)
 

Private Attributes

GroupsRepositoryDB $groups_repository = null
 
EntriesRepositoryDB $entries_repository = null
 
IdentificationFactory $identifications = null
 
TranslationsRepositoryDB $translations_repository = null
 
string $user_language = null
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilFooterCustomItemInformation::__construct ( private readonly Container  $dic)

Definition at line 49 of file class.ilFooterCustomItemInformation.php.

50 {
51 }

Member Function Documentation

◆ customPosition()

ilFooterCustomItemInformation::customPosition ( isItem  $item)

Implements ILIAS\GlobalScreen\Scope\Footer\Collector\Information\ItemInformation.

Definition at line 120 of file class.ilFooterCustomItemInformation.php.

120 : isItem
121 {
122 $d = $this->maybeGetItem($item);
123 if ($d === null) {
124 return $item;
125 }
126
127 return $item->withPosition($d->getPosition());
128 }

References Vendor\Package\$d, maybeGetItem(), and ILIAS\GlobalScreen\Scope\Footer\Factory\isItem\withPosition().

+ Here is the call graph for this function:

◆ customTranslationForUser()

ilFooterCustomItemInformation::customTranslationForUser ( hasTitle  $item)

Implements ILIAS\GlobalScreen\Scope\Footer\Collector\Information\ItemInformation.

Definition at line 130 of file class.ilFooterCustomItemInformation.php.

130 : hasTitle
131 {
132 $d = $this->maybeGetItem($item);
133 if ($d === null) {
134 return $item;
135 }
136
137 if ($d->isCore()) {
138 return $item->withIsCore();
139 }
140
141 if (
142 (($translation = $this->translations()->get($d)->getLanguageCode($this->userLanguage())) !== null)
143 && $translation->getTranslation() !== ''
144 ) {
145 return $item->withTitle($translation->getTranslation());
146 }
147
148 return $item->withTitle($d->getTitle());
149 }
withIsCore()
@description Core Items are handled differently, they are not translatable via GUI and use their tran...

References Vendor\Package\$d, maybeGetItem(), translations(), userLanguage(), ILIAS\GlobalScreen\Scope\Footer\Factory\isItem\withIsCore(), and ILIAS\GlobalScreen\Scope\Footer\Factory\hasTitle\withTitle().

+ Here is the call graph for this function:

◆ entries()

ilFooterCustomItemInformation::entries ( )
private

Definition at line 82 of file class.ilFooterCustomItemInformation.php.

83 {
84 if ($this->entries_repository !== null) {
86 }
87
88 $this->entries_repository = new EntriesRepositoryDB($this->dic->database());
89 $this->entries_repository->preload();
91 }

References $entries_repository.

Referenced by getParent(), and maybeGetItem().

+ Here is the caller graph for this function:

◆ getParent()

ilFooterCustomItemInformation::getParent ( isItem  $item)

Implements ILIAS\GlobalScreen\Scope\Footer\Collector\Information\ItemInformation.

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

152 {
153 $entry = $this->entries()->get($item->getProviderIdentification()->serialize());
154
155 if ($entry === null) {
156 return $item->getProviderIdentification();
157 }
158
159 return $this->id()->fromSerializedIdentification($entry->getParent());
160 }

References entries(), ILIAS\GlobalScreen\isGlobalScreenItem\getProviderIdentification(), and id().

+ Here is the call graph for this function:

◆ groups()

ilFooterCustomItemInformation::groups ( )
private

Definition at line 71 of file class.ilFooterCustomItemInformation.php.

72 {
73 if ($this->groups_repository !== null) {
75 }
76
77 $this->groups_repository = new GroupsRepositoryDB($this->dic->database());
78 $this->groups_repository->preload();
80 }

References $groups_repository.

Referenced by maybeGetItem().

+ Here is the caller graph for this function:

◆ id()

ilFooterCustomItemInformation::id ( )
private

Definition at line 93 of file class.ilFooterCustomItemInformation.php.

94 {
95 return $this->identifications ?? $this->dic->globalScreen()->identification();
96 }
Class IdentificationFactory All elements in the GlobalScreen service must be identifiable for the sup...

Referenced by getParent().

+ Here is the caller graph for this function:

◆ isItemActive()

ilFooterCustomItemInformation::isItemActive ( isItem  $item)

Implements ILIAS\GlobalScreen\Scope\Footer\Collector\Information\ItemInformation.

Definition at line 110 of file class.ilFooterCustomItemInformation.php.

110 : bool
111 {
112 $d = $this->maybeGetItem($item);
113 if ($d === null) {
114 return $item->isAvailable();
115 }
116
117 return $d->isActive();
118 }

References Vendor\Package\$d, ILIAS\GlobalScreen\Scope\Footer\Factory\isItem\isAvailable(), and maybeGetItem().

+ Here is the call graph for this function:

◆ maybeGetItem()

ilFooterCustomItemInformation::maybeGetItem ( isItem  $item)
private

Definition at line 98 of file class.ilFooterCustomItemInformation.php.

98 : Group|Entry|null
99 {
100 if ($item instanceof canHaveParent) {
101 return $this->entries()->get($item->getProviderIdentification()->serialize());
102 }
103
104 if ($item instanceof isGroup) {
105 return $this->groups()->get($item->getProviderIdentification()->serialize());
106 }
107 return null;
108 }

References entries(), ILIAS\GlobalScreen\isGlobalScreenItem\getProviderIdentification(), and groups().

Referenced by customPosition(), customTranslationForUser(), and isItemActive().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ translations()

ilFooterCustomItemInformation::translations ( )
private

Definition at line 53 of file class.ilFooterCustomItemInformation.php.

References $translations_repository.

Referenced by customTranslationForUser().

+ Here is the caller graph for this function:

◆ userLanguage()

ilFooterCustomItemInformation::userLanguage ( )
private

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

63 : string
64 {
65 if ($this->user_language !== null) {
67 }
68 return $this->user_language = $this->dic->user()->getLanguage();
69 }

References $user_language.

Referenced by customTranslationForUser().

+ Here is the caller graph for this function:

Field Documentation

◆ $entries_repository

EntriesRepositoryDB ilFooterCustomItemInformation::$entries_repository = null
private

Definition at line 44 of file class.ilFooterCustomItemInformation.php.

Referenced by entries().

◆ $groups_repository

GroupsRepositoryDB ilFooterCustomItemInformation::$groups_repository = null
private

Definition at line 43 of file class.ilFooterCustomItemInformation.php.

Referenced by groups().

◆ $identifications

IdentificationFactory ilFooterCustomItemInformation::$identifications = null
private

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

◆ $translations_repository

TranslationsRepositoryDB ilFooterCustomItemInformation::$translations_repository = null
private

Definition at line 46 of file class.ilFooterCustomItemInformation.php.

Referenced by translations().

◆ $user_language

string ilFooterCustomItemInformation::$user_language = null
private

Definition at line 47 of file class.ilFooterCustomItemInformation.php.

Referenced by userLanguage().


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