ILIAS
release_10 Revision v10.1-43-ga1241a92c2f
◀ ilDoc Overview
closable.php
Go to the documentation of this file.
1
<?php
2
3
declare(strict_types=1);
4
5
namespace
ILIAS\UI\examples\Item\Notification
;
6
18
function
closable
()
19
{
20
global
$DIC
;
21
$refinery
= $DIC->refinery();
22
$request_wrapper
= $DIC->http()->wrapper()->query();
23
24
$close_url =
$_SERVER
[
'REQUEST_URI'
] .
'&mail_closed=true'
;
25
26
//If closed, an ajax request is fired to the set close_url
27
if
(
$request_wrapper
->has(
'mail_closed'
) &&
$request_wrapper
->retrieve(
'mail_closed'
,
$refinery
->kindlyTo()->bool())) {
28
//Do Some Magic needed to be done, when this item is closed.
29
exit
;
30
}
31
32
//Creating a closable Mail Notification Item
33
$f
= $DIC->ui()->factory();
34
$renderer
= $DIC->ui()->renderer();
35
36
$mail_icon =
$f
->symbol()->icon()->standard(
"mail"
,
"mail"
);
37
$mail_title =
$f
->link()->standard(
"Inbox"
,
"#"
);
38
$mail_notification_item =
$f
->item()->notification($mail_title, $mail_icon)
39
->withDescription(
"You have 23 unread mails in your inbox"
)
40
->withProperties([
"Time"
=>
"3 days ago"
])
41
->withCloseAction($close_url);
42
43
44
return
$renderer
->render($mail_notification_item);
45
}
ILIAS\UI\examples\Layout\Page\Standard\$refinery
$refinery
Definition:
ui.php:121
$renderer
$renderer
Definition:
build_bootstrap.php:83
ILIAS\UI\examples\Item\Notification\closable
closable()
description: > Example for rendering a closable notification item.
Definition:
closable.php:18
ILIAS\UI\examples\Layout\Page\Standard\$request_wrapper
$request_wrapper
Definition:
ui.php:120
Vendor\Package\$f
$f
Definition:
example_cleaned.php:49
$_SERVER
$_SERVER['HTTP_HOST']
Definition:
raiseError.php:10
$DIC
global $DIC
Definition:
shib_login.php:25
ILIAS\UI\examples\Item\Notification
Definition:
base.php:5
exit
exit
Definition:
zoneinfo_generator.php:3
components
ILIAS
UI
src
examples
Item
Notification
closable.php
Generated on Wed Sep 10 2025 15:16:45 for ILIAS by
1.8.13 (using
Doxyfile
)