75 $this->lm_tree =
$service->getLMTree();
76 $this->lang =
$service->getPresentationStatus()->getLang();
77 $this->ot = $translation;
78 $this->current_page =
$service->getNavigationStatus()->getCurrentPage();
79 $this->lm =
$service->getLearningModule();
80 $this->lm_set =
$service->getSettings();
82 $this->offline =
$service->getPresentationStatus()->offline;
83 $this->tracker =
$service->getTracker();
84 $this->linker =
$service->getLinker();
86 $this->chapter_has_no_active_page =
$service->getNavigationStatus()->isChapterWithoutActivePage();
87 $this->deactivated_page =
$service->getNavigationStatus()->isDeactivatedPage();
88 $this->focus_id =
$service->getPresentationStatus()->getFocusId();
89 $this->concrete_lang =
$service->getPresentationStatus()->getConcreteLang();
90 $this->search_string =
$service->getPresentationStatus()->getSearchString();
92 $this->requested_focus_return =
$service->getPresentationStatus()->getFocusReturn();
93 $this->requested_frame =
$service->getRequest()->getFrame();
94 $this->navigation_status =
$service->getNavigationStatus();
101 $ilHelp->setScreenId(
"content");
102 $ilHelp->setSubScreenId(
"content");
112 if ($requested_page_lm != $this->lm->getId()) {
118 $this->access->checkAccess(
"write",
"", $this->lm->getRefId())) {
124 if (!$this->offline) {
125 if ($this->lm->getRestrictForwardNavigation()) {
126 if ($this->tracker->hasPredIncorrectAnswers($this->current_page)) {
133 if ($this->chapter_has_no_active_page &&
138 if ($this->deactivated_page) {
142 if ($this->current_page == 0) {
152 if ($this->search_string !=
"" && !$this->offline) {
165 $words = $p->getQuotedWords();
166 if (is_array($words)) {
167 foreach ($words as $w) {
168 ilTextHighlighterGUI::highlight(
"ilLMPageContent", $w);
175 int $a_head_foot_page_id = 0
177 $ilUser = $this->
user;
207 if ($a_head_foot_page_id == 0) {
211 $page_id = $a_head_foot_page_id;
219 $this->parent_gui->basicPageGuiInit($page_object_gui);
221 $page_object = $page_object_gui->getPageObject();
222 $page_object->buildDom();
223 $page_object->registerOfflineHandler($this);
225 $page_object_gui->setTemplateOutput(
false);
231 $page_object_gui->setPageLinker($this->linker);
235 $lm_pg_obj->setLMId($this->lm->getId());
238 $page_object_gui->setLinkFrame($this->requested_frame);
241 if ($page_id == 0 || ($page_id != $this->lm->getHeaderPage() &&
242 $page_id != $this->lm->getFooterPage())) {
243 $page_object_gui->setPresentationTitle(
246 $this->lm->getPageHeader(),
247 $this->lm->isActiveNumbering(),
248 (
bool) $this->lm_set->get(
"time_scheduled_page_activation"),
256 if ($page_id != 0 && !$this->offline) {
257 $this->tracker->trackAccess($page_id, $ilUser->getId());
260 $page_object_gui->setEnabledPageFocus(
false);
261 $page_object_gui->getPageConfig()->setEnableSelfAssessment(
false);
265 $page_object_gui->setLinkParams(
"ref_id=" . $this->lm->getRefId());
266 $page_object_gui->setTemplateTargetVar(
"PAGE_CONTENT");
270 $ret = $page_object_gui->presentation($page_object_gui->getOutputMode());
273 if ($this->lm->getHeaderPage() > 0 &&
274 $page_id != $this->lm->getHeaderPage() &&
275 ($page_id == 0 || $page_id != $this->lm->getFooterPage())) {
277 $head = $this->
render($this->lm->getHeaderPage());
282 if ($this->lm->getFooterPage() > 0 &&
283 $page_id != $this->lm->getFooterPage() &&
284 ($page_id == 0 || $page_id != $this->lm->getHeaderPage())) {
286 $foot = $this->
render($this->lm->getFooterPage());
289 return $head . $focus_mess . $ret . $foot;
295 $page_gui =
new ilLMPageGUI($a_id, 0,
false, $this->lang, $this->concrete_lang);
298 $page_gui =
new ilLMPageGUI($a_id, 0,
false, $this->ot->getDefaultLanguage(), $this->concrete_lang);
300 $page_gui =
new ilLMPageGUI($a_id, 0,
false,
"", $this->concrete_lang);
303 if ($this->offline) {
315 $directory = $this->parent_gui->getOfflineDirectory() .
"/codefiles/" . $page_id .
"/" . $paragraph_id;
317 $file = $directory .
"/" . $title;
318 if (!($fp = fopen($file,
"w+"))) {
319 die(
"<strong>Error</strong>: Could not open \"" . $file .
"\" for writing" .
320 " in <strong>" . __FILE__ .
"</strong> on line <strong>" . __LINE__ .
"</strong><br />");
330 if ($this->focus_id > 0) {
331 $path = $this->lm_tree->getPathId($this->current_page);
334 if (!in_array($this->focus_id,
$path)) {
336 "tpl.out_of_focus_message.html",
339 "components/ILIAS/LearningModule"
341 $mtpl->setVariable(
"MESSAGE", $this->
lng->txt(
"cont_out_of_focus_message"));
342 $mtpl->setVariable(
"TXT_SHOW_CONTENT", $this->
lng->txt(
"cont_show_content_after_focus"));
344 if ($this->requested_focus_return == 0 ||
ilObject::_lookupType((
int) $this->requested_focus_return,
true) !=
"crs") {
345 $mtpl->setVariable(
"TXT_BACK_BEGINNING", $this->
lng->txt(
"cont_to_focus_beginning"));
346 $this->
ctrl->setParameter($this->parent_gui,
"obj_id", $this->focus_id);
347 $mtpl->setVariable(
"LINK_BACK_TO_BEGINNING", $this->
ctrl->getLinkTarget($this->parent_gui,
"layout"));
348 $this->
ctrl->setParameter($this->parent_gui,
"obj_id", $this->requested_obj_id);
350 $mtpl->setVariable(
"TXT_BACK_BEGINNING", $this->
lng->txt(
"cont_to_focus_return_crs"));
351 $mtpl->setVariable(
"LINK_BACK_TO_BEGINNING", ilLink::_getLink($this->requested_focus_return));
354 $this->
ctrl->setParameter($this->parent_gui,
"focus_id",
null);
355 $mtpl->setVariable(
"LINK_SHOW_CONTENT", $this->
ctrl->getLinkTarget($this->parent_gui,
"layout"));
356 $this->
ctrl->setParameter($this->parent_gui,
"focus_id", $this->requested_obj_id);
358 $focus_mess = $mtpl->get();
360 $succ_page_id = $this->navigation_status->getSuccessorPageId();
362 if ($succ_page_id > 0) {
363 $path2 = $this->lm_tree->getPathId($succ_page_id);
365 if ($succ_page_id == 0 || !in_array($this->focus_id, $path2)) {
367 "tpl.out_of_focus_message.html",
370 "components/ILIAS/LearningModule"
372 $mtpl->setVariable(
"MESSAGE", $this->
lng->txt(
"cont_out_of_focus_message_last_page"));
373 $mtpl->setVariable(
"TXT_SHOW_CONTENT", $this->
lng->txt(
"cont_show_content_after_focus"));
375 if ($this->requested_focus_return == 0 ||
ilObject::_lookupType($this->requested_focus_return,
true) !=
"crs") {
376 $mtpl->setVariable(
"TXT_BACK_BEGINNING", $this->
lng->txt(
"cont_to_focus_beginning"));
377 $this->
ctrl->setParameter($this->parent_gui,
"obj_id", $this->focus_id);
378 $mtpl->setVariable(
"LINK_BACK_TO_BEGINNING", $this->
ctrl->getLinkTarget($this->parent_gui,
"layout"));
379 $this->
ctrl->setParameter($this->parent_gui,
"obj_id", $this->requested_obj_id);
381 $mtpl->setVariable(
"TXT_BACK_BEGINNING", $this->
lng->txt(
"cont_to_focus_return_crs"));
382 $mtpl->setVariable(
"LINK_BACK_TO_BEGINNING", ilLink::_getLink($this->requested_focus_return));
385 $this->
ctrl->setParameter($this->parent_gui,
"focus_id",
null);
386 $mtpl->setVariable(
"LINK_SHOW_CONTENT", $this->
ctrl->getLinkTarget($this->parent_gui,
"layout"));
387 $this->
ctrl->setParameter($this->parent_gui,
"focus_id", $this->requested_obj_id);
389 $focus_mess = $mtpl->get();
402 return $this->renderMessageScreen($this->
lng->txt(
"msg_no_page_access"));
411 $tpl =
new ilTemplate(
"tpl.page_message_screen.html",
true,
true,
"components/ILIAS/LearningModule");
412 $tpl->setVariable(
"TXT_PAGE_NO_PUBLIC_ACCESS", $a_content);
422 return $this->renderMessageScreen($this->
lng->txt(
"msg_page_no_public_access"));
431 return $this->renderMessageScreen($this->
lng->txt(
"cont_no_page_access_unansw_q"));
440 "tpl.no_content_message.html",
443 "components/ILIAS/LearningModule"
445 $mtpl->setVariable(
"MESSAGE", $this->
lng->txt(
"cont_no_page_in_chapter"));
458 return $this->renderMessageScreen($this->
lng->txt(
"cont_no_page"));
464 "tpl.no_content_message.html",
467 "components/ILIAS/LearningModule"
469 $m = $this->
lng->txt(
"cont_page_currently_deactivated");
471 if ($act_data[
"show_activation_info"] &&
473 $m .=
"<p>" . sprintf(
474 $this->
lng->txt(
"cont_page_activation_on"),
481 $mtpl->setVariable(
"MESSAGE", $m);
499 $ptpl =
new ilTemplate(
"tpl.page_preconditions.html",
true,
true,
"components/ILIAS/LearningModule");
502 foreach ($conds as $cond) {
503 $obj_link = ilLink::_getLink($cond[
"trigger_ref_id"]);
504 $ptpl->setCurrentBlock(
"condition");
506 $ptpl->setVariable(
"LINK_ITEM", $obj_link);
507 if ($cond[
"operator"] ==
"passed") {
508 $cond_str = $this->
lng->txt(
"passed");
510 $cond_str = $this->
lng->txt(
"condition_" . $cond[
"operator"]);
512 $ptpl->setVariable(
"VAL_CONDITION", $cond_str .
" " . $cond[
"value"]);
513 $ptpl->parseCurrentBlock();
517 "TXT_MISSING_PRECONDITIONS",
519 $this->
lng->txt(
"cont_missing_preconditions"),
523 $ptpl->setVariable(
"TXT_ITEM", $this->
lng->txt(
"object"));
524 $ptpl->setVariable(
"TXT_CONDITION", $this->
lng->txt(
"condition"));
527 $parent = $this->lm_tree->getParentId($topchap);
528 $childs = $this->lm_tree->getChildsByType($parent,
"st");
531 foreach ($childs as $child) {
532 if ($child[
"child"] == $topchap) {
535 if ($i++ == ($j + 1)) {
536 $succ_node = $this->lm_tree->fetchSuccessorNode($child[
"child"],
"pg");
539 if ($succ_node !=
"") {
540 $link =
"<br /><a href=\"" .
541 $this->linker->getLink(
"layout", $succ_node[
"obj_id"], $this->requested_frame) .
542 "\">" . $this->
lng->txt(
"cont_skip_chapter") .
"</a>";
543 $ptpl->setVariable(
"LINK_SKIP_CHAPTER", $link);
Class handles translation mode for an object.
static _updateLastAccess(int $a_user_id, int $a_lm_ref_id, int $a_page_id)
Class ilCtrl provides processing control methods.
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
setScreenIdComponent(string $a_comp)
int $requested_focus_return
renderMessageScreen(string $a_content)
Render message screen.
renderNavRestrictionDueToQuestions()
Render message if navigation to page is not allowed due to unanswered questions.
renderNoPageFoundMessage()
Render no page found message.
__construct(ilLMPresentationService $service, ilLMPresentationGUI $parent_gui, ilLanguage $lng, Translations $translation, ilCtrl $ctrl, ilAccessHandler $access, ilObjUser $user, ilHelpGUI $help, int $requested_obj_id)
const STATUS_FAILED_PRECONDITIONS
const STATUS_DEACTIVATED_PAGE
const STATUS_NO_PUBLIC_ACCESS
renderNoPageInChapterMessage()
Render no page in chapter message.
const STATUS_NO_PAGE_IN_CHAPTER
const STATUS_CORRECT_ANSWER_MISSING
ilLMPresentationGUI $parent_gui
ilLMPresentationLinker $linker
ilLMNavigationStatus $navigation_status
const STATUS_NO_PAGE_FOUND
renderPreconditionsOfPage()
Render preconditions of the page.
renderNoPublicAccess()
Render info message, if page is not accessible in public area.
render(int $a_head_foot_page_id=0)
renderNoPageAccess()
Render info message, if page is not accessible in public area.
bool $chapter_has_no_active_page
handleCodeParagraph(int $page_id, int $paragraph_id, string $title, string $text)
renderDeactivatedPageMessage()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _exists(int $a_id)
checks wether a lm content object with specified id exists or not
static _lookupTitle(int $a_obj_id)
static _lookupType(int $a_obj_id, int $a_lm_id=0)
Extension of ilPageObjectGUI for learning modules.
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 _getMissingPreconditionsTopChapter(int $cont_obj_ref_id, int $cont_obj_id, int $page_id)
get top chapter of page for that any precondition is missing
static _checkPreconditionsOfPage(int $cont_ref_id, int $cont_obj_id, int $page_id)
checks whether the preconditions of a page are fulfilled or not
static _getMissingPreconditionsOfPage(int $cont_ref_id, int $cont_obj_id, int $page_id)
gets all missing preconditions of page
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupType(int $id, bool $reference=false)
static _lookupTitle(int $obj_id)
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
static _lookupActivationData(int $a_id, string $a_parent_type, string $a_lang="-")
Lookup activation data.
static lookupParentId(int $a_id, string $a_type)
special template class to simplify handling of ITX/PEAR
static _getInstance(int $a_usr_id)
static now()
Return current timestamp in Y-m-d H:i:s format.
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...