ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
modeinfo.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
24 
39 function modeinfo(): string
40 {
41  global $DIC;
42  $f = $DIC->ui()->factory();
43  $renderer = $DIC->ui()->renderer();
44  $request_wrapper = $DIC->http()->wrapper()->query();
45 
46  $icon = $f->symbol()->icon()->standard('root', '')->withSize('large');
47  $target = new \ILIAS\Data\URI(
48  $DIC->http()->request()->getUri()->__toString() . '&new_mode_info=' . MODE_INFO_ACTIVE
49  );
50  return $renderer->render([
51  $f->divider()->horizontal(),
52  $f->link()->bulky($icon, 'See UI in fullscreen-mode', $target),
53  $f->legacy()->content('<p><b>press the link above to init a page with Mode Info</b></p><p><br/></p>'),
54  $f->divider()->horizontal()
55  ]);
56 }
57 
58 const MODE_INFO_ACTIVE = 2;
60 
61 global $DIC;
62 $request_wrapper = $DIC->http()->wrapper()->query();
63 $refinery = $DIC->refinery();
64 
65 if ($request_wrapper->has('new_mode_info')
66  && $request_wrapper->retrieve('new_mode_info', $refinery->kindlyTo()->int()) === MODE_INFO_ACTIVE
67 ) {
70  exit();
71 }
72 
74 {
75  $f = $dic->ui()->factory();
76  $data_factory = new \ILIAS\Data\Factory();
77  $renderer = $dic->ui()->renderer();
78 
79  $panel_content = $f->legacy()->content("Mode Info is Active");
80  $slate = $f->mainControls()->slate()->legacy(
81  "Mode Info Active",
82  $f->symbol()->glyph()->notification(),
83  $f->legacy()->content("Things todo when special Mode is active")
84  );
85 
86  $page = $f->layout()->page()->standard(
87  [
88  $f->legacy()->content("<div id='mainspacekeeper'><div style='padding: 15px;'>"),
89  $f->panel()->standard(
90  'Mode Info Example',
91  $panel_content
92  ),
93  $f->legacy()->content("</div></div>")
94  ],
95  $f->mainControls()->metaBar()->withAdditionalEntry(
96  'help',
97  $f->button()->bulky($f->symbol()->glyph()->help(), 'Help', '#')
98  ),
99  $f->mainControls()->mainBar()->withAdditionalEntry("entry1", $slate),
100  $f->breadcrumbs([]),
101  $f->image()->responsive("assets/images/logo/HeaderIcon.svg", "ILIAS"),
102  $f->image()->responsive("assets/images/logo/HeaderIconResponsive.svg", "ILIAS"),
103  "./assets/images/logo/favicon.ico",
104  $dic->ui()->factory()->toast()->container(),
105  $dic->ui()->factory()->mainControls()->footer()->withAdditionalText("Footer"),
106  'UI PAGE MODE INFO DEMO', //page title
107  'ILIAS', //short title
108  'Mode Info Demo' //view title
109  )
110  ->withHeaders(true)
111  ->withUIDemo(true);
112 
113 
117  $back = str_replace(
118  'new_mode_info=' . MODE_INFO_ACTIVE,
119  'new_mode_info=' . MODE_INFO_INACTIVE,
120  $dic->http()->request()->getUri()->getQuery()
121  );
122 
123  $mode_info = $f->mainControls()->modeInfo(
124  "Active Mode Info",
125  $data_factory->uri($dic->http()->request()->getUri()->withQuery($back)->__toString())
126  );
127 
131  $page = $page->withModeInfo($mode_info);
132 
133  return $renderer->render($page);
134 }
$renderer
modeinfo()
expected output: > ILIAS shows a button "See UI in fullscreen-mode".
Definition: modeinfo.php:39
Interface Observer Contains several chained tasks and infos about them.
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:73
Class HTTPServicesTest.
$dic
Definition: result.php:31
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...