ILIAS  release_8 Revision v8.24
include_aggregates.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
6
8{
9 global $DIC;
10 $f = $DIC->ui()->factory();
11 $renderer = $DIC->ui()->renderer();
12 $refinery = $DIC->refinery();
13 $request_wrapper = $DIC->http()->wrapper()->query();
14
15 $close_url = $_SERVER['REQUEST_URI'] . '&aggregate_closed=true';
16
17 //If closed, an ajax request is fired to the set close_url
18 if (
19 $request_wrapper->has('aggregate_closed') &&
20 $request_wrapper->retrieve('aggregate_closed', $refinery->kindlyTo()->bool())
21 ) {
22 //Do Some Magic needed to be done, when this item is closed.
23 exit;
24 }
25
26 //Some generic notification Items
27 $generic_icon1 = $f->symbol()->icon()->standard("cal", "generic");
28 $generic_title1 = $f->link()->standard("Aggregate of Item", "#");
29 $generic_item1 = $f->item()->notification($generic_title1, $generic_icon1)
30 ->withDescription("Is shown when top item is clicked")
31 ->withProperties(["Property 1" => "Content 1", "Property 2" => "Content 2"])
32 ->withActions(
33 $f->dropdown()->standard([
34 $f->button()->shy("Link to ilias.de", "https://www.ilias.de"),
35 $f->button()->shy("Link to github", "https://www.github.com")
36 ])
37 )
38 ->withCloseAction($close_url);
39
40 $generic_title2 = $f->link()->standard("Item", "just_opens_the_list_of_aggregates");
41 $generic_item2 = $f->item()->notification($generic_title2, $generic_icon1)
42 ->withDescription("Notification Item with Aggregates")
43 ->withProperties(["Property 1" => "Content 1", "Property 2" => "Content 2"])
44 ->withAggregateNotifications([$generic_item1, $generic_item1]);
45
46
47 return $renderer->render($generic_item2);
48}
global $DIC
Definition: feed.php:28
exit
Definition: login.php:28
Refinery Factory $refinery
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10