5use ILIAS\GlobalScreen\Scope\MainMenu\Collector\Renderer\Hasher;
61 $this->notification_groups =
$DIC->globalScreen()->collector()->notifications()->getNotifications();
63 $this->single_identifier_to_handle =
$DIC->http()->request()->getQueryParams()[
self::ITEM_ID] ??
null;
65 switch (
$DIC->http()->request()->getQueryParams()[self::MODE]) {
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()();
87 if (in_array($this->hash($notification_group->getProviderIdentification()->serialize()), $this->identifiers_to_handle,
true)) {
88 $notification_group->getOpenedCallable()();
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()();
An exception for terminatinating execution or to throw for unit testing.
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.
$single_identifier_to_handle
const ITEM_ID
NAME of the GET param, to indicate the item ID of the closed item.
const NOTIFY_ENDPOINT
Location of the endpoint handling async notification requests.
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.
const MODE
Name of the GET param used in the async calls.
handleClosed()
Runs the closed callable if such a callable is provided.
Class StandardNotificationGroup.
Entry Point for Async calls from the Notification Center.