ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
base.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
34 function base()
35 {
36  global $DIC;
37 
38  // This example shows how to render a popover containing a list
39  $factory = $DIC->ui()->factory();
40  $renderer = $DIC->ui()->renderer();
41 
42  //Generate some List Items
43  $actions = $factory->dropdown()->standard(array(
44  $factory->button()->shy("ILIAS", "https://www.ilias.de"),
45  $factory->button()->shy("GitHub", "https://www.github.com")
46  ));
47 
48  $list_item1 = $factory->item()->standard("Item Title")
49  ->withProperties(array(
50  "Origin" => "Course Title 1",
51  "Last Update" => "24.11.2011",
52  "Location" => "Room 123, Main Street 44, 3012 Bern"))
53  ->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.");
54 
55  $list_item2 = $factory->item()->standard("Item 2 Title")
56  ->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.");
57 
58  $list_item3 = $factory->item()->standard("Item 3 Title")
59  ->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.");
60 
61 
62  //Put the List Items Into the Listing Popover
63  $popover = $factory->popover()->listing([
64  $factory->item()->group("Subtitle 1", [$list_item1, $list_item2]),
65  $factory->item()->group("Subtitle 2", [$list_item3])
66  ])->withTitle('Listing');
67 
68  //Add a Button opening the Listing Popover on Click
69  $button = $factory->button()->standard('Show Listing', '#')
70  ->withOnClick($popover->getShowSignal());
71 
72  //Render the Listing Popover
73  return $renderer->render([$popover, $button]);
74 }
$renderer
base()
description: > Example for rendering a listing popover.
Definition: base.php:34
global $DIC
Definition: shib_login.php:22