ILIAS  release_8 Revision v8.24
closable.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
6
7function closable()
8{
9 global $DIC;
10 $refinery = $DIC->refinery();
11 $request_wrapper = $DIC->http()->wrapper()->query();
12
13 $close_url = $_SERVER['REQUEST_URI'] . '&mail_closed=true';
14
15 //If closed, an ajax request is fired to the set close_url
16 if ($request_wrapper->has('mail_closed') && $request_wrapper->retrieve('mail_closed', $refinery->kindlyTo()->bool())) {
17 //Do Some Magic needed to be done, when this item is closed.
18 exit;
19 }
20
21 //Creating a closable Mail Notification Item
22 $f = $DIC->ui()->factory();
23 $renderer = $DIC->ui()->renderer();
24
25 $mail_icon = $f->symbol()->icon()->standard("mail", "mail");
26 $mail_title = $f->link()->standard("Inbox", "#");
27 $mail_notification_item = $f->item()->notification($mail_title, $mail_icon)
28 ->withDescription("You have 23 unread mails in your inbox")
29 ->withProperties(["Time" => "3 days ago"])
30 ->withCloseAction($close_url);
31
32
33 return $renderer->render($mail_notification_item);
34}
global $DIC
Definition: feed.php:28
exit
Definition: login.php:28
Refinery Factory $refinery
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10