ILIAS  trunk Revision v11.0_alpha-1846-g895b5f47236
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
base_metabar.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
24 
36 function 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 
57 function 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 
76 global $DIC;
77 $request_wrapper = $DIC->http()->wrapper()->query();
78 $refinery = $DIC->refinery();
79 if ($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 
137 function pageMetabarDemoMainbar(\ILIAS\UI\Factory $f): \ILIAS\UI\Component\MainControls\MainBar
138 {
139  return $f->mainControls()->mainBar();
140 }
141 
142 function pageMetabarDemoFooter(\ILIAS\UI\Factory $f): \ILIAS\UI\Component\MainControls\Footer
143 {
144  $text = 'Footer';
145 
146  return $f->mainControls()->footer()->withAdditionalText($text);
147 }
pageMetabarDemoFooter(\ILIAS\UI\Factory $f)
$renderer
Interface Observer Contains several chained tasks and infos about them.
$url
Definition: shib_logout.php:66
pageMetabarDemoCrumbs(\ILIAS\UI\Factory $f)
pageMetabarDemoContent(\ILIAS\UI\Factory $f)
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
if($request_wrapper->has('new_metabar_ui') && $request_wrapper->retrieve('new_metabar_ui', $refinery->kindlyTo() ->int())===1) renderMetaBarInFullscreenMode(Container $dic)
static initILIAS()
ilias initialisation
$txt
Definition: error.php:31
pageMetabarDemoMainbar(\ILIAS\UI\Factory $f)
base_metabar()
expected output: > ILIAS shows a link "See UI in fullscreen-mode".
$dic
Definition: result.php:31
ui()
Get the interface to get services from UI framework.
Definition: Container.php:127
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...