ILIAS  release_8 Revision v8.24
StandardNotificationRenderer.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
21
22use ILIAS\GlobalScreen\Client\Notifications as ClientNotifications;
23use ILIAS\GlobalScreen\Scope\MainMenu\Collector\Renderer\Hasher;
27
33{
34 use Hasher;
35
41 {
42 $ui_notification_item = $item->getNotificationItem();
43
44 if ($item->hasClosedCallable()) {
45 return $this->attachJSCloseEvent($ui_notification_item, $item);
46 }
47
48 return $ui_notification_item;
49 }
50
58 protected function attachJSCloseEvent(Notification $ui_notification_item, isItem $item): Notification
59 {
60 $url = ClientNotifications::NOTIFY_ENDPOINT . "?" . $this->buildCloseQuery($item);
61
62 return $ui_notification_item->withCloseAction($url);
63 }
64}
attachJSCloseEvent(Notification $ui_notification_item, isItem $item)
Attaches on load code for communicating back, that the notification has been closed.
Class Notification The default Notification mapping currently to one UI Notification Item component.
Interface NotificationRenderer Every Notification should have a renderer, if you won't provide on in ...
withCloseAction(string $url)
Get an Item like this with an url to consulted async, when to close button is pressed.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider \MainMenu\Provider.
Class Factory.
$url