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,
"Modules/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);
162 $this->linker->getLink(
"layout", $pre_id);
163 $prev_target =
'target="_top" ';
167 $tpl->setCurrentBlock(
"ilLMNavigation_Prev");
168 $tpl->setVariable(
"IMG_PREV", $prev_img);
169 $tpl->setVariable(
"HREF_PREV", $prev_href);
170 $tpl->setVariable(
"FRAME_PREV", $prev_target);
171 $tpl->setVariable(
"TXT_PREV", $prev_title);
172 $tpl->setVariable(
"ALT_PREV", $this->
lng->txt(
"previous"));
173 $tpl->setVariable(
"SPACER_PREV", $this->offline
174 ?
"images/media/spacer.png" 178 $b = $this->
ui->factory()->button()->standard(
179 "<span class=\"glyphicon glyphicon-chevron-left \" aria-hidden=\"true\"></span>",
186 $b = $this->
ui->factory()->button()->standard(
187 "<span class=\"glyphicon glyphicon-chevron-left \" aria-hidden=\"true\"></span>",
189 )->withUnavailableAction();
196 $succ_id = $this->navigation_status->getSuccessorPageId();
201 $this->lm->getPageHeader(),
202 $this->lm->isActiveNumbering(),
203 (bool) $this->lm_set->get(
"time_scheduled_page_activation"),
212 if (!$this->lm->cleanFrames()) {
214 $this->linker->getLink(
217 $this->requested_frame
221 if (!$this->offline) {
223 $this->linker->getLink(
"layout", $succ_id);
227 $this->linker->getLink(
"layout", $succ_id);
228 $succ_target =
' target="_top" ';
232 $tpl->setCurrentBlock(
"ilLMNavigation_Next");
233 $tpl->setVariable(
"IMG_SUCC", $succ_img);
234 $tpl->setVariable(
"HREF_SUCC", $succ_href);
235 $tpl->setVariable(
"FRAME_SUCC", $succ_target);
236 $tpl->setVariable(
"TXT_SUCC", $succ_title);
237 $tpl->setVariable(
"ALT_SUCC", $this->
lng->txt(
"next"));
238 $tpl->setVariable(
"SPACER_SUCC", $this->offline
239 ?
"images/media/spacer.png" 241 $tpl->parseCurrentBlock();
244 if (!$this->offline) {
245 if ($this->lm->getRestrictForwardNavigation()) {
246 if ($this->tracker->hasPredIncorrectAnswers($succ_id)) {
247 $this->main_tpl->addOnLoadCode(
"il.LearningModule.hideNextNavigation();");
252 $b = $this->
ui->factory()->button()->standard(
253 "<span class=\"glyphicon glyphicon-chevron-right \" aria-hidden=\"true\"></span>",
260 $b = $this->
ui->factory()->button()->standard(
261 "<span class=\"glyphicon glyphicon-chevron-right \" aria-hidden=\"true\"></span>",
263 )->withUnavailableAction();
268 $tpl->setVariable(
"CLASS", ($top) ?
"tnav_Top" :
"bnav_Bottom");
275 $nodes = $this->lm_tree->getSubTree($this->lm_tree->getNodeData($this->lm_tree->getRootId()));
278 foreach ($nodes as $node) {
284 $this->lm->getType(),
285 (bool) $this->lm_set->get(
"time_scheduled_page_activation")
288 if ($node[
"type"] ===
"pg" &&
296 switch ($node[
"type"]) {
299 if ($this->lm->getTOCMode() !==
"pages") {
305 $this->lm->getPageHeader(),
306 $this->lm->isActiveNumbering(),
307 (bool) $this->lm_set->get(
"time_scheduled_page_activation"),
315 $this->lm->getPublicAccessMode() ===
"selected") {
318 $text .=
" (" . $this->
lng->txt(
"cont_no_access") .
")";
334 $this->lm->isActiveNumbering(),
335 (bool) $this->lm_set->get(
"time_scheduled_page_activation"),
342 $this->lm->getPublicAccessMode() ===
"selected") {
345 $text .=
" (" . $this->
lng->txt(
"cont_no_access") .
")";
352 $this->lm->getRefId(),
357 $text .=
" (" . $this->
lng->txt(
"cont_no_access") .
")";
360 $href = $this->linker->getLink(
"layout", $node[
"obj_id"]);
363 if ($this->lm->getTOCMode() ===
"pages" && $this->current_page == $node[
"obj_id"]) {
364 $text =
"» " . $text;
366 if ($this->lm->getTOCMode() !==
"pages") {
367 if ($this->lm_tree->getParentId($this->current_page) == $node[
"obj_id"]) {
368 $text =
"» " . $text;
371 $text = str_pad(
"", ($node[
"depth"] - 1) * 12,
" ") . $text;
372 $actions[] = $this->
ui->factory()->button()->shy(
379 if ($this->lm->getTOCMode() ===
"pages") {
382 $this->lm->getPageHeader(),
383 $this->lm->isActiveNumbering(),
384 (bool) $this->lm_set->get(
"time_scheduled_page_activation"),
391 $st_id = $this->lm_tree->getParentId($this->current_page);
396 $this->lm->isActiveNumbering(),
397 (bool) $this->lm_set->get(
"time_scheduled_page_activation"),
406 $title =
"<span style='vertical-align: bottom; max-width:60px; display: inline-block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;'>" . $title .
"</span>";
410 $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)
static _isPagePublic(int $a_node_id, bool $a_check_public_mode=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...
Class ChatMainBarProvider .
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
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
getSettings()
Get learning module settings.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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.