25 protected \ILIAS\DI\UIServices
$ui;
51 int $requested_obj_id,
52 string $requested_back_pg,
53 string $requested_frame,
68 $this->chapter_has_no_active_page = $service->
getNavigationStatus()->isChapterWithoutActivePage();
73 $back_pg = explode(
":", $requested_back_pg);
74 $this->requested_back_pg = (
int) $back_pg[0];
87 return $this->
render(
false);
90 protected function render(
bool $top =
true): string
94 $tpl =
new ilTemplate(
"tpl.lm_navigation.html",
true,
true,
"components/ILIAS/LearningModule/Presentation");
96 if (empty($page_id)) {
101 $back_pg = $this->navigation_status->getBackPageId();
104 $this->linker->getLink(
113 $tpl->setCurrentBlock(
"ilLMNavigation_Prev");
114 $tpl->setVariable(
"IMG_PREV", $back_img);
115 $tpl->setVariable(
"HREF_PREV", $back_href);
116 $tpl->setVariable(
"TXT_PREV", $this->
lng->txt(
"back"));
117 $tpl->setVariable(
"ALT_PREV", $this->
lng->txt(
"back"));
118 $tpl->setVariable(
"SPACER_PREV", $this->offline
119 ?
"images/media/spacer.png" 121 $tpl->parseCurrentBlock();
123 $b = $this->
ui->factory()->button()->standard(
124 "<span class=\"glyphicon glyphicon-chevron-left \" aria-hidden=\"true\"></span>",
130 $pre_id = $this->navigation_status->getPredecessorPageId();
135 $this->lm->getPageHeader(),
136 $this->lm->isActiveNumbering(),
137 (bool) $this->lm_set->get(
"time_scheduled_page_activation"),
147 if (!$this->lm->cleanFrames()) {
149 $this->linker->getLink(
152 $this->requested_frame
156 if (!$this->offline) {
158 $this->linker->getLink(
"layout", $pre_id);
161 $this->linker->getLink(
"layout", $pre_id);
165 $tpl->setCurrentBlock(
"ilLMNavigation_Prev");
166 $tpl->setVariable(
"IMG_PREV", $prev_img);
167 $tpl->setVariable(
"HREF_PREV", $prev_href);
168 $tpl->setVariable(
"TXT_PREV", $prev_title);
169 $tpl->setVariable(
"ALT_PREV", $this->
lng->txt(
"previous"));
170 $tpl->setVariable(
"SPACER_PREV", $this->offline
171 ?
"images/media/spacer.png" 175 $b = $this->
ui->factory()->button()->standard(
176 "<span class=\"glyphicon glyphicon-chevron-left \" aria-hidden=\"true\"></span>",
183 $b = $this->
ui->factory()->button()->standard(
184 "<span class=\"glyphicon glyphicon-chevron-left \" aria-hidden=\"true\"></span>",
186 )->withUnavailableAction();
193 $succ_id = $this->navigation_status->getSuccessorPageId();
198 $this->lm->getPageHeader(),
199 $this->lm->isActiveNumbering(),
200 (bool) $this->lm_set->get(
"time_scheduled_page_activation"),
209 if (!$this->lm->cleanFrames()) {
211 $this->linker->getLink(
214 $this->requested_frame
218 if (!$this->offline) {
220 $this->linker->getLink(
"layout", $succ_id);
223 $this->linker->getLink(
"layout", $succ_id);
227 $tpl->setCurrentBlock(
"ilLMNavigation_Next");
228 $tpl->setVariable(
"IMG_SUCC", $succ_img);
229 $tpl->setVariable(
"HREF_SUCC", $succ_href);
230 $tpl->setVariable(
"TXT_SUCC", $succ_title);
231 $tpl->setVariable(
"ALT_SUCC", $this->
lng->txt(
"next"));
232 $tpl->setVariable(
"SPACER_SUCC", $this->offline
233 ?
"images/media/spacer.png" 235 $tpl->parseCurrentBlock();
238 if (!$this->offline) {
239 if ($this->lm->getRestrictForwardNavigation()) {
240 if ($this->tracker->hasPredIncorrectAnswers($succ_id)) {
241 $this->main_tpl->addOnLoadCode(
"il.LearningModule.hideNextNavigation();");
246 $b = $this->
ui->factory()->button()->standard(
247 "<span class=\"glyphicon glyphicon-chevron-right \" aria-hidden=\"true\"></span>",
254 $b = $this->
ui->factory()->button()->standard(
255 "<span class=\"glyphicon glyphicon-chevron-right \" aria-hidden=\"true\"></span>",
257 )->withUnavailableAction();
262 $tpl->setVariable(
"CLASS", ($top) ?
"tnav_Top" :
"bnav_Bottom");
269 $nodes = $this->lm_tree->getSubTree($this->lm_tree->getNodeData($this->lm_tree->getRootId()));
272 foreach ($nodes as $node) {
278 $this->lm->getType(),
279 (bool) $this->lm_set->get(
"time_scheduled_page_activation")
282 if ($node[
"type"] ===
"pg" &&
290 switch ($node[
"type"]) {
293 if ($this->lm->getTOCMode() !==
"pages") {
299 $this->lm->getPageHeader(),
300 $this->lm->isActiveNumbering(),
301 (bool) $this->lm_set->get(
"time_scheduled_page_activation"),
321 $this->lm->isActiveNumbering(),
322 (bool) $this->lm_set->get(
"time_scheduled_page_activation"),
332 $this->lm->getRefId(),
337 $text .=
" (" . $this->
lng->txt(
"cont_no_access") .
")";
340 $href = $this->linker->getLink(
"layout", $node[
"obj_id"]);
343 if ($this->lm->getTOCMode() ===
"pages" && $this->current_page == $node[
"obj_id"]) {
344 $text =
"» " . $text;
346 if ($this->lm->getTOCMode() !==
"pages") {
347 if ($this->lm_tree->getParentId($this->current_page) == $node[
"obj_id"]) {
348 $text =
"» " . $text;
351 $text = str_pad(
"", ($node[
"depth"] - 1) * 12,
" ") . $text;
352 $actions[] = $this->
ui->factory()->button()->shy(
359 if ($this->lm->getTOCMode() ===
"pages") {
362 $this->lm->getPageHeader(),
363 $this->lm->isActiveNumbering(),
364 (bool) $this->lm_set->get(
"time_scheduled_page_activation"),
371 $st_id = $this->lm_tree->getParentId($this->current_page);
376 $this->lm->isActiveNumbering(),
377 (bool) $this->lm_set->get(
"time_scheduled_page_activation"),
386 $title =
"<span style='vertical-align: bottom; max-width:60px; display: inline-block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;'>" . $title .
"</span>";
390 $this->
ui->factory()->dropdown()->standard($actions)->withLabel($title)
static _lookupActive(int $a_id, string $a_parent_type, bool $a_check_scheduled_activation=false, string $a_lang="-")
lookup activation status
static _getPresentationTitle(int $a_st_id, string $a_mode=self::CHAPTER_TITLE, bool $a_include_numbers=false, bool $a_time_scheduled_activation=false, bool $a_force_content=false, int $a_lm_id=0, string $a_lang="-", bool $a_include_short=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface Observer Contains several chained tasks and infos about them.
ilLMPresentationGUI $parent_gui
__construct(ilLMPresentationService $service, ilLMPresentationGUI $parent_gui, ilLanguage $lng, ilObjUser $user, ilGlobalTemplateInterface $main_tpl, int $requested_obj_id, string $requested_back_pg, string $requested_frame, ilToolbarGUI $toolbar, \ILIAS\DI\UIServices $ui)
ilLMNavigationStatus $navigation_status
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
bool $chapter_has_no_active_page
static _checkPreconditionsOfPage(int $cont_ref_id, int $cont_obj_id, int $page_id)
checks whether the preconditions of a page are fulfilled or not
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilGlobalTemplateInterface $main_tpl
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
getSettings()
Get learning module settings.
static _getPresentationTitle(int $a_pg_id, string $a_mode=self::CHAPTER_TITLE, bool $a_include_numbers=false, bool $a_time_scheduled_activation=false, bool $a_force_content=false, int $a_lm_id=0, string $a_lang="-", bool $a_include_short=false)
presentation title doesn't have to be page title, it may be chapter title + page title or chapter tit...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static shortenTextExtended(string $a_str, int $a_len, bool $a_dots=false, bool $a_next_blank=false, bool $a_keep_extension=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilLMPresentationLinker $linker
Main service init and factory.