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.

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 }

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

+ 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.

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 }

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

+ Here is the caller graph for this function:

◆ run()

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

@DI $DI

Definition at line 55 of file Notifications.php.

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]) {
67 $this->handleOpened();
68 break;
70 $this->handleClosed();
71 break;
72 }
73 }
const MODE_CLOSED
Value of the MODE GET param, if the Notification Center has been closed.
const NOTIFICATION_IDENTIFIERS
Used to read the identifiers out of the GET param later.
const ITEM_ID
NAME of the GET param, to indicate the item ID of the closed item.
const MODE_OPENED
Value of the MODE GET param, if the Notification Center has been opened.
handleOpened()
Loops through all available open callable provided by the notification providers.
handleClosed()
Runs the closed callable if such a callable is provided.
$DIC
Definition: xapitoken.php:46

References $DIC, ILIAS\GlobalScreen\Client\Notifications\handleClosed(), ILIAS\GlobalScreen\Client\Notifications\handleOpened(), ILIAS\GlobalScreen\Client\Notifications\ITEM_ID, ILIAS\GlobalScreen\Client\Notifications\MODE_CLOSED, ILIAS\GlobalScreen\Client\Notifications\MODE_OPENED, and ILIAS\GlobalScreen\Client\Notifications\NOTIFICATION_IDENTIFIERS.

+ 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.

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

◆ 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.

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

◆ 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.

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

◆ 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.

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

◆ 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: