ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ILIAS\GlobalScreen\Client\Notifications Class Reference
+ Collaboration diagram for ILIAS\GlobalScreen\Client\Notifications:

Public Member Functions

 run ()
 

Data Fields

const MODE = "mode"
 Name of the GET param used in the async calls. More...
 
const MODE_OPENED = "opened"
 Value of the MODE GET param, if the Notification Center has been opened. More...
 
const MODE_CLOSED = "closed"
 Value of the MODE GET param, if the Notification Center has been closed. More...
 
const ITEM_ID = "item_id"
 NAME of the GET param, to indicate the item ID of the closed item. More...
 
const NOTIFICATION_IDENTIFIERS = "notification_identifiers"
 Used to read the identifiers out of the GET param later. More...
 
const NOTIFY_ENDPOINT = ILIAS_HTTP_PATH . "/src/GlobalScreen/Client/notify.php"
 Location of the endpoint handling async notification requests. More...
 

Protected Attributes

 $notification_groups
 
 $identifiers_to_handle
 
 $single_identifier_to_handle
 

Private Member Functions

 handleOpened ()
 Loops through all available open callable provided by the notification providers. More...
 
 handleClosed ()
 Runs the closed callable if such a callable is provided. More...
 

Detailed Description

Definition at line 13 of file Notifications.php.

Member Function Documentation

◆ handleClosed()

ILIAS\GlobalScreen\Client\Notifications::handleClosed ( )
private

Runs the closed callable if such a callable is provided.

Definition at line 96 of file Notifications.php.

Referenced by ILIAS\GlobalScreen\Client\Notifications\run().

96  : void
97  {
98  foreach ($this->notification_groups as $notification_group) {
99  foreach ($notification_group->getNotifications() as $notification) {
100  if ($this->single_identifier_to_handle === $this->hash($notification->getProviderIdentification()->serialize())) {
101  if ($notification->hasClosedCallable()) {
102  $notification->getClosedCallable()();
103  }
104  }
105  }
106  }
107  }
+ Here is the caller graph for this function:

◆ handleOpened()

ILIAS\GlobalScreen\Client\Notifications::handleOpened ( )
private

Loops through all available open callable provided by the notification providers.

Definition at line 79 of file Notifications.php.

Referenced by ILIAS\GlobalScreen\Client\Notifications\run().

79  : void
80  {
81  foreach ($this->notification_groups as $notification_group) {
82  foreach ($notification_group->getNotifications() as $notification) {
83  if (in_array($this->hash($notification->getProviderIdentification()->serialize()), $this->identifiers_to_handle, true)) {
84  $notification->getOpenedCallable()();
85  }
86  }
87  if (in_array($this->hash($notification_group->getProviderIdentification()->serialize()), $this->identifiers_to_handle, true)) {
88  $notification_group->getOpenedCallable()();
89  }
90  }
91  }
+ Here is the caller graph for this function:

◆ run()

ILIAS\GlobalScreen\Client\Notifications::run ( )

$DI

Definition at line 55 of file Notifications.php.

References $DIC, ILIAS\GlobalScreen\Client\Notifications\handleClosed(), and ILIAS\GlobalScreen\Client\Notifications\handleOpened().

56  {
60  global $DIC;
61  $this->notification_groups = $DIC->globalScreen()->collector()->notifications()->getNotifications();
62  $this->identifiers_to_handle = $DIC->http()->request()->getQueryParams()[self::NOTIFICATION_IDENTIFIERS] ?? [];
63  $this->single_identifier_to_handle = $DIC->http()->request()->getQueryParams()[self::ITEM_ID] ?? null;
64 
65  switch ($DIC->http()->request()->getQueryParams()[self::MODE]) {
66  case self::MODE_OPENED:
67  $this->handleOpened();
68  break;
69  case self::MODE_CLOSED:
70  $this->handleClosed();
71  break;
72  }
73  }
handleOpened()
Loops through all available open callable provided by the notification providers. ...
$DIC
Definition: xapitoken.php:46
handleClosed()
Runs the closed callable if such a callable is provided.
+ Here is the call graph for this function:

Field Documentation

◆ $identifiers_to_handle

ILIAS\GlobalScreen\Client\Notifications::$identifiers_to_handle
protected

Definition at line 49 of file Notifications.php.

◆ $notification_groups

ILIAS\GlobalScreen\Client\Notifications::$notification_groups
protected

Definition at line 21 of file Notifications.php.

◆ $single_identifier_to_handle

ILIAS\GlobalScreen\Client\Notifications::$single_identifier_to_handle
protected

Definition at line 53 of file Notifications.php.

◆ ITEM_ID

const ILIAS\GlobalScreen\Client\Notifications::ITEM_ID = "item_id"

NAME of the GET param, to indicate the item ID of the closed item.

Definition at line 37 of file Notifications.php.

◆ MODE

const ILIAS\GlobalScreen\Client\Notifications::MODE = "mode"

Name of the GET param used in the async calls.

Definition at line 25 of file Notifications.php.

◆ MODE_CLOSED

const ILIAS\GlobalScreen\Client\Notifications::MODE_CLOSED = "closed"

Value of the MODE GET param, if the Notification Center has been closed.

Definition at line 33 of file Notifications.php.

◆ MODE_OPENED

const ILIAS\GlobalScreen\Client\Notifications::MODE_OPENED = "opened"

Value of the MODE GET param, if the Notification Center has been opened.

Definition at line 29 of file Notifications.php.

◆ NOTIFICATION_IDENTIFIERS

const ILIAS\GlobalScreen\Client\Notifications::NOTIFICATION_IDENTIFIERS = "notification_identifiers"

Used to read the identifiers out of the GET param later.

Definition at line 41 of file Notifications.php.

◆ NOTIFY_ENDPOINT

const ILIAS\GlobalScreen\Client\Notifications::NOTIFY_ENDPOINT = ILIAS_HTTP_PATH . "/src/GlobalScreen/Client/notify.php"

Location of the endpoint handling async notification requests.

Definition at line 45 of file Notifications.php.


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