ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
modeinfo.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24
39function 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
60
61global $DIC;
62$request_wrapper = $DIC->http()->wrapper()->query();
63$refinery = $DIC->refinery();
64
65if ($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
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
static initILIAS()
ilias initialisation
exit
$dic
Definition: ltiresult.php:33
Class HTTPServicesTest.
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
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.