ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
include_aggregates.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
36{
37 global $DIC;
38 $f = $DIC->ui()->factory();
39 $renderer = $DIC->ui()->renderer();
40 $refinery = $DIC->refinery();
41 $request_wrapper = $DIC->http()->wrapper()->query();
42
43 $close_url = $_SERVER['REQUEST_URI'] . '&aggregate_closed=true';
44
45 //If closed, an ajax request is fired to the set close_url
46 if (
47 $request_wrapper->has('aggregate_closed') &&
48 $request_wrapper->retrieve('aggregate_closed', $refinery->kindlyTo()->bool())
49 ) {
50 //Do Some Magic needed to be done, when this item is closed.
51 exit;
52 }
53
54 //Some generic notification Items
55 $generic_icon1 = $f->symbol()->icon()->standard("cal", "generic");
56 $generic_title1 = $f->link()->standard("Aggregate of Item", "#");
57 $generic_item1 = $f->item()->notification($generic_title1, $generic_icon1)
58 ->withDescription("Is shown when top item is clicked")
59 ->withProperties(["Property 1" => "Content 1", "Property 2" => "Content 2"])
60 ->withActions(
61 $f->dropdown()->standard([
62 $f->button()->shy("Link to ilias.de", "https://www.ilias.de"),
63 $f->button()->shy("Link to github", "https://www.github.com")
64 ])
65 )
66 ->withCloseAction($close_url);
67
68 $generic_title2 = $f->link()->standard("Item", "just_opens_the_list_of_aggregates");
69 $generic_item2 = $f->item()->notification($generic_title2, $generic_icon1)
70 ->withDescription("Notification Item with Aggregates")
71 ->withProperties(["Property 1" => "Content 1", "Property 2" => "Content 2"])
72 ->withAggregateNotifications([$generic_item1, $generic_item1]);
73
74
75 return $renderer->render($generic_item2);
76}
$renderer
exit
$_SERVER['HTTP_HOST']
Definition: raiseError.php:26
global $DIC
Definition: shib_login.php:26