19 declare(strict_types=1);
41 $f = $DIC->ui()->factory();
48 $mail_icon =
$f->symbol()->icon()->standard(
"mail",
"mail");
49 $mail_title =
$f->link()->standard(
"Inbox",
"link_to_inbox");
50 $mail_notification_item =
$f->item()->notification($mail_title, $mail_icon)
51 ->withDescription(
"You have 23 unread mails in your inbox")
52 ->withProperties([
"Time" =>
"3 days ago"])
53 ->withAdditionalContent(
$f->legacy()->content(
"<b>Additional Content</b>"));
56 $close_url =
$_SERVER[
'REQUEST_URI'] .
'&badge_closed=true';
61 $badge_icon =
$f->symbol()->icon()->standard(
"bdga",
"mail");
62 $badge_title =
$f->link()->standard(
"Badges",
"link_to_achievement_badges");
63 $badge_notification_item1 =
$f->item()->notification($badge_title, $badge_icon)
64 ->withDescription(
"You received 1 Badge.")
65 ->withProperties([
"Time" =>
"2 days ago"])
66 ->withCloseAction($close_url);
67 $badge_icon =
$f->symbol()->icon()->standard(
"bdga",
"mail");
68 $badge_title =
$f->link()->standard(
"Badges 2",
"link_to_achievement_badges");
69 $close_url =
$_SERVER[
'REQUEST_URI'] .
'&badge_closed=true';
70 $badge_notification_item2 =
$f->item()->notification($badge_title, $badge_icon)
71 ->withDescription(
"You received 1 Badge.")
72 ->withProperties([
"Time" =>
"2 days ago"])
73 ->withCloseAction($close_url);
76 $generic_icon1 =
$f->symbol()->icon()->standard(
"cal",
"generic");
77 $generic_title1 =
$f->link()->standard(
"Generic 1",
"link_to_generic_repo");
78 $generic_item1 =
$f->item()->notification($generic_title1, $generic_icon1)
79 ->withDescription(
"Some description.")
80 ->withProperties([
"Property 1" =>
"Content 1",
"Property 2" =>
"Content 2"])
82 $f->dropdown()->standard([
83 $f->button()->shy(
"Possible Action of this Item",
"https://www.ilias.de"),
84 $f->button()->shy(
"Other Possible Action of this Item",
"https://www.github.com")
87 $generic_item1_with_aggregates = $generic_item1->withAggregateNotifications([$mail_notification_item]);
88 $generic_title2 =
$f->link()->standard(
"Generic 2",
"just_opens_the_list_of_aggregates");
89 $generic_item2 =
$f->item()->notification($generic_title2, $generic_icon1)
90 ->withDescription(
"Some description describing the aggregates attached.")
91 ->withProperties([
"Property 1" =>
"Content 1",
"Property 2" =>
"Content 2"])
92 ->withAggregateNotifications([$generic_item1, $generic_item1]);
95 $mail_slate =
$f->mainControls()->slate()->notification(
"Mail", [$mail_notification_item]);
96 $badge_slate =
$f->mainControls()->slate()->notification(
"Badge", [$badge_notification_item1, $badge_notification_item2]);
97 $generic_slate =
$f->mainControls()->slate()->notification(
"Generic", [
98 $generic_item1_with_aggregates,
103 $notification_center =
$f->mainControls()->slate()->combined(
104 "Notification Center",
105 $f->symbol()->icon()->standard(
"notification",
"notification")
108 ->withAdditionalEntry($mail_slate)
109 ->withAdditionalEntry($badge_slate)
110 ->withAdditionalEntry($generic_slate);
111 return $renderer->render($notification_center);
standard()
description: > This is an example, of how the Notification Slate is generated by assigning Notificat...