ILIAS
trunk Revision v11.0_alpha-2638-g80c1d007f79
◀ ilDoc Overview
closable.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\UI\examples\Item\Notification
;
22
34
function
closable
()
35
{
36
global
$DIC
;
37
$refinery
= $DIC->refinery();
38
$request_wrapper
= $DIC->http()->wrapper()->query();
39
40
$close_url =
$_SERVER
[
'REQUEST_URI'
] .
'&mail_closed=true'
;
41
42
//If closed, an ajax request is fired to the set close_url
43
if
(
$request_wrapper
->has(
'mail_closed'
) &&
$request_wrapper
->retrieve(
'mail_closed'
,
$refinery
->kindlyTo()->bool())) {
44
//Do Some Magic needed to be done, when this item is closed.
45
exit
;
46
}
47
48
//Creating a closable Mail Notification Item
49
$f
= $DIC->ui()->factory();
50
$renderer
= $DIC->ui()->renderer();
51
52
$mail_icon =
$f
->symbol()->icon()->standard(
"mail"
,
"mail"
);
53
$mail_title =
$f
->link()->standard(
"Inbox"
,
"#"
);
54
$mail_notification_item =
$f
->item()->notification($mail_title, $mail_icon)
55
->withDescription(
"You have 23 unread mails in your inbox"
)
56
->withProperties([
"Time"
=>
"3 days ago"
])
57
->withCloseAction($close_url);
58
59
60
return
$renderer
->render($mail_notification_item);
61
}
ILIAS\UI\examples\Layout\Page\Standard\$refinery
$refinery
Definition:
ui.php:137
$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:34
ILIAS\UI\examples\Layout\Page\Standard\$request_wrapper
$request_wrapper
Definition:
ui.php:136
Vendor\Package\$f
$f
Definition:
example_cleaned.php:49
$_SERVER
$_SERVER['HTTP_HOST']
Definition:
raiseError.php:26
$DIC
global $DIC
Definition:
shib_login.php:26
exit
exit
Definition:
dummy_client.php:21
ILIAS\UI\examples\Item\Notification
Definition:
base.php:21
components
ILIAS
UI
src
examples
Item
Notification
closable.php
Generated on Sun Aug 31 2025 23:04:10 for ILIAS by
1.8.13 (using
Doxyfile
)