ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
drilldown.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
30 function drilldown()
31 {
32  global $DIC;
33  $f = $DIC->ui()->factory();
34  $renderer = $DIC->ui()->renderer();
35 
36  $ico = $f->symbol()->icon()->standard('', '')->withSize('small')->withAbbreviation('+');
37  $image = $f->image()->responsive("assets/ui-examples/images/Image/mountains.jpg", "Some mountains in the dusk");
38  $page = $f->modal()->lightboxImagePage($image, 'Mountains');
39  $modal = $f->modal()->lightbox($page);
40  $button = $f->button()->bulky($ico->withAbbreviation('>'), 'Modal', '')
41  ->withOnClick($modal->getShowSignal());
42 
43  $uri = new \ILIAS\Data\URI('https://ilias.de');
44  $link = $f->link()->bulky($ico->withAbbreviation('>'), 'Link', $uri);
45  $divider = $f->divider()->horizontal();
46 
47  $items = [
48  $f->menu()->sub('Switzerland', [
49  $f->menu()->sub('Riverine Amphipod', [$button, $link]),
50  $f->menu()->sub('Wildcat', [
51  $f->menu()->sub('European Wildcat', [$button, $link]),
52  $f->menu()->sub('African Wildcat', [$button, $link, $divider, $link])
53  ]),
54  $button,
55  $link
56  ]),
57 
58  $f->menu()->sub('Germany', [
59  $f->menu()->sub('Otter', [$button, $link]),
60  $f->menu()->sub('Mole', [$button, $link]),
61  $divider,
62  $f->menu()->sub('Deer', [$button, $link])
63  ])
64  ];
65 
66  $dd = $f->menu()->drilldown('Animal of the year', $items);
67 
68  return $renderer->render([
69  $dd,
70  $modal
71  ]);
72 }
73 
74 
75 function toBulky(string $label): \ILIAS\UI\Component\Button\Bulky
76 {
77  global $DIC;
78  $f = $DIC->ui()->factory();
79  $ico = $f->symbol()->icon()->standard('', '')
80  ->withSize('small')
81  ->withAbbreviation('+');
82 
83  return $f->button()->bulky($ico, $label, '');
84 }
drilldown()
description: > The example shows how to create and render a basic markdown field and attach it to a ...
Definition: drilldown.php:30
$renderer
Interface Observer Contains several chained tasks and infos about them.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: shib_login.php:25