25 protected \ILIAS\DI\UIServices
$ui;
60 $this->lm_tree =
$service->getLMTree();
61 $this->current_page =
$service->getNavigationStatus()->getCurrentPage();
62 $this->lm =
$service->getLearningModule();
63 $this->lm_set =
$service->getSettings();
65 $this->offline =
$service->getPresentationStatus()->offline();
66 $this->tracker =
$service->getTracker();
68 $this->chapter_has_no_active_page =
$service->getNavigationStatus()->isChapterWithoutActivePage();
69 $this->deactivated_page =
$service->getNavigationStatus()->isDeactivatedPage();
70 $this->linker =
$service->getLinker();
71 $this->navigation_status =
$service->getNavigationStatus();
74 $this->requested_back_pg = (
int) $back_pg[0];
77 $this->lang =
$service->getPresentationStatus()->getLang();
87 return $this->
render(
false);
90 protected function render(
bool $top =
true): string
92 $this->
toolbar->setStickyItems([]);
96 $tpl =
new ilTemplate(
"tpl.lm_navigation.html",
true,
true,
"components/ILIAS/LearningModule/Presentation");
98 if (empty($page_id)) {
103 $back_pg = $this->navigation_status->getBackPageId();
106 $this->linker->getLink(
115 $tpl->setCurrentBlock(
"ilLMNavigation_Prev");
116 $tpl->setVariable(
"IMG_PREV", $back_img);
117 $tpl->setVariable(
"HREF_PREV", $back_href);
118 $tpl->setVariable(
"TXT_PREV", $this->
lng->txt(
"back"));
119 $tpl->setVariable(
"ALT_PREV", $this->
lng->txt(
"back"));
120 $tpl->setVariable(
"SPACER_PREV", $this->offline
121 ?
"images/media/spacer.png"
123 $tpl->parseCurrentBlock();
125 $b = $this->
ui->factory()->button()->standard(
126 "<span class=\"glyphicon glyphicon-chevron-left \" aria-hidden=\"true\"></span>",
132 $pre_id = $this->navigation_status->getPredecessorPageId();
137 $this->lm->getPageHeader(),
138 $this->lm->isActiveNumbering(),
139 (
bool) $this->lm_set->get(
"time_scheduled_page_activation"),
149 if (!$this->lm->cleanFrames()) {
151 $this->linker->getLink(
154 $this->requested_frame
158 if (!$this->offline) {
160 $this->linker->getLink(
"layout", $pre_id);
163 $this->linker->getLink(
"layout", $pre_id);
167 $tpl->setCurrentBlock(
"ilLMNavigation_Prev");
168 $tpl->setVariable(
"IMG_PREV", $prev_img);
169 $tpl->setVariable(
"HREF_PREV", $prev_href);
170 $tpl->setVariable(
"TXT_PREV", $prev_title);
171 $tpl->setVariable(
"ALT_PREV", $this->
lng->txt(
"previous"));
172 $tpl->setVariable(
"SPACER_PREV", $this->offline
173 ?
"images/media/spacer.png"
177 $b = $this->
ui->factory()->button()->standard(
178 "<span class=\"glyphicon glyphicon-chevron-left \" aria-hidden=\"true\"></span>",
185 $b = $this->
ui->factory()->button()->standard(
186 "<span class=\"glyphicon glyphicon-chevron-left \" aria-hidden=\"true\"></span>",
188 )->withUnavailableAction();
195 $succ_id = $this->navigation_status->getSuccessorPageId();
200 $this->lm->getPageHeader(),
201 $this->lm->isActiveNumbering(),
202 (
bool) $this->lm_set->get(
"time_scheduled_page_activation"),
211 if (!$this->lm->cleanFrames()) {
213 $this->linker->getLink(
216 $this->requested_frame
220 if (!$this->offline) {
222 $this->linker->getLink(
"layout", $succ_id);
225 $this->linker->getLink(
"layout", $succ_id);
229 $tpl->setCurrentBlock(
"ilLMNavigation_Next");
230 $tpl->setVariable(
"IMG_SUCC", $succ_img);
231 $tpl->setVariable(
"HREF_SUCC", $succ_href);
232 $tpl->setVariable(
"TXT_SUCC", $succ_title);
233 $tpl->setVariable(
"ALT_SUCC", $this->
lng->txt(
"next"));
234 $tpl->setVariable(
"SPACER_SUCC", $this->offline
235 ?
"images/media/spacer.png"
237 $tpl->parseCurrentBlock();
240 if (!$this->offline) {
241 if ($this->lm->getRestrictForwardNavigation()) {
242 if ($this->tracker->hasPredIncorrectAnswers($succ_id)) {
243 $this->main_tpl->addOnLoadCode(
"il.LearningModule.hideNextNavigation();");
248 $b = $this->
ui->factory()->button()->standard(
249 "<span class=\"glyphicon glyphicon-chevron-right \" aria-hidden=\"true\"></span>",
256 $b = $this->
ui->factory()->button()->standard(
257 "<span class=\"glyphicon glyphicon-chevron-right \" aria-hidden=\"true\"></span>",
259 )->withUnavailableAction();
264 $tpl->setVariable(
"CLASS", ($top) ?
"tnav_Top" :
"bnav_Bottom");
271 $nodes = $this->lm_tree->getSubTree($this->lm_tree->getNodeData($this->lm_tree->getRootId()));
276 foreach ($nodes as $node) {
282 $this->lm->getType(),
283 (
bool) $this->lm_set->get(
"time_scheduled_page_activation")
286 if ($node[
"type"] ===
"pg" &&
294 switch ($node[
"type"]) {
297 if ($this->lm->getTOCMode() !==
"pages") {
303 $this->lm->getPageHeader(),
304 $this->lm->isActiveNumbering(),
305 (
bool) $this->lm_set->get(
"time_scheduled_page_activation"),
325 $this->lm->isActiveNumbering(),
326 (
bool) $this->lm_set->get(
"time_scheduled_page_activation"),
336 $this->lm->getRefId(),
341 $text .=
" (" . $this->
lng->txt(
"cont_no_access") .
")";
344 $href = $this->linker->getLink(
"layout", $node[
"obj_id"]);
347 if ($this->lm->getTOCMode() ===
"pages" && $this->current_page == $node[
"obj_id"]) {
350 if ($this->lm->getTOCMode() !==
"pages") {
351 if ($this->lm_tree->getParentId($this->current_page) == $node[
"obj_id"]) {
355 $text = str_pad(
"", ($node[
"depth"] - 1) * 12,
" ") .
$text;
356 $button = $this->
ui->factory()->button()->shy(
361 $button = $button->withUnavailableAction();
363 $actions[] = $button;
368 if ($this->lm->getTOCMode() ===
"pages") {
371 $this->lm->getPageHeader(),
372 $this->lm->isActiveNumbering(),
373 (
bool) $this->lm_set->get(
"time_scheduled_page_activation"),
380 $st_id = $this->lm_tree->getParentId($this->current_page);
385 $this->lm->isActiveNumbering(),
386 (
bool) $this->lm_set->get(
"time_scheduled_page_activation"),
395 $title =
"<span style='vertical-align: bottom; max-width:60px; display: inline-block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;'>" . $title .
"</span>";
398 $this->
ui->factory()->dropdown()->standard($actions)->withLabel($title)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilGlobalTemplateInterface $main_tpl
ilLMPresentationGUI $parent_gui
ilLMNavigationStatus $navigation_status
ilLMPresentationLinker $linker
__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)
bool $chapter_has_no_active_page
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...
Class ilLMPresentationGUI GUI class for learning module presentation.
Learning module presentation linker.
Main service init and factory.
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...
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...
static _lookupActive(int $a_id, string $a_parent_type, bool $a_check_scheduled_activation=false, string $a_lang="-")
lookup activation status
static shortenTextExtended(string $a_str, int $a_len, bool $a_dots=false, bool $a_next_blank=false, bool $a_keep_extension=false)
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)
special template class to simplify handling of ITX/PEAR
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.