ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
StandardNotificationRenderer.php
Go to the documentation of this file.
2
3use ILIAS\GlobalScreen\Client\Notifications as ClientNotifications;
4use ILIAS\GlobalScreen\Scope\MainMenu\Collector\Renderer\Hasher;
8
15{
16 use Hasher;
17
18
25 {
26 $ui_notification_item = $item->getNotificationItem();
27
28 if ($item->hasClosedCallable()) {
29 return $this->attachJSCloseEvent($ui_notification_item, $item);
30 }
31
32 return $ui_notification_item;
33 }
34
35
45 protected function attachJSCloseEvent(Notification $ui_notification_item, isItem $item) : Notification
46 {
47 $url = ClientNotifications::NOTIFY_ENDPOINT . "?" . $this->buildCloseQuery($item);
48
49 return $ui_notification_item->withCloseAction($url);
50 }
51}
An exception for terminatinating execution or to throw for unit testing.
attachJSCloseEvent(Notification $ui_notification_item, isItem $item)
Attaches on load code for communicating back, that the notification has been closed.
withCloseAction(string $url)
Get an Item like this with an url to consulted async, when to close button is pressed.
$url