ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
modeinfo.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
8 
9 function modeinfo(): string
10 {
11  global $DIC;
12  $f = $DIC->ui()->factory();
13  $renderer = $DIC->ui()->renderer();
14  $request_wrapper = $DIC->http()->wrapper()->query();
15 
16  $icon = $f->symbol()->icon()->standard('root', '')->withSize('large');
17  $target = new \ILIAS\Data\URI(
18  $DIC->http()->request()->getUri()->__toString() . '&new_mode_info=' . MODE_INFO_ACTIVE
19  );
20  return $renderer->render([
21  $f->divider()->horizontal(),
22  $f->link()->bulky($icon, 'See UI in fullscreen-mode', $target),
23  $f->legacy('<p><b>press the link above to init a page with Mode Info</b></p><p><br/></p>'),
24  $f->divider()->horizontal()
25  ]);
26 }
27 
28 const MODE_INFO_ACTIVE = 2;
30 
31 global $DIC;
32 $request_wrapper = $DIC->http()->wrapper()->query();
33 $refinery = $DIC->refinery();
34 
35 if ($request_wrapper->has('new_mode_info')
36  && $request_wrapper->retrieve('new_mode_info', $refinery->kindlyTo()->int()) === MODE_INFO_ACTIVE
37 ) {
40  exit();
41 }
42 
44 {
45  $f = $dic->ui()->factory();
46  $data_factory = new \ILIAS\Data\Factory();
47  $renderer = $dic->ui()->renderer();
48 
49  $panel_content = $f->legacy("Mode Info is Active");
50  $slate = $f->mainControls()->slate()->legacy(
51  "Mode Info Active",
52  $f->symbol()->glyph()->notification(),
53  $f->legacy("Things todo when special Mode is active")
54  );
55 
56  $page = $f->layout()->page()->standard(
57  [$f->panel()->standard(
58  'Mode Info Example',
59  $panel_content
60  )],
61  $f->mainControls()->metaBar()->withAdditionalEntry(
62  'help',
63  $f->button()->bulky($f->symbol()->glyph()->help(), 'Help', '#')
64  ),
65  $f->mainControls()->mainBar()->withAdditionalEntry("entry1", $slate),
66  $f->breadcrumbs([]),
67  $f->image()->responsive("templates/default/images/logo/HeaderIcon.svg", "ILIAS"),
68  $f->image()->responsive("templates/default/images/logo/HeaderIconResponsive.svg", "ILIAS"),
69  "./templates/default/images/logo/favicon.ico",
70  $dic->ui()->factory()->toast()->container(),
71  $dic->ui()->factory()->mainControls()->footer([], "Footer"),
72  'UI PAGE MODE INFO DEMO', //page title
73  'ILIAS', //short title
74  'Mode Info Demo' //view title
75  )
76  ->withHeaders(true)
77  ->withUIDemo(true);
78 
79 
83  $back = str_replace(
84  'new_mode_info=' . MODE_INFO_ACTIVE,
85  'new_mode_info=' . MODE_INFO_INACTIVE,
86  $dic->http()->request()->getUri()->getQuery()
87  );
88 
89  $mode_info = $f->mainControls()->modeInfo(
90  "Active Mode Info",
91  $data_factory->uri($dic->http()->request()->getUri()->withQuery($back)->__toString())
92  );
93 
97  $page = $page->withModeInfo($mode_info);
98 
99  return $renderer->render($page);
100 }
exit
Definition: login.php:29
Class ChatMainBarProvider .
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
static initILIAS()
ilias initialisation
if($request_wrapper->has('new_mode_info') && $request_wrapper->retrieve('new_mode_info', $refinery->kindlyTo() ->int())===MODE_INFO_ACTIVE) renderModeInfoFullscreenMode(\ILIAS\DI\Container $dic)
Definition: modeinfo.php:43
Class HTTPServicesTest.
$dic
Definition: result.php:32