ILIAS  release_7 Revision v7.30-3-g800a261c036
StandardNotificationRenderer.php
Go to the documentation of this file.
1<?php
2
19declare(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}
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.
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 ...
A component is the most general form of an entity in the UI.
Definition: Component.php:14
withCloseAction(string $url)
Get an Item like this with an url to consulted async, when to close button is pressed.
Class ChatMainBarProvider \MainMenu\Provider.
Class Factory.
$url