ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
base.php
Go to the documentation of this file.
1<?php
5function base()
6{
7 global $DIC;
8
9 // This example shows how to render a popover containing a list
10 $factory = $DIC->ui()->factory();
11 $renderer = $DIC->ui()->renderer();
12
13 //Generate some List Items
14 $actions = $factory->dropdown()->standard(array(
15 $factory->button()->shy("ILIAS", "https://www.ilias.de"),
16 $factory->button()->shy("GitHub", "https://www.github.com")
17 ));
18
19 $list_item1 = $factory->item()->standard("Item Title")
20 ->withProperties(array(
21 "Origin" => "Course Title 1",
22 "Last Update" => "24.11.2011",
23 "Location" => "Room 123, Main Street 44, 3012 Bern"))
24 ->withDescription("Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.");
25
26 $list_item2 = $factory->item()->standard("Item 2 Title")
27 ->withDescription("Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.");
28
29 $list_item3 = $factory->item()->standard("Item 3 Title")
30 ->withDescription("Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.");
31
32
33 //Put the List Items Into the Listing Popover
34 $popover = $factory->popover()->listing([
35 $factory->item()->group("Subtitle 1", [$list_item1, $list_item2]),
36 $factory->item()->group("Subtitle 2", [$list_item3])
37 ])->withTitle('Listing');
38
39 //Add a Button opening the Listing Popover on Click
40 $button = $factory->button()->standard('Show Listing', '#')
41 ->withOnClick($popover->getShowSignal());
42
43 //Render the Listing Popover
44 return $renderer->render([$popover, $button]);
45}
base()
Definition: base.php:4
An exception for terminatinating execution or to throw for unit testing.
$factory
Definition: metadata.php:58
$DIC
Definition: xapitoken.php:46