ILIAS  release_8 Revision v8.24
base.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
6
7function base()
8{
9 global $DIC;
10
11 // This example shows how to render a popover containing a list
12 $factory = $DIC->ui()->factory();
13 $renderer = $DIC->ui()->renderer();
14
15 //Generate some List Items
16 $actions = $factory->dropdown()->standard(array(
17 $factory->button()->shy("ILIAS", "https://www.ilias.de"),
18 $factory->button()->shy("GitHub", "https://www.github.com")
19 ));
20
21 $list_item1 = $factory->item()->standard("Item Title")
22 ->withProperties(array(
23 "Origin" => "Course Title 1",
24 "Last Update" => "24.11.2011",
25 "Location" => "Room 123, Main Street 44, 3012 Bern"))
26 ->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.");
27
28 $list_item2 = $factory->item()->standard("Item 2 Title")
29 ->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.");
30
31 $list_item3 = $factory->item()->standard("Item 3 Title")
32 ->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.");
33
34
35 //Put the List Items Into the Listing Popover
36 $popover = $factory->popover()->listing([
37 $factory->item()->group("Subtitle 1", [$list_item1, $list_item2]),
38 $factory->item()->group("Subtitle 2", [$list_item3])
39 ])->withTitle('Listing');
40
41 //Add a Button opening the Listing Popover on Click
42 $button = $factory->button()->standard('Show Listing', '#')
43 ->withOnClick($popover->getShowSignal());
44
45 //Render the Listing Popover
46 return $renderer->render([$popover, $button]);
47}
global $DIC
Definition: feed.php:28
$factory
Definition: metadata.php:75