ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
base_metabar.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24
36function base_metabar(): string
37{
38 global $DIC;
39 $f = $DIC->ui()->factory();
40 $renderer = $DIC->ui()->renderer();
41
42 $url = $DIC->http()->request()->getUri()->__toString() . '&new_metabar_ui=1';
43 $txt = $f->legacy()->content('<p>
44 The Metabar Example opens in Fullscreen to showcase the behaviour of the metabar best.
45 Note, an comprensive example for developers on how to access the JS API of the Metabar
46 feature bellow in the second example.
47 </p>');
48
49 $page_demo = $f->link()->standard('See UI in fullscreen-mode', $url);
50
51 return $renderer->render([
52 $txt,
53 $page_demo
54 ]);
55}
56
57function buildMetabar(\ILIAS\UI\Factory $f): \ILIAS\UI\Component\MainControls\MetaBar
58{
59 $help = $f->button()->bulky($f->symbol()->glyph()->help(), 'Help', '#');
60 $search = $f->button()->bulky($f->symbol()->glyph()->search(), 'Search', '#');
61 $user = $f->button()->bulky($f->symbol()->glyph()->user(), 'User', '#');
62
63 $notes = $f->mainControls()->slate()->legacy(
64 'Notification',
65 $f->symbol()->glyph()->notification(),
66 $f->legacy()->content('some content')
67 );
68
69 return $f->mainControls()->metaBar()
70 ->withAdditionalEntry('search', $search)
71 ->withAdditionalEntry('help', $help)
72 ->withAdditionalEntry('notes', $notes)
73 ->withAdditionalEntry('user', $user);
74}
75
76global $DIC;
77$request_wrapper = $DIC->http()->wrapper()->query();
78$refinery = $DIC->refinery();
79if ($request_wrapper->has('new_metabar_ui')
80 && $request_wrapper->retrieve('new_metabar_ui', $refinery->kindlyTo()->int()) === 1
81) {
84 exit();
85}
86
88{
89 $f = $dic->ui()->factory();
90 $renderer = $dic->ui()->renderer();
91 $logo = $f->image()->responsive("assets/images/logo/HeaderIcon.svg", "ILIAS");
92 $responsive_logo = $f->image()->responsive("assets/images/logo/HeaderIconResponsive.svg", "ILIAS");
93 $breadcrumbs = pageMetabarDemoCrumbs($f);
94 $metabar = buildMetabar($f);
95 $mainbar = pageMetabarDemoMainbar($f);
96 $footer = pageMetabarDemoFooter($f);
97 $tc = $dic->ui()->factory()->toast()->container();
98
99 $content = pageMetabarDemoContent($f);
100
101 $page = $f->layout()->page()->standard(
102 $content,
103 $metabar,
104 $mainbar,
105 $breadcrumbs,
106 $logo,
107 $responsive_logo,
108 "./assets/images/logo/favicon.ico",
109 $tc,
110 $footer,
111 'UI Meta Bar DEMO', //page title
112 'ILIAS', //short title
113 'ILIAS Meta Bar Demo' //view title
114 )->withUIDemo(true);
115
116 return $renderer->render($page);
117}
118
119
121{
122 return [
123 $f->panel()->standard(
124 'All about the Meta Bar',
125 $f->legacy()->content(
126 "See above"
127 )
128 ),
129 ];
130}
131
133{
134 return $f->breadcrumbs([]);
135}
136
137function pageMetabarDemoMainbar(\ILIAS\UI\Factory $f): \ILIAS\UI\Component\MainControls\MainBar
138{
139 return $f->mainControls()->mainBar();
140}
141
142function pageMetabarDemoFooter(\ILIAS\UI\Factory $f): \ILIAS\UI\Component\MainControls\Footer
143{
144 $text = 'Footer';
145
146 return $f->mainControls()->footer()->withAdditionalText($text);
147}
$renderer
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
Builds a Color from either hex- or rgb values.
Definition: Factory.php:31
Definition: UI.php:24
static initILIAS()
ilias initialisation
exit
$txt
Definition: error.php:31
$dic
Definition: ltiresult.php:33
pageMetabarDemoContent(\ILIAS\UI\Factory $f)
pageMetabarDemoCrumbs(\ILIAS\UI\Factory $f)
if( $request_wrapper->has( 'new_metabar_ui') &&$request_wrapper->retrieve( 'new_metabar_ui', $refinery->kindlyTo() ->int())===1) renderMetaBarInFullscreenMode(Container $dic)
pageMetabarDemoMainbar(\ILIAS\UI\Factory $f)
pageMetabarDemoFooter(\ILIAS\UI\Factory $f)
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
$url
Definition: shib_logout.php:68