ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
drilldown.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
46 function drilldown()
47 {
48  global $DIC;
49  $f = $DIC->ui()->factory();
50  $renderer = $DIC->ui()->renderer();
51 
52  $ico = $f->symbol()->icon()->standard('', '')->withSize('small')->withAbbreviation('+');
53  $image = $f->image()->responsive("assets/ui-examples/images/Image/mountains.jpg", "Some mountains in the dusk");
54  $page = $f->modal()->lightboxImagePage($image, 'Mountains');
55  $modal = $f->modal()->lightbox($page);
56  $button = $f->button()->bulky($ico->withAbbreviation('>'), 'Modal', '')
57  ->withOnClick($modal->getShowSignal());
58 
59  $uri = new \ILIAS\Data\URI('https://ilias.de');
60  $link = $f->link()->bulky($ico->withAbbreviation('>'), 'Link', $uri);
61  $divider = $f->divider()->horizontal();
62 
63  $items = [
64  $f->menu()->sub('Switzerland', [
65  $f->menu()->sub('Riverine Amphipod', [$button, $link]),
66  $f->menu()->sub('Wildcat', [
67  $f->menu()->sub('European Wildcat', [$button, $link]),
68  $f->menu()->sub('African Wildcat', [$button, $link, $divider, $link])
69  ]),
70  $button,
71  $link
72  ]),
73 
74  $f->menu()->sub('Germany', [
75  $f->menu()->sub('Otter', [$button, $link]),
76  $f->menu()->sub('Mole', [$button, $link]),
77  $divider,
78  $f->menu()->sub('Deer', [$button, $link])
79  ])
80  ];
81 
82  $dd = $f->menu()->drilldown('Animal of the year', $items);
83 
84  return $renderer->render([
85  $dd,
86  $modal
87  ]);
88 }
89 
90 
91 function toBulky(string $label): \ILIAS\UI\Component\Button\Bulky
92 {
93  global $DIC;
94  $f = $DIC->ui()->factory();
95  $ico = $f->symbol()->icon()->standard('', '')
96  ->withSize('small')
97  ->withAbbreviation('+');
98 
99  return $f->button()->bulky($ico, $label, '');
100 }
drilldown()
description: > The example shows how to create and render a basic markdown field and attach it to a ...
Definition: drilldown.php:46
$renderer
Interface Observer Contains several chained tasks and infos about them.
global $DIC
Definition: shib_login.php:22