ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
base.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
21 function base(): string
22 {
23  global $DIC;
24  $factory = $DIC->ui()->factory();
25  $renderer = $DIC->ui()->renderer();
26  $request = $DIC->http()->wrapper()->query();
27  $request_url = $DIC->http()->request()->getUri();
28  $data_factory = new \ILIAS\Data\Factory();
29  $refinery_factory = new \ILIAS\Refinery\Factory($data_factory, $DIC->language());
30 
31  $example_uri = $data_factory->uri($request_url->__toString());
32 
33  $pseudo_icon = $factory->symbol()->icon()->standard('', 'Pseudo Icon')->withAbbreviation('P');
34 
35  $pseudo_links = [
36  $factory->link()->standard('Some Pseudo Link', '#'),
37  $factory->link()->standard('Another Pseudo Link', '#'),
38  $factory->link()->standard('Pseudo Link', '#'),
39  ];
40 
41  $footer = $factory->mainControls()->footer();
42  $footer = $footer
43  ->withPermanentURL($example_uri)
44  ->withAdditionalLinkGroup("Link Group 1", $pseudo_links)
45  ->withAdditionalLinkGroup("Link Group 2", $pseudo_links)
46  ->withAdditionalLinkGroup("Link Group 3", $pseudo_links)
47  ->withAdditionalLinkGroup("Link Group 4", $pseudo_links)
48  ->withAdditionalLink(...$pseudo_links)
49  ->withAdditionalIcon($pseudo_icon, null)
50  ->withAdditionalIcon($pseudo_icon, null)
51  ->withAdditionalIcon($pseudo_icon, null)
52  ->withAdditionalText(
53  'Powered by ILIAS',
54  'Running on green energy',
55  'It\'s (swearword) huge!',
56  );
57 
58  maybeRenderFooterInFullScreenMode($request, $refinery_factory, $footer);
59 
60  $open_footer_in_fullscreen = $factory->button()->primary(
61  'See Footer in fullscreen',
62  $example_uri . '&ui_maincontrols_footer_example=1',
63  );
64 
65  return $renderer->render($open_footer_in_fullscreen);
66 }
67 
69  \ILIAS\HTTP\Wrapper\RequestWrapper $request,
71  \ILIAS\UI\Component\MainControls\Footer $footer,
72 ): void {
73  if (!$request->has('ui_maincontrols_footer_example')
74  || 1 !== $request->retrieve('ui_maincontrols_footer_example', $refinery->kindlyTo()->int())
75  ) {
76  return;
77  }
78 
80 
81  global $DIC;
82 
83  $html = $DIC->ui()->renderer()->render(
84  getFullScreenDemoPage($DIC->ui()->factory(), $footer)
85  );
86 
87  $DIC->http()->saveResponse(
88  $DIC->http()->response()
89  ->withHeader('Content-Type', 'text/html; charset=utf-8')
90  ->withBody(\ILIAS\Filesystem\Stream\Streams::ofString($html))
91  );
92  $DIC->http()->sendResponse();
93  $DIC->http()->close();
94 }
95 
97  \ILIAS\UI\Factory $factory,
98  \ILIAS\UI\Component\MainControls\Footer $footer,
99 ): \ILIAS\UI\Component\Layout\Page\Page {
100  return $factory->layout()->page()->standard(
101  [],
102  $factory->mainControls()->metaBar(),
103  $factory->mainControls()->mainBar(),
104  $factory->breadcrumbs([]),
105  $factory->image()->responsive("assets/images/logo/HeaderIcon.svg", "ILIAS"),
106  $factory->image()->responsive("assets/images/logo/HeaderIconResponsive.svg", "ILIAS"),
107  './assets/images/logo/favicon.ico',
108  $factory->toast()->container(),
109  $footer,
110  'Footer Example',
111  'Footer Example',
112  'ILIAS',
113  )->withUIDemo(true);
114 }
$renderer
base()
description: > The initial screen shows a Primary Button.
Definition: base.php:21
Interface Observer Contains several chained tasks and infos about them.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getFullScreenDemoPage(\ILIAS\UI\Factory $factory, \ILIAS\UI\Component\MainControls\Footer $footer,)
Definition: base.php:96
static initILIAS()
ilias initialisation
This is how the factory for UI elements looks.
Definition: Factory.php:37
global $DIC
Definition: shib_login.php:25
maybeRenderFooterInFullScreenMode(\ILIAS\HTTP\Wrapper\RequestWrapper $request, \ILIAS\Refinery\Factory $refinery, \ILIAS\UI\Component\MainControls\Footer $footer,)
Definition: base.php:68