ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
include_aggregates.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
20 {
21  global $DIC;
22  $f = $DIC->ui()->factory();
23  $renderer = $DIC->ui()->renderer();
24  $refinery = $DIC->refinery();
25  $request_wrapper = $DIC->http()->wrapper()->query();
26 
27  $close_url = $_SERVER['REQUEST_URI'] . '&aggregate_closed=true';
28 
29  //If closed, an ajax request is fired to the set close_url
30  if (
31  $request_wrapper->has('aggregate_closed') &&
32  $request_wrapper->retrieve('aggregate_closed', $refinery->kindlyTo()->bool())
33  ) {
34  //Do Some Magic needed to be done, when this item is closed.
35  exit;
36  }
37 
38  //Some generic notification Items
39  $generic_icon1 = $f->symbol()->icon()->standard("cal", "generic");
40  $generic_title1 = $f->link()->standard("Aggregate of Item", "#");
41  $generic_item1 = $f->item()->notification($generic_title1, $generic_icon1)
42  ->withDescription("Is shown when top item is clicked")
43  ->withProperties(["Property 1" => "Content 1", "Property 2" => "Content 2"])
44  ->withActions(
45  $f->dropdown()->standard([
46  $f->button()->shy("Link to ilias.de", "https://www.ilias.de"),
47  $f->button()->shy("Link to github", "https://www.github.com")
48  ])
49  )
50  ->withCloseAction($close_url);
51 
52  $generic_title2 = $f->link()->standard("Item", "just_opens_the_list_of_aggregates");
53  $generic_item2 = $f->item()->notification($generic_title2, $generic_icon1)
54  ->withDescription("Notification Item with Aggregates")
55  ->withProperties(["Property 1" => "Content 1", "Property 2" => "Content 2"])
56  ->withAggregateNotifications([$generic_item1, $generic_item1]);
57 
58 
59  return $renderer->render($generic_item2);
60 }
$renderer
include_aggregates()
description: > Example for rendering a notificication item including aggregates. ...
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
global $DIC
Definition: shib_login.php:25