ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilKioskPageRenderer Class Reference
+ Collaboration diagram for ilKioskPageRenderer:

Public Member Functions

 __construct (MetaContent $layout_meta_content, Factory $ui_factory, Renderer $ui_renderer, ilLanguage $lng, ilTemplate $kiosk_template, ilLSTOCGUI $toc_gui, ilLSLocatorGUI $loc_gui, string $window_base_title)
 
 buildLearningMapEntry (string $map_html)
 The learning map entry of the main bar. More...
 
 buildToCSlate (LSTOCBuilder $toc, Icon $icon)
 
 addOnLoadCode (string $code, int $batch=2)
 
 addJs (string $path, bool $add_version_number=false, int $batch=2)
 
 addCss (string $path)
 
 render (LSControlBuilder $control_builder, string $obj_title, string $obj_description, Component $icon, array $content, string $obj_rating_html='')
 

Data Fields

const LEARNING_MAP_LABEL = 'learning_map'
 

Protected Attributes

MetaContent $layout_meta_content
 
Factory $ui_factory
 
Renderer $ui_renderer
 
ilLanguage $lng
 
ilTemplate $tpl
 
ilLSTOCGUI $toc_gui
 
ilLSLocatorGUI $loc_gui
 
string $window_base_title
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilKioskPageRenderer::__construct ( MetaContent  $layout_meta_content,
Factory  $ui_factory,
Renderer  $ui_renderer,
ilLanguage  $lng,
ilTemplate  $kiosk_template,
ilLSTOCGUI  $toc_gui,
ilLSLocatorGUI  $loc_gui,
string  $window_base_title 
)

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

52 {
53 $this->layout_meta_content = $layout_meta_content;
54 $this->ui_factory = $ui_factory;
55 $this->ui_renderer = $ui_renderer;
56 $this->lng = $lng;
57 $this->tpl = $kiosk_template;
58 $this->toc_gui = $toc_gui;
59 $this->loc_gui = $loc_gui;
60 $this->window_base_title = $window_base_title;
61 }

References $layout_meta_content, $lng, $loc_gui, $toc_gui, $ui_factory, $ui_renderer, $window_base_title, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Member Function Documentation

◆ addCss()

ilKioskPageRenderer::addCss ( string  $path)

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

116 : void
117 {
118 $this->layout_meta_content->addCss($path);
119 }

◆ addJs()

ilKioskPageRenderer::addJs ( string  $path,
bool  $add_version_number = false,
int  $batch = 2 
)

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

111 : void
112 {
113 $this->layout_meta_content->addJs($path, $add_version_number, $batch);
114 }

◆ addOnLoadCode()

ilKioskPageRenderer::addOnLoadCode ( string  $code,
int  $batch = 2 
)

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

106 : void
107 {
108 $this->layout_meta_content->addOnloadCode($code, $batch);
109 }

◆ buildLearningMapEntry()

ilKioskPageRenderer::buildLearningMapEntry ( string  $map_html)

The learning map entry of the main bar.

There used to be a slate here (holding the curriculum); now the entry is a plain button that opens the map in a modal - the modal has to be rendered along with the page.

Returns
array{0: Bulky, 1: RoundTrip} the main bar entry and its modal

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

70 : array
71 {
73 // one single modal for both operation modes: its size is set by the
74 // script of the map, which measures the map and writes the measures
75 // onto the dialog element (see sizeModal() in lso_learning_map.js).
76 // The wrapper is only the marker the script and the css look for.
77 $modal = $f->modal()->roundtrip(
78 $this->lng->txt(self::LEARNING_MAP_LABEL),
79 [
80 $f->legacy()->content(
81 '<div class="lso-learning-map-modal">' . $map_html . '</div>'
82 )
83 ]
84 );
85 $button = $f->button()->bulky(
86 $f->symbol()->icon()->standard('lso', $this->lng->txt(self::LEARNING_MAP_LABEL)),
87 $this->lng->txt(self::LEARNING_MAP_LABEL),
88 '#'
89 )->withOnClick($modal->getShowSignal());
90
91 return [$button, $modal];
92 }

References Vendor\Package\$f, $ui_factory, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ buildToCSlate()

ilKioskPageRenderer::buildToCSlate ( LSTOCBuilder  $toc,
Icon  $icon 
)

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

94 : Slate
95 {
96 $html = $this->toc_gui
97 ->withStructure($toc->toJSON())
98 ->getHTML();
99 return $this->ui_factory->maincontrols()->slate()->legacy(
100 $this->lng->txt('lso_mainbar_button_label_toc'),
101 $icon->withSize("small"),
102 $this->ui_factory->legacy()->content($html)
103 );
104 }
withSize(string $size)
Set the size for this icon.

References ILIAS\Repository\lng(), LSTOCBuilder\toJSON(), and ILIAS\UI\Component\Symbol\Icon\Icon\withSize().

+ Here is the call graph for this function:

◆ render()

ilKioskPageRenderer::render ( LSControlBuilder  $control_builder,
string  $obj_title,
string  $obj_description,
Component  $icon,
array  $content,
string  $obj_rating_html = '' 
)

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

128 : string {
129 $this->tpl->setVariable(
130 "OBJECT_ICON",
131 $this->ui_renderer->render($icon)
132 );
133 $this->tpl->setVariable("OBJECT_TITLE", $obj_title);
134
135 $obj_description = trim($obj_description);
136 if ($obj_description !== '') {
137 $this->tpl->setCurrentBlock('obj_desc');
138 $this->tpl->setVariable(
139 'OBJECT_DESCRIPTION',
140 nl2br($obj_description)
141 );
142 $this->tpl->parseCurrentBlock();
143 }
144 $this->tpl->setVariable('OBJECT_RATING', $obj_rating_html);
145
146 $this->tpl->setVariable(
147 "PLAYER_NAVIGATION",
148 $this->ui_renderer->render(array_values(array_filter([
149 $control_builder->getPreviousControl(),
150 $control_builder->getNextControl()
151 ])))
152 );
153
154 $controls = $control_builder->getControls();
155
156 //ensure done control is first element
157 if ($control_builder->getDoneControl()) {
158 array_unshift($controls, $control_builder->getDoneControl());
159 }
160 //also shift start control up front - this is for legacy-views only!
161 if ($control_builder->getStartControl()) {
162 array_unshift($controls, $control_builder->getStartControl());
163 $this->tpl->setVariable("JS_INLINE", $control_builder->getAdditionalJS());
164 }
165
166 //TODO: insert toggles
167
168 $this->tpl->setVariable(
169 "OBJ_NAVIGATION",
170 $this->ui_renderer->render($controls)
171 );
172
173
174 $this->tpl->setVariable(
175 "VIEW_MODES",
176 $this->ui_renderer->render($control_builder->getModeControls())
177 );
178
179 if ($control_builder->getLocator()) {
180 $this->tpl->setVariable(
181 'LOCATOR',
182 $this->ui_renderer->render(
183 $this->loc_gui
184 ->withItems($control_builder->getLocator()->getItems())
185 ->getComponent()
186 )
187 );
188 }
189
190 $this->tpl->setVariable(
191 'CONTENT',
192 $this->ui_renderer->render($content)
193 );
194
195 return $this->tpl->get();
196 }

Field Documentation

◆ $layout_meta_content

MetaContent ilKioskPageRenderer::$layout_meta_content
protected

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

Referenced by __construct().

◆ $lng

ilLanguage ilKioskPageRenderer::$lng
protected

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

Referenced by __construct().

◆ $loc_gui

ilLSLocatorGUI ilKioskPageRenderer::$loc_gui
protected

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

Referenced by __construct().

◆ $toc_gui

ilLSTOCGUI ilKioskPageRenderer::$toc_gui
protected

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

Referenced by __construct().

◆ $tpl

ilTemplate ilKioskPageRenderer::$tpl
protected

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

◆ $ui_factory

Factory ilKioskPageRenderer::$ui_factory
protected

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

Referenced by __construct(), and buildLearningMapEntry().

◆ $ui_renderer

Renderer ilKioskPageRenderer::$ui_renderer
protected

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

Referenced by __construct().

◆ $window_base_title

string ilKioskPageRenderer::$window_base_title
protected

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

Referenced by __construct().

◆ LEARNING_MAP_LABEL

const ilKioskPageRenderer::LEARNING_MAP_LABEL = 'learning_map'

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


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