ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilKioskPageRenderer Class Reference

Class ilKioskPageRenderer. More...

+ Collaboration diagram for ilKioskPageRenderer:

Public Member Functions

 __construct (ilTemplate $il_global_template, Renderer $ui_renderer, ilTemplate $kiosk_template, ilLSTOCGUI $toc_gui, ilLSLocatorGUI $loc_gui, string $window_base_title)
 
 render (string $lso_title, LSControlBuilder $control_builder, string $obj_title, Component $icon, array $content, Workflow $curriculum)
 

Protected Member Functions

 setHeaderVars (ilTemplate $tpl)
 
 initIlTemplate ()
 
 getJsFiles ()
 
 getOnLoadCode ()
 
 getCSSFiles ()
 
 getInlineCSS ()
 

Detailed Description

Class ilKioskPageRenderer.

Definition at line 12 of file class.ilKioskPageRenderer.php.

Constructor & Destructor Documentation

◆ __construct()

ilKioskPageRenderer::__construct ( ilTemplate  $il_global_template,
Renderer  $ui_renderer,
ilTemplate  $kiosk_template,
ilLSTOCGUI  $toc_gui,
ilLSLocatorGUI  $loc_gui,
string  $window_base_title 
)

Definition at line 14 of file class.ilKioskPageRenderer.php.

21 {
22 $this->il_tpl = $il_global_template;
23 $this->ui_renderer = $ui_renderer;
24 $this->tpl = $kiosk_template;
25 $this->toc_gui = $toc_gui;
26 $this->loc_gui = $loc_gui;
27 $this->window_base_title = $window_base_title;
28 }

Member Function Documentation

◆ getCSSFiles()

ilKioskPageRenderer::getCSSFiles ( )
protected

Definition at line 189 of file class.ilKioskPageRenderer.php.

190 {
191 foreach ($this->il_tpl->css_files as $il_css_file) {
192 $css_files[] = $il_css_file['file'];
193 }
194 foreach ($this->il_tpl->css_files as $il_css_file) {
195 if (!in_array($il_css_file['file'], $css_files)) {
196 $css_files[] = $il_css_file['file'];
197 }
198 }
199 $css_files[] = \ilUtil::getStyleSheetLocation("filesystem", "delos.css");
200 $css_files[] = \ilUtil::getStyleSheetLocation();
202
203 return $css_files;
204 }
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static getNewContentStyleSheetLocation($mode="output")
get full style sheet file name (path inclusive) of current user

References ilUtil\getNewContentStyleSheetLocation(), and ilUtil\getStyleSheetLocation().

+ Here is the call graph for this function:

◆ getInlineCSS()

ilKioskPageRenderer::getInlineCSS ( )
protected

Definition at line 205 of file class.ilKioskPageRenderer.php.

206 {
207 return $this->il_tpl->inline_css;
208 }

◆ getJsFiles()

ilKioskPageRenderer::getJsFiles ( )
protected

Definition at line 158 of file class.ilKioskPageRenderer.php.

159 {
160 $js_files = $this->il_tpl->js_files_batch;
161 $sorted = [
162 [],[],[],[]
163 ];
164 foreach ($js_files as $file => $order) {
165 $order = min($order, 3);
166 $sorted[$order][] = $file;
167 }
168 $js_files = array_merge($sorted[0], $sorted[1], $sorted[2], $sorted[3]);
169 $js_files = array_filter(
170 $js_files,
171 function ($js_file) {
172 return strpos($js_file, 'Services/FileUpload/js') === false;
173 }
174 );
175 return $js_files;
176 }

◆ getOnLoadCode()

ilKioskPageRenderer::getOnLoadCode ( )
protected

Definition at line 178 of file class.ilKioskPageRenderer.php.

179 {
180 $olc = '';
181 if ($this->il_tpl->on_load_code) {
182 foreach ($this->il_tpl->on_load_code as $key => $value) {
183 $olc .= implode(PHP_EOL, $value);
184 }
185 }
186 return $olc;
187 }
PHP_EOL
Definition: complexTest.php:7
$key
Definition: croninfo.php:18

References $key, and PHP_EOL.

◆ initIlTemplate()

ilKioskPageRenderer::initIlTemplate ( )
protected

Definition at line 152 of file class.ilKioskPageRenderer.php.

153 {
154 iljQueryUtil::initjQuery($this->il_tpl);
155 ilUIFramework::init($this->il_tpl);
156 }
static init($a_tpl=null)
Init.
static initjQuery($a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template

References ilUIFramework\init(), and iljQueryUtil\initjQuery().

+ Here is the call graph for this function:

◆ render()

ilKioskPageRenderer::render ( string  $lso_title,
LSControlBuilder  $control_builder,
string  $obj_title,
Component  $icon,
array  $content,
Workflow  $curriculum 
)

Definition at line 30 of file class.ilKioskPageRenderer.php.

37 : string {
38 $this->tpl->setVariable(
39 "HTML_PAGE_TITLE",
40 $this->window_base_title . ' - ' . $lso_title
41 );
42
43 $this->tpl->setVariable(
44 "TOPBAR_CONTROLS",
45 $this->ui_renderer->render($control_builder->getExitControl())
46 );
47
48 $this->tpl->setVariable("TOPBAR_TITLE", $lso_title);
49
50 $this->tpl->setVariable(
51 "OBJECT_ICON",
52 $this->ui_renderer->render($icon)
53 );
54 $this->tpl->setVariable("OBJECT_TITLE", $obj_title);
55
56 $this->tpl->setVariable(
57 "PLAYER_NAVIGATION",
58 $this->ui_renderer->render([
59 $control_builder->getPreviousControl(),
60 $control_builder->getNextControl()
61 ])
62 );
63
64 $controls = $control_builder->getControls();
65
66 //ensure done control is first element
67 if ($control_builder->getDoneControl()) {
68 array_unshift($controls, $control_builder->getDoneControl());
69 }
70 //also shift start control up front - this is for legacy-views only!
71 if ($control_builder->getStartControl()) {
72 array_unshift($controls, $control_builder->getStartControl());
73 $this->tpl->setVariable("JS_INLINE", $control_builder->getAdditionalJS());
74 }
75
76
77 //TODO: insert toggles
78
79 $this->tpl->setVariable(
80 "OBJ_NAVIGATION",
81 $this->ui_renderer->render($controls)
82 );
83
84
85 $this->tpl->setVariable(
86 "VIEW_MODES",
87 $this->ui_renderer->render($control_builder->getModeControls())
88 );
89
90 if ($control_builder->getLocator()) {
91 $this->tpl->setVariable(
92 'LOCATOR',
93 $this->ui_renderer->render(
94 $this->loc_gui
95 ->withItems($control_builder->getLocator()->getItems())
96 ->getComponent()
97 )
98 );
99 }
100
101 $this->tpl->setVariable(
102 'CONTENT',
103 $this->ui_renderer->render($content)
104 );
105 $this->tpl->setVariable(
106 'CURRICULUM',
107 $this->ui_renderer->render($curriculum)
108 );
109
110 if ($control_builder->getToc()) {
111 $this->tpl->touchBlock("sidebar_space");
112 $this->tpl->setVariable(
113 "SIDEBAR",
114 $this->toc_gui
115 ->withStructure($control_builder->getToc()->toJSON())
116 ->getHTML()
117 );
118 } else {
119 $this->tpl->touchBlock("sidebar_disabled");
120 }
121
122 $tpl = $this->setHeaderVars($this->tpl);
123 return $tpl->get();
124 }
$tpl
Definition: ilias.php:10

References LSControlBuilder\getDoneControl().

+ Here is the call graph for this function:

◆ setHeaderVars()

ilKioskPageRenderer::setHeaderVars ( ilTemplate  $tpl)
protected

Definition at line 126 of file class.ilKioskPageRenderer.php.

127 {
128 $this->initIlTemplate();
129 $js_files = $this->getJsFiles();
130 $js_olc = $this->getOnLoadCode();
131 $css_files = $this->getCSSFiles();
132 $css_inline = $this->getInlineCSS();
133
134 foreach ($js_files as $js_file) {
135 $tpl->setCurrentBlock("js_file");
136 $tpl->setVariable("JS_FILE", $js_file);
137 $tpl->parseCurrentBlock();
138 }
139
140 foreach ($css_files as $css_file) {
141 $tpl->setCurrentBlock("css_file");
142 $tpl->setVariable("CSS_FILE", $css_file);
143 $tpl->parseCurrentBlock();
144 }
145
146 $tpl->setVariable("CSS_INLINE", implode(PHP_EOL, $css_inline));
147 $tpl->setVariable("OLCODE", $js_olc);
148
149 return $tpl;
150 }

References $tpl, ILIAS\UI\Implementation\Component\getOnLoadCode(), and PHP_EOL.

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: