ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
drilldown.php
Go to the documentation of this file.
1 <?php
2 function drilldown()
3 {
4 
20  global $DIC;
21  $f = $DIC->ui()->factory();
22  $renderer = $DIC->ui()->renderer();
23 
24 
25  $ico = $f->symbol()->icon()->standard('', '')->withSize('medium')->withAbbreviation('+');
26 
27  $image = $f->image()->responsive("src/UI/examples/Image/mountains.jpg", "Image source: https://stocksnap.io, Creative Commons CC0 license");
28  $page = $f->modal()->lightboxImagePage($image, 'Mountains');
29  $modal = $f->modal()->lightbox($page);
30 
31  $button = $f->button()->bulky($ico->withAbbreviation('>'), 'Modal', '')
32  ->withOnClick($modal->getShowSignal());
33 
34  $label = $f->button()->bulky($ico->withAbbreviation('0'), 'Tier des Jahres (0)', '');
35 
36  $uri = new \ILIAS\Data\URI('https://ilias.de');
37  $link = $f->link()->bulky($ico->withAbbreviation('>'), 'Link', $uri);
38 
39  $items = [
40  $f->menu()->sub(toBulky('Schweiz (1)'), [
41  $f->menu()->sub(
42  toBulky('Bachflohkrebs (1.1)'),
43  [$button, $link]
44  )
45  ->withInitiallyActive(),
46  $f->menu()->sub(toBulky('Wildkatze (1.2)'), [
47  $f->menu()->sub('gewöhnliche Wildkatze (1.2.1)', [$button]),
48  $f->menu()->sub('große Wildkatze (1.2.2)', [$button])
49  ]),
50  $button
51  ]),
52 
53  $f->menu()->sub(toBulky('Deutschland (2)'), [
54  $f->menu()->sub('Fischotter (2.1)', [$button]),
55  $f->menu()->sub('Maulwurf (2.2)', [$button]),
56  $f->divider()->horizontal(),
57  $f->menu()->sub('Reh (2.3)', [$button])
58  ])
59  ];
60 
61  $dd = $f->menu()->drilldown($label, $items);
62 
63  return $renderer->render([
64  $dd,
65  $modal
66  ]);
67 }
68 
69 
70 function toBulky(string $label) : \ILIAS\UI\Component\Button\Bulky
71 {
72  global $DIC;
73  $f = $DIC->ui()->factory();
74  $ico = $f->symbol()->icon()->standard('', '')
75  ->withSize('medium')
76  ->withAbbreviation('+');
77 
78  return $f->button()->bulky($ico, $label, '');
79 }
drilldown()
Definition: drilldown.php:2
Class Factory.
Class ChatMainBarProvider .
global $DIC
Definition: goto.php:24
toBulky(string $label)
Definition: drilldown.php:70