ILIAS  release_7 Revision v7.30-3-g800a261c036
base.php File Reference

Go to the source code of this file.

Functions

 base ()
 Base. More...
 

Function Documentation

◆ base()

base ( )

Base.

Definition at line 5 of file base.php.

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}
global $DIC
Definition: goto.php:24
$factory
Definition: metadata.php:58

References $DIC, and $factory.