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

Public Member Functions

 __construct (Container $dic)
 
 getNewIdentification ()
 
 getGroupsRepository ()
 
 getEntriesRepository ()
 
 getGroups ()
 
 getEntries ()
 
 getAdditionalTexts ()
 
 getPermanentURI ()
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Scope\MetaBar\Provider\AbstractStaticFooterProvider
 __construct (Container $dic)
 
 getAdditionalTexts ()
 
 getPermanentURI ()
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 __construct (protected Container $dic)
 
 getFullyQualifiedClassName ()
 
 getProviderNameForPresentation ()
 

Private Member Functions

 buildURI (string $from_path)
 
 txt (string $key)
 

Private Attributes

readonly GroupsRepositoryDB $groups_repository
 
readonly EntriesRepositoryDB $entries_repository
 

Additional Inherited Members

- Protected Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 globalScreen ()
 
- Protected Attributes inherited from ILIAS\GlobalScreen\Scope\MetaBar\Provider\AbstractStaticFooterProvider
IdentificationProviderInterface $id_factory
 
FooterItemFactory $item_factory
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilFooterCustomGroupsProvider::__construct ( Container  $dic)

Definition at line 37 of file class.ilFooterCustomGroupsProvider.php.

References ILIAS\GlobalScreen\Provider\__construct(), and ILIAS\DI\Container\database().

38  {
39  parent::__construct($dic);
40  $this->groups_repository = new GroupsRepositoryDB($dic->database(), $this);
41  $this->entries_repository = new EntriesRepositoryDB($dic->database(), $this);
42  }
database()
Get interface to the Database.
Definition: Container.php:42
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ buildURI()

ilFooterCustomGroupsProvider::buildURI ( string  $from_path)
private

Definition at line 111 of file class.ilFooterCustomGroupsProvider.php.

111  : URI
112  {
113  $request = $this->dic->http()->request()->getUri();
114  return new URI($request->getScheme() . '://' . $request->getHost() . '/' . ltrim($from_path, '/'));
115  }

◆ getAdditionalTexts()

ilFooterCustomGroupsProvider::getAdditionalTexts ( )

Implements ILIAS\GlobalScreen\Scope\Footer\Provider\StaticFooterProvider.

Definition at line 118 of file class.ilFooterCustomGroupsProvider.php.

118  : array
119  {
120  return [];
121  }

◆ getEntries()

ilFooterCustomGroupsProvider::getEntries ( )
Returns
isItem[] These are Entries which will be available for configuration.

Implements ILIAS\GlobalScreen\Scope\Footer\Provider\StaticFooterProvider.

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

References ILIAS\GlobalScreen\Scope\Footer\Factory\withParent().

81  : array
82  {
83  $entries = [];
84 
85  foreach ($this->entries_repository->all() as $entry) {
86  if ($entry->isCore()) {
87  continue;
88  }
89  if (!$entry->isActive()) {
90  continue;
91  }
92  try {
93  $action = new URI($entry->getAction());
94  } catch (Throwable) {
95  continue;
96  }
97 
98  $entries[] = $this->item_factory->link(
99  $this->dic->globalScreen()->identification()->fromSerializedIdentification($entry->getId()),
100  $entry->getTitle(),
101  )->withParent(
102  $this->dic->globalScreen()->identification()->fromSerializedIdentification($entry->getParent())
103  )->withAction(
104  $action
105  )->withOpenInNewViewport($entry->isExternal());
106  }
107 
108  return $entries;
109  }
withParent(IdentificationInterface $identification)
+ Here is the call graph for this function:

◆ getEntriesRepository()

ilFooterCustomGroupsProvider::getEntriesRepository ( )

◆ getGroups()

ilFooterCustomGroupsProvider::getGroups ( )
Returns
TopParentItem[] These are Slates which will be available for configuration.

Implements ILIAS\GlobalScreen\Scope\Footer\Provider\StaticFooterProvider.

Definition at line 61 of file class.ilFooterCustomGroupsProvider.php.

61  : array
62  {
63  $groups = [];
64 
65  foreach ($this->groups_repository->all() as $group) {
66  if ($group->isCore()) {
67  continue;
68  }
69  if (!$group->isActive()) {
70  continue;
71  }
72  $groups[] = $this->item_factory->group(
73  $this->dic->globalScreen()->identification()->fromSerializedIdentification($group->getId()),
74  $group->getTitle(),
75  );
76  }
77 
78  return $groups;
79  }

◆ getGroupsRepository()

ilFooterCustomGroupsProvider::getGroupsRepository ( )

◆ getNewIdentification()

ilFooterCustomGroupsProvider::getNewIdentification ( )

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

45  {
46  return $this->id_factory->identifier(uniqid('', true));
47  }

◆ getPermanentURI()

ilFooterCustomGroupsProvider::getPermanentURI ( )

Implements ILIAS\GlobalScreen\Scope\Footer\Provider\StaticFooterProvider.

Definition at line 123 of file class.ilFooterCustomGroupsProvider.php.

References null.

123  : ?Permanent
124  {
125  return null;
126  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ txt()

ilFooterCustomGroupsProvider::txt ( string  $key)
private

Definition at line 128 of file class.ilFooterCustomGroupsProvider.php.

128  : string
129  {
130  return $this->dic->language()->txt($key);
131  }

Field Documentation

◆ $entries_repository

readonly EntriesRepositoryDB ilFooterCustomGroupsProvider::$entries_repository
private

Definition at line 35 of file class.ilFooterCustomGroupsProvider.php.

Referenced by getEntriesRepository().

◆ $groups_repository

readonly GroupsRepositoryDB ilFooterCustomGroupsProvider::$groups_repository
private

Definition at line 34 of file class.ilFooterCustomGroupsProvider.php.

Referenced by getGroupsRepository().


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