ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ILIAS\UI\examples\MainControls\ModeInfo Namespace Reference

Functions

 modeinfo ()
 

expected output: > ILIAS shows a button "See UI in fullscreen-mode". More...

 
if($request_wrapper->has('new_mode_info') && $request_wrapper->retrieve('new_mode_info', $refinery->kindlyTo() ->int())===MODE_INFO_ACTIVErenderModeInfoFullscreenMode (\ILIAS\DI\Container $dic)
 

Variables

const MODE_INFO_ACTIVE = 2
 
const MODE_INFO_INACTIVE = 1
 
global $DIC
 
 $request_wrapper = $DIC->http()->wrapper()->query()
 
 $refinery = $DIC->refinery()
 

Function Documentation

◆ modeinfo()

ILIAS\UI\examples\MainControls\ModeInfo\modeinfo ( )


expected output: > ILIAS shows a button "See UI in fullscreen-mode".

When clicked, a new page is shown with

  • only one entry in the mainbar
  • only the help-glyph in the metabar
  • very(!) little content
  • and a colored frame around the entire page. On the top of the frame, there is colored area "Active Mode Info" with a close-glyph. Clicking the close-glyph will return to the

    UI documentation.

Definition at line 39 of file modeinfo.php.

References ILIAS\UI\examples\MainControls\ModeInfo\$DIC, Vendor\Package\$f, $renderer, ILIAS\UI\examples\MainControls\ModeInfo\$request_wrapper, and ILIAS\UI\examples\MainControls\ModeInfo\MODE_INFO_ACTIVE.

39  : 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;
59 const MODE_INFO_INACTIVE = 1;
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 ) {
69  echo(renderModeInfoFullscreenMode($DIC));
70  exit();
71 }
$renderer
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
exit

◆ renderModeInfoFullscreenMode()

if ( $request_wrapper->has( 'new_mode_info') &&$request_wrapper->retrieve( 'new_mode_info', $refinery->kindlyTo() ->int())===MODE_INFO_ACTIVE) ILIAS\UI\examples\MainControls\ModeInfo\renderModeInfoFullscreenMode ( \ILIAS\DI\Container  $dic)

a Mode Info needs to know what happens when you exit the mode

the Mode Info is attached to the page

Definition at line 73 of file modeinfo.php.

References Vendor\Package\$f, $renderer, ILIAS\UI\examples\MainControls\ModeInfo\MODE_INFO_ACTIVE, and ILIAS\UI\examples\MainControls\ModeInfo\MODE_INFO_INACTIVE.

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
$dic
Definition: result.php:31

Variable Documentation

◆ $DIC

global ILIAS::UI::examples::MainControls::ModeInfo\$DIC

Definition at line 61 of file modeinfo.php.

Referenced by ILIAS\UI\examples\MainControls\ModeInfo\modeinfo().

◆ $refinery

ILIAS::UI::examples::MainControls::ModeInfo\$refinery = $DIC->refinery()

Definition at line 63 of file modeinfo.php.

◆ $request_wrapper

ILIAS::UI::examples::MainControls::ModeInfo\$request_wrapper = $DIC->http()->wrapper()->query()

Definition at line 62 of file modeinfo.php.

Referenced by ILIAS\UI\examples\MainControls\ModeInfo\modeinfo().

◆ MODE_INFO_ACTIVE

const ILIAS::UI::examples::MainControls::ModeInfo\MODE_INFO_ACTIVE = 2

◆ MODE_INFO_INACTIVE

const ILIAS::UI::examples::MainControls::ModeInfo\MODE_INFO_INACTIVE = 1