3 declare(strict_types=1);
25 $f = $DIC->ui()->factory();
32 $mail_icon =
$f->symbol()->icon()->standard(
"mail",
"mail");
33 $mail_title =
$f->link()->standard(
"Inbox",
"link_to_inbox");
34 $mail_notification_item =
$f->item()->notification($mail_title, $mail_icon)
35 ->withDescription(
"You have 23 unread mails in your inbox")
36 ->withProperties([
"Time" =>
"3 days ago"])
37 ->withAdditionalContent(
$f->legacy(
"<b>Additional Content</b>"));
40 $close_url =
$_SERVER[
'REQUEST_URI'] .
'&badge_closed=true';
45 $badge_icon =
$f->symbol()->icon()->standard(
"bdga",
"mail");
46 $badge_title =
$f->link()->standard(
"Badges",
"link_to_achievement_badges");
47 $badge_notification_item1 =
$f->item()->notification($badge_title, $badge_icon)
48 ->withDescription(
"You received 1 Badge.")
49 ->withProperties([
"Time" =>
"2 days ago"])
50 ->withCloseAction($close_url);
51 $badge_icon =
$f->symbol()->icon()->standard(
"bdga",
"mail");
52 $badge_title =
$f->link()->standard(
"Badges 2",
"link_to_achievement_badges");
53 $close_url =
$_SERVER[
'REQUEST_URI'] .
'&badge_closed=true';
54 $badge_notification_item2 =
$f->item()->notification($badge_title, $badge_icon)
55 ->withDescription(
"You received 1 Badge.")
56 ->withProperties([
"Time" =>
"2 days ago"])
57 ->withCloseAction($close_url);
60 $generic_icon1 =
$f->symbol()->icon()->standard(
"cal",
"generic");
61 $generic_title1 =
$f->link()->standard(
"Generic 1",
"link_to_generic_repo");
62 $generic_item1 =
$f->item()->notification($generic_title1, $generic_icon1)
63 ->withDescription(
"Some description.")
64 ->withProperties([
"Property 1" =>
"Content 1",
"Property 2" =>
"Content 2"])
66 $f->dropdown()->standard([
67 $f->button()->shy(
"Possible Action of this Item",
"https://www.ilias.de"),
68 $f->button()->shy(
"Other Possible Action of this Item",
"https://www.github.com")
71 $generic_item1_with_aggregates = $generic_item1->withAggregateNotifications([$mail_notification_item]);
72 $generic_title2 =
$f->link()->standard(
"Generic 2",
"just_opens_the_list_of_aggregates");
73 $generic_item2 =
$f->item()->notification($generic_title2, $generic_icon1)
74 ->withDescription(
"Some description describing the aggregates attached.")
75 ->withProperties([
"Property 1" =>
"Content 1",
"Property 2" =>
"Content 2"])
76 ->withAggregateNotifications([$generic_item1, $generic_item1]);
79 $mail_slate =
$f->mainControls()->slate()->notification(
"Mail", [$mail_notification_item]);
80 $badge_slate =
$f->mainControls()->slate()->notification(
"Badge", [$badge_notification_item1, $badge_notification_item2]);
81 $generic_slate =
$f->mainControls()->slate()->notification(
"Generic", [
82 $generic_item1_with_aggregates,
87 $notification_center =
$f->mainControls()->slate()->combined(
88 "Notification Center",
89 $f->symbol()->icon()->standard(
"notification",
"notification")
92 ->withAdditionalEntry($mail_slate)
93 ->withAdditionalEntry($badge_slate)
94 ->withAdditionalEntry($generic_slate);
95 return $renderer->render($notification_center);
standard()
description: > This is an example, of how the Notification Slate is generated by assigning Notificat...