ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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)
 

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.

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

120  : isItem
121  {
122  $d = $this->maybeGetItem($item);
123  if ($d === null) {
124  return $item;
125  }
126 
127  return $item->withPosition($d->getPosition());
128  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ 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.

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

130  : hasTitle
131  {
132  $d = $this->maybeGetItem($item);
133  if ($d === null) {
134  return $item;
135  }
136 
137  if (
138  (($translation = $this->translations()->get($d)->getLanguageCode($this->userLanguage())) !== null)
139  && $translation->getTranslation() !== ''
140  ) {
141  return $item->withTitle($translation->getTranslation());
142  }
143 
144  return $item->withTitle($d->getTitle());
145  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ entries()

ilFooterCustomItemInformation::entries ( )
private

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

References $entries_repository, null, and ILIAS\GlobalScreen\UI\Footer\Entries\EntriesRepositoryDB\preload().

Referenced by getParent(), and maybeGetItem().

83  {
84  if ($this->entries_repository !== null) {
86  }
87 
88  $this->entries_repository = new EntriesRepositoryDB($this->dic->database());
89  $this->entries_repository->preload();
91  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getParent()

ilFooterCustomItemInformation::getParent ( isItem  $item)

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

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

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

148  {
149  $entry = $this->entries()->get($item->getProviderIdentification()->serialize());
150 
151  if ($entry === null) {
152  return $item->getProviderIdentification();
153  }
154 
155  return $this->id()->fromSerializedIdentification($entry->getParent());
156  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ groups()

ilFooterCustomItemInformation::groups ( )
private

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

References $groups_repository, null, and ILIAS\GlobalScreen\UI\Footer\Groups\GroupsRepositoryDB\preload().

Referenced by maybeGetItem().

72  {
73  if ($this->groups_repository !== null) {
75  }
76 
77  $this->groups_repository = new GroupsRepositoryDB($this->dic->database());
78  $this->groups_repository->preload();
80  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ id()

ilFooterCustomItemInformation::id ( )
private

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

Referenced by getParent().

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

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

110  : bool
111  {
112  $d = $this->maybeGetItem($item);
113  if ($d === null) {
114  return $item->isAvailable();
115  }
116 
117  return $d->isActive();
118  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ maybeGetItem()

ilFooterCustomItemInformation::maybeGetItem ( isItem  $item)
private

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

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

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

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  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ 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, and null.

Referenced by customTranslationForUser().

54  {
55  if ($this->translations_repository !== null) {
57  }
58 
59  $this->translations_repository = new TranslationsRepositoryDB($this->dic->database());
61  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the caller graph for this function:

◆ userLanguage()

ilFooterCustomItemInformation::userLanguage ( )
private

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

References $user_language, and null.

Referenced by customTranslationForUser().

63  : string
64  {
65  if ($this->user_language !== null) {
66  return $this->user_language;
67  }
68  return $this->user_language = $this->dic->user()->getLanguage();
69  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ 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: