ILIAS  release_7 Revision v7.30-3-g800a261c036
ilLMContentRendererGUI Class Reference
+ Collaboration diagram for ilLMContentRendererGUI:

Public Member Functions

 __construct (ilLMPresentationService $service, ilLMPresentationGUI $parent_gui, ilLanguage $lng, ilCtrl $ctrl, ilAccessHandler $access, ilObjUser $user, ilHelpGUI $help, $requested_obj_id)
 Constructor. More...
 
 render ($a_head_foot_page_id=0)
 Render lm content. More...
 
 getLMPageGUI ($a_id)
 Get lm page gui object. More...
 
 renderPreconditionsOfPage ()
 show preconditions of the page More...
 
 getSuccessorPage ()
 Get successor page. More...
 

Data Fields

const STATUS_ACCESS = 0
 
const STATUS_NO_ACCESS = 1
 
const STATUS_NO_PUBLIC_ACCESS = 2
 
const STATUS_FAILED_PRECONDITIONS = 3
 
const STATUS_CORRECT_ANSWER_MISSING = 4
 
const STATUS_NO_PAGE_IN_CHAPTER = 5
 
const STATUS_DEACTIVATED_PAGE = 6
 
const STATUS_NO_PAGE_FOUND = 7
 

Protected Member Functions

 initHelp ()
 Init help. More...
 
 determineStatus ()
 Determine Status (should be factored out later to something like LMPageAccessStatus) More...
 
 initSearchHighlighting ()
 Init search highlighting. More...
 
 renderFocusMessage ()
 Render focus message. More...
 
 renderNoPageAccess ()
 Show info message, if page is not accessible in public area. More...
 
 renderMessageScreen ($a_content)
 Show message screen. More...
 
 renderNoPublicAccess ()
 Show info message, if page is not accessible in public area. More...
 
 renderNavRestrictionDueToQuestions ()
 Show message if navigation to page is not allowed due to unanswered questions. More...
 
 renderNoPageInChapterMessage ()
 Render no page in chapter message. More...
 
 renderNoPageFoundMessage ()
 Render no page found message. More...
 
 renderDeactivatedPageMessage ()
 Render deactivated page message. More...
 

Protected Attributes

 $access
 
 $user
 
 $help
 
 $current_page
 
 $lm
 
 $lng
 
 $offline
 
 $tracker
 
 $ctrl
 
 $lm_tree
 
 $parent_gui
 
 $lm_set
 
 $lang
 
 $linker
 
 $ot
 
 $concrete_lang
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilLMContentRendererGUI::__construct ( ilLMPresentationService  $service,
ilLMPresentationGUI  $parent_gui,
ilLanguage  $lng,
ilCtrl  $ctrl,
ilAccessHandler  $access,
ilObjUser  $user,
ilHelpGUI  $help,
  $requested_obj_id 
)

Constructor.

Definition at line 102 of file class.ilLMContentRendererGUI.php.

111 {
112 global $DIC;
113
114 $this->access = $access;
115 $this->user = $user;
116 $this->help = $help;
117 $this->ctrl = $ctrl;
118 $this->lm_tree = $service->getLMTree();
119 $this->lang = $service->getPresentationStatus()->getLang();
120 $this->current_page = $service->getNavigationStatus()->getCurrentPage();
121 $this->lm = $service->getLearningModule();
122 $this->lm_set = $service->getSettings();
123 $this->lng = $lng;
124 $this->offline = $service->getPresentationStatus()->offline;
125 $this->tracker = $service->getTracker();
126 $this->linker = $service->getLinker();
127 $this->parent_gui = $parent_gui;
128 $this->chapter_has_no_active_page = $service->getNavigationStatus()->isChapterWithoutActivePage();
129 $this->deactivated_page = $service->getNavigationStatus()->isDeactivatedPage();
130 $this->focus_id = $service->getPresentationStatus()->getFocusId();
131 $this->concrete_lang = $service->getPresentationStatus()->getConcreteLang();
132
133 $this->search_string = $service->getPresentationStatus()->getSearchString();
134 $this->requested_obj_id = $requested_obj_id;
135 $this->requested_focus_return = $service->getPresentationStatus()->getFocusReturn();
136
137 $this->ot = ilObjectTranslation::getInstance($this->lm->getId());
138 }
user()
Definition: user.php:4
static getInstance($a_obj_id)
Get instance.
global $DIC
Definition: goto.php:24
help()
Definition: help.php:2
$service
Definition: result.php:17

References $access, $ctrl, $DIC, $help, $lng, $parent_gui, $service, $user, ilObjectTranslation\getInstance(), help(), and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ determineStatus()

ilLMContentRendererGUI::determineStatus ( )
protected

Determine Status (should be factored out later to something like LMPageAccessStatus)

Parameters

return int

Definition at line 157 of file class.ilLMContentRendererGUI.php.

158 {
160
161 $status = self::STATUS_ACCESS;
162
163 // check page id
164 $requested_page_lm = ilLMPage::lookupParentId($this->current_page, "lm");
165 if ($requested_page_lm != $this->lm->getId()) {
166 $status = self::STATUS_NO_ACCESS;
167 }
168
169
170 // check if page is (not) visible in public area
171 if ($user->getId() == ANONYMOUS_USER_ID &&
172 $this->lm->getPublicAccessMode() == 'selected') {
173 if (!ilLMObject::_isPagePublic($this->current_page)) {
175 }
176 }
177
178 // preconditions
179 if (!ilObjContentObject::_checkPreconditionsOfPage($this->lm->getRefId(), $this->lm->getId(), $this->current_page)) {
181 }
182
183 // if navigation is restricted based on correct answered questions
184 // check if we have preceeding pages including unsanswered/incorrect answered questions
185 if (!$this->offline) {
186 if ($this->lm->getRestrictForwardNavigation()) {
187 if ($this->tracker->hasPredIncorrectAnswers($this->current_page)) {
189 }
190 }
191 }
192
193 // no active page found in chapter
194 if ($this->chapter_has_no_active_page &&
195 ilLMObject::_lookupType($this->requested_obj_id) == "st") {
197 }
198
199 if ($this->deactivated_page) {
201 }
202
203 if ($this->current_page == 0) {
205 }
206
207
208 return $status;
209 }
static _lookupType($a_obj_id, $a_lm_id=0)
Lookup type.
static _isPagePublic($a_node_id, $a_check_public_mode=false)
static _checkPreconditionsOfPage($cont_ref_id, $cont_obj_id, $page_id)
checks wether the preconditions of a page are fulfilled or not
static lookupParentId($a_id, $a_type)
Lookup parent id.
const ANONYMOUS_USER_ID
Definition: constants.php:25

References $user, ilObjContentObject\_checkPreconditionsOfPage(), ilLMObject\_isPagePublic(), ilLMObject\_lookupType(), ANONYMOUS_USER_ID, ilPageObject\lookupParentId(), STATUS_ACCESS, STATUS_CORRECT_ANSWER_MISSING, STATUS_DEACTIVATED_PAGE, STATUS_FAILED_PRECONDITIONS, STATUS_NO_ACCESS, STATUS_NO_PAGE_FOUND, STATUS_NO_PAGE_IN_CHAPTER, and STATUS_NO_PUBLIC_ACCESS.

Referenced by render().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLMPageGUI()

ilLMContentRendererGUI::getLMPageGUI (   $a_id)

Get lm page gui object.

Parameters

return

Definition at line 370 of file class.ilLMContentRendererGUI.php.

371 {
372 if ($this->lang != "-" && ilPageObject::_exists("lm", $a_id, $this->lang)) {
373 $page_gui = new ilLMPageGUI($a_id, 0, false, $this->lang, $this->concrete_lang);
374 } else {
375 if ($this->lang != "-" && ilPageObject::_exists("lm", $a_id, $this->ot->getFallbackLanguage())) {
376 $page_gui = new ilLMPageGUI($a_id, 0, false, $this->ot->getFallbackLanguage(), $this->concrete_lang);
377 } else {
378 $page_gui = new ilLMPageGUI($a_id, 0, false, "", $this->concrete_lang);
379 }
380 }
381 if ($this->offline) {
382 $page_gui->setOutputMode(ilPageObjectGUI::OFFLINE);
383 }
384 return $page_gui;
385 }
Extension of ilPageObjectGUI for learning modules.
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.

References ilPageObject\_exists(), and ilPageObjectGUI\OFFLINE.

Referenced by render().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSuccessorPage()

ilLMContentRendererGUI::getSuccessorPage ( )

Get successor page.

Parameters

return

Definition at line 637 of file class.ilLMContentRendererGUI.php.

638 {
640
641 $page_id = $this->current_page;
642
643 if (empty($page_id)) {
644 return 0;
645 }
646
647 // determine successor page_id
648 $found = false;
649
650 // empty chapter
651 if ($this->chapter_has_no_active_page &&
652 ilLMObject::_lookupType($this->requested_obj_id) == "st") {
653 $c_id = $this->requested_obj_id;
654 } else {
655 if ($this->deactivated_page) {
656 $c_id = $this->requested_obj_id;
657 } else {
658 $c_id = $page_id;
659 }
660 }
661 while (!$found) {
662 $succ_node = $this->lm_tree->fetchSuccessorNode($c_id, "pg");
663 $c_id = $succ_node["obj_id"];
664
665 $active = ilLMPage::_lookupActive(
666 $c_id,
667 $this->lm->getType(),
668 $this->lm_set->get("time_scheduled_page_activation")
669 );
670
671 if ($succ_node["obj_id"] > 0 &&
672 $ilUser->getId() == ANONYMOUS_USER_ID &&
673 ($this->lm->getPublicAccessMode() == "selected" &&
674 !ilLMObject::_isPagePublic($succ_node["obj_id"]))) {
675 $found = false;
676 } elseif ($succ_node["obj_id"] > 0 && !$active) {
677 // look, whether activation data should be shown
678 $act_data = ilLMPage::_lookupActivationData((int) $succ_node["obj_id"], $this->lm->getType());
679 if ($act_data["show_activation_info"] &&
680 (ilUtil::now() < $act_data["activation_start"])) {
681 $found = true;
682 } else {
683 $found = false;
684 }
685 } else {
686 $found = true;
687 }
688 }
689
690 if ($found) {
691 return $succ_node["obj_id"];
692 }
693 return 0;
694 }
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
static _lookupActivationData($a_id, $a_parent_type, $a_lang="-")
Lookup activation data.
static now()
Return current timestamp in Y-m-d H:i:s format.
$ilUser
Definition: imgupload.php:18

References $current_page, $ilUser, $user, ilLMObject\_isPagePublic(), ilPageObject\_lookupActivationData(), ilPageObject\_lookupActive(), ilLMObject\_lookupType(), ANONYMOUS_USER_ID, and ilUtil\now().

Referenced by renderFocusMessage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initHelp()

ilLMContentRendererGUI::initHelp ( )
protected

Init help.

Definition at line 143 of file class.ilLMContentRendererGUI.php.

144 {
145 $ilHelp = $this->help;
146 $ilHelp->setScreenIdComponent("lm");
147 $ilHelp->setScreenId("content");
148 $ilHelp->setSubScreenId("content");
149 }

References $help.

Referenced by render().

+ Here is the caller graph for this function:

◆ initSearchHighlighting()

ilLMContentRendererGUI::initSearchHighlighting ( )
protected

Init search highlighting.

Definition at line 214 of file class.ilLMContentRendererGUI.php.

215 {
217
218 if ($this->search_string != "" && !$this->offline) {
219 $cache = ilUserSearchCache::_getInstance($user->getId());
220 $cache->switchSearchType(ilUserSearchCache::LAST_QUERY);
221 $search_string = $cache->getQuery();
222
223 // advanced search?
224 if (is_array($search_string)) {
225 $search_string = $search_string["lom_content"];
226 }
227
228 $p = new ilQueryParser($search_string);
229 $p->parse();
230
231 $words = $p->getQuotedWords();
232 if (is_array($words)) {
233 foreach ($words as $w) {
234 ilTextHighlighterGUI::highlight("ilLMPageContent", $w);
235 }
236 }
237 }
238 }
static highlight($a_dom_node_id, $a_text, $a_tpl=null)
Searches for all occurences of a text (case-insensitive) and highlights it.
static _getInstance($a_usr_id)
Get singleton instance.

References $user, ilUserSearchCache\_getInstance(), ilTextHighlighterGUI\highlight(), and ilUserSearchCache\LAST_QUERY.

Referenced by render().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ render()

ilLMContentRendererGUI::render (   $a_head_foot_page_id = 0)

Render lm content.

Parameters
int$a_head_foot_page_id
Returns
string

Definition at line 247 of file class.ilLMContentRendererGUI.php.

248 {
250
251 $this->initHelp();
252
253 switch ($this->determineStatus()) {
255 return $this->renderNoPageAccess();
256
258 return $this->renderNoPublicAccess();
259
261 return $this->renderPreconditionsOfPage();
262
265
267 return $this->renderNoPageInChapterMessage();
268
270 return $this->renderDeactivatedPageMessage();
271
273 return $this->renderNoPageFoundMessage();
274
275 }
276
277 // page id is e.g. > 0 when footer or header page is processed
278 if ($a_head_foot_page_id == 0) {
279 $page_id = $this->current_page;
280 $this->initSearchHighlighting();
281 } else {
282 $page_id = $a_head_foot_page_id;
283 }
284
285 // check if page is out of focus
286 $focus_mess = $this->renderFocusMessage();
287 $page_object_gui = $this->getLMPageGUI($page_id);
288
289 // @todo 6.0 (factor this out (maybe to ilLMPageGUI)
290 $this->parent_gui->basicPageGuiInit($page_object_gui);
291
292 $page_object = $page_object_gui->getPageObject();
293 $page_object->buildDom();
294 $page_object->registerOfflineHandler($this);
295
296 $page_object_gui->setTemplateOutput(false);
297
298 // Update course items
299 ilCourseLMHistory::_updateLastAccess($ilUser->getId(), $this->lm->getRefId(), $page_id);
300
301 // read link targets
302 $page_object_gui->setPageLinker($this->linker);
303
304 // get lm page object
305 $lm_pg_obj = new ilLMPageObject($this->lm, $page_id);
306 $lm_pg_obj->setLMId($this->lm->getId());
307
308 // determine target frames for internal links
309 $page_object_gui->setLinkFrame($_GET["frame"]);
310
311 // page title and tracking (not for header or footer page)
312 if ($page_id == 0 || ($page_id != $this->lm->getHeaderPage() &&
313 $page_id != $this->lm->getFooterPage())) {
314 $page_object_gui->setPresentationTitle(
316 $lm_pg_obj->getId(),
317 $this->lm->getPageHeader(),
318 $this->lm->isActiveNumbering(),
319 $this->lm_set->get("time_scheduled_page_activation"),
320 false,
321 0,
322 $this->lang
323 )
324 );
325
326 // track access
327 if ($page_id != 0 && !$this->offline) {
328 $this->tracker->trackAccess($page_id, $ilUser->getId());
329 }
330 } else {
331 $page_object_gui->setEnabledPageFocus(false);
332 $page_object_gui->getPageConfig()->setEnableSelfAssessment(false);
333 }
334
335 // ADDED FOR CITATION
336 $page_object_gui->setLinkParams("ref_id=" . $this->lm->getRefId());
337 $page_object_gui->setTemplateTargetVar("PAGE_CONTENT");
338 // @todo 6.0
339 // $page_object_gui->setSourcecodeDownloadScript($this->getSourcecodeDownloadLink());
340
341 $ret = $page_object_gui->presentation($page_object_gui->getOutputMode());
342
343 // process header
344 if ($this->lm->getHeaderPage() > 0 &&
345 $page_id != $this->lm->getHeaderPage() &&
346 ($page_id == 0 || $page_id != $this->lm->getFooterPage())) {
347 if (ilLMObject::_exists($this->lm->getHeaderPage())) {
348 $head = $this->render($this->lm->getHeaderPage());
349 }
350 }
351
352 // process footer
353 if ($this->lm->getFooterPage() > 0 &&
354 $page_id != $this->lm->getFooterPage() &&
355 ($page_id == 0 || $page_id != $this->lm->getHeaderPage())) {
356 if (ilLMObject::_exists($this->lm->getFooterPage())) {
357 $foot = $this->render($this->lm->getFooterPage());
358 }
359 }
360
361 return $head . $focus_mess . $ret . $foot;
362 }
$_GET["client_id"]
static _updateLastAccess($a_user_id, $a_lm_ref_id, $a_page_id)
determineStatus()
Determine Status (should be factored out later to something like LMPageAccessStatus)
getLMPageGUI($a_id)
Get lm page gui object.
render($a_head_foot_page_id=0)
Render lm content.
renderNavRestrictionDueToQuestions()
Show message if navigation to page is not allowed due to unanswered questions.
renderNoPageFoundMessage()
Render no page found message.
renderNoPageInChapterMessage()
Render no page in chapter message.
initSearchHighlighting()
Init search highlighting.
renderPreconditionsOfPage()
show preconditions of the page
renderNoPublicAccess()
Show info message, if page is not accessible in public area.
renderNoPageAccess()
Show info message, if page is not accessible in public area.
renderFocusMessage()
Render focus message.
renderDeactivatedPageMessage()
Render deactivated page message.
static _exists($a_id)
checks wether a lm content object with specified id exists or not
Class ilLMPageObject.
static _getPresentationTitle( $a_pg_id, $a_mode=self::CHAPTER_TITLE, $a_include_numbers=false, $a_time_scheduled_activation=false, $a_force_content=false, $a_lm_id=0, $a_lang="-", $a_include_short=false)
presentation title doesn't have to be page title, it may be chapter title + page title or chapter tit...
$ret
Definition: parser.php:6

References $_GET, $current_page, $ilUser, $ret, $user, ilLMObject\_exists(), ilLMPageObject\_getPresentationTitle(), ilCourseLMHistory\_updateLastAccess(), determineStatus(), getLMPageGUI(), initHelp(), initSearchHighlighting(), render(), renderDeactivatedPageMessage(), renderFocusMessage(), renderNavRestrictionDueToQuestions(), renderNoPageAccess(), renderNoPageFoundMessage(), renderNoPageInChapterMessage(), renderNoPublicAccess(), renderPreconditionsOfPage(), STATUS_CORRECT_ANSWER_MISSING, STATUS_DEACTIVATED_PAGE, STATUS_FAILED_PRECONDITIONS, STATUS_NO_ACCESS, STATUS_NO_PAGE_FOUND, STATUS_NO_PAGE_IN_CHAPTER, and STATUS_NO_PUBLIC_ACCESS.

Referenced by render().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderDeactivatedPageMessage()

ilLMContentRendererGUI::renderDeactivatedPageMessage ( )
protected

Render deactivated page message.

Returns
string

Definition at line 543 of file class.ilLMContentRendererGUI.php.

544 {
545 $mtpl = new ilTemplate(
546 "tpl.no_content_message.html",
547 true,
548 true,
549 "Modules/LearningModule"
550 );
551 $m = $this->lng->txt("cont_page_currently_deactivated");
552 $act_data = ilLMPage::_lookupActivationData($this->requested_obj_id, $this->lm->getType());
553 if ($act_data["show_activation_info"] &&
554 (ilUtil::now() < $act_data["activation_start"])) {
555 $m .= "<p>" . sprintf(
556 $this->lng->txt("cont_page_activation_on"),
558 new ilDateTime($act_data["activation_start"], IL_CAL_DATETIME)
559 )
560 ) .
561 "</p>";
562 }
563 $mtpl->setVariable("MESSAGE", $m);
564 $mtpl->setVariable(
565 "ITEM_TITLE",
566 ilLMObject::_lookupTitle($this->requested_obj_id)
567 );
568 return $mtpl->get();
569 }
const IL_CAL_DATETIME
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
@classDescription Date and time handling
static _lookupTitle($a_obj_id)
Lookup title.
special template class to simplify handling of ITX/PEAR

References ilPageObject\_lookupActivationData(), ilLMObject\_lookupTitle(), ilDatePresentation\formatDate(), IL_CAL_DATETIME, and ilUtil\now().

Referenced by render().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderFocusMessage()

ilLMContentRendererGUI::renderFocusMessage ( )
protected

Render focus message.

Parameters

return string

Definition at line 395 of file class.ilLMContentRendererGUI.php.

396 {
397 $focus_mess = "";
398 if ($this->focus_id > 0) {
399 $path = $this->lm_tree->getPathId($this->current_page);
400
401 // out of focus
402 if (!in_array($this->focus_id, $path)) {
403 $mtpl = new ilTemplate(
404 "tpl.out_of_focus_message.html",
405 true,
406 true,
407 "Modules/LearningModule"
408 );
409 $mtpl->setVariable("MESSAGE", $this->lng->txt("cont_out_of_focus_message"));
410 $mtpl->setVariable("TXT_SHOW_CONTENT", $this->lng->txt("cont_show_content_after_focus"));
411
412 if ($this->requested_focus_return == 0 || ilObject::_lookupType((int) $this->requested_focus_return, true) != "crs") {
413 $mtpl->setVariable("TXT_BACK_BEGINNING", $this->lng->txt("cont_to_focus_beginning"));
414 $this->ctrl->setParameter($this->parent_gui, "obj_id", $this->focus_id);
415 $mtpl->setVariable("LINK_BACK_TO_BEGINNING", $this->ctrl->getLinkTarget($this->parent_gui, "layout"));
416 $this->ctrl->setParameter($this->parent_gui, "obj_id", $this->requested_obj_id);
417 } else {
418 $mtpl->setVariable("TXT_BACK_BEGINNING", $this->lng->txt("cont_to_focus_return_crs"));
419 $mtpl->setVariable("LINK_BACK_TO_BEGINNING", ilLink::_getLink($this->requested_focus_return));
420 }
421
422 $this->ctrl->setParameter($this->parent_gui, "focus_id", "");
423 $mtpl->setVariable("LINK_SHOW_CONTENT", $this->ctrl->getLinkTarget($this->parent_gui, "layout"));
424 $this->ctrl->setParameter($this->parent_gui, "focus_id", $this->requested_obj_id);
425
426 $focus_mess = $mtpl->get();
427 } else {
428 $sp = $this->getSuccessorPage();
429 $path2 = array();
430 if ($sp > 0) {
431 $path2 = $this->lm_tree->getPathId($this->getSuccessorPage());
432 }
433 if ($sp == 0 || !in_array($this->focus_id, $path2)) {
434 $mtpl = new ilTemplate(
435 "tpl.out_of_focus_message.html",
436 true,
437 true,
438 "Modules/LearningModule"
439 );
440 $mtpl->setVariable("MESSAGE", $this->lng->txt("cont_out_of_focus_message_last_page"));
441 $mtpl->setVariable("TXT_SHOW_CONTENT", $this->lng->txt("cont_show_content_after_focus"));
442
443 if ($this->requested_focus_return == 0 || ilObject::_lookupType($this->requested_focus_return, true) != "crs") {
444 $mtpl->setVariable("TXT_BACK_BEGINNING", $this->lng->txt("cont_to_focus_beginning"));
445 $this->ctrl->setParameter($this->parent_gui, "obj_id", $this->focus_id);
446 $mtpl->setVariable("LINK_BACK_TO_BEGINNING", $this->ctrl->getLinkTarget($this->parent_gui, "layout"));
447 $this->ctrl->setParameter($this->parent_gui, "obj_id", $this->requested_obj_id);
448 } else {
449 $mtpl->setVariable("TXT_BACK_BEGINNING", $this->lng->txt("cont_to_focus_return_crs"));
450 $mtpl->setVariable("LINK_BACK_TO_BEGINNING", ilLink::_getLink($this->requested_focus_return));
451 }
452
453 $this->ctrl->setParameter($this->parent_gui, "focus_id", "");
454 $mtpl->setVariable("LINK_SHOW_CONTENT", $this->ctrl->getLinkTarget($this->parent_gui, "layout"));
455 $this->ctrl->setParameter($this->parent_gui, "focus_id", $this->requested_obj_id);
456
457 $focus_mess = $mtpl->get();
458 }
459 }
460 }
461 return $focus_mess;
462 }
static _lookupType($a_id, $a_reference=false)
lookup object type

References ilLink\_getLink(), ilObject\_lookupType(), and getSuccessorPage().

Referenced by render().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderMessageScreen()

ilLMContentRendererGUI::renderMessageScreen (   $a_content)
protected

Show message screen.

Parameters
stringcontent
Returns
string

Definition at line 480 of file class.ilLMContentRendererGUI.php.

481 {
482 // content style
483 $tpl = new ilTemplate("tpl.page_message_screen.html", true, true, "Modules/LearningModule");
484 $tpl->setVariable("TXT_PAGE_NO_PUBLIC_ACCESS", $a_content);
485
486 return $tpl->get();
487 }
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41

References $tpl.

Referenced by renderNavRestrictionDueToQuestions(), renderNoPageAccess(), renderNoPageFoundMessage(), and renderNoPublicAccess().

+ Here is the caller graph for this function:

◆ renderNavRestrictionDueToQuestions()

ilLMContentRendererGUI::renderNavRestrictionDueToQuestions ( )
protected

Show message if navigation to page is not allowed due to unanswered questions.

Returns
string

Definition at line 503 of file class.ilLMContentRendererGUI.php.

504 {
505 return $this->renderMessageScreen($this->lng->txt("cont_no_page_access_unansw_q"));
506 }
renderMessageScreen($a_content)
Show message screen.

References renderMessageScreen().

Referenced by render().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderNoPageAccess()

ilLMContentRendererGUI::renderNoPageAccess ( )
protected

Show info message, if page is not accessible in public area.

Returns
string

Definition at line 469 of file class.ilLMContentRendererGUI.php.

470 {
471 return $this->renderMessageScreen($this->lng->txt("msg_no_page_access"));
472 }

References renderMessageScreen().

Referenced by render().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderNoPageFoundMessage()

ilLMContentRendererGUI::renderNoPageFoundMessage ( )
protected

Render no page found message.

Returns
string

Definition at line 532 of file class.ilLMContentRendererGUI.php.

533 {
534 return $this->renderMessageScreen($this->lng->txt("cont_no_page"));
535 }

References renderMessageScreen().

Referenced by render().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderNoPageInChapterMessage()

ilLMContentRendererGUI::renderNoPageInChapterMessage ( )
protected

Render no page in chapter message.

Returns
string

Definition at line 512 of file class.ilLMContentRendererGUI.php.

513 {
514 $mtpl = new ilTemplate(
515 "tpl.no_content_message.html",
516 true,
517 true,
518 "Modules/LearningModule"
519 );
520 $mtpl->setVariable("MESSAGE", $this->lng->txt("cont_no_page_in_chapter"));
521 $mtpl->setVariable(
522 "ITEM_TITLE",
523 ilLMObject::_lookupTitle($this->requested_obj_id)
524 );
525 return $mtpl->get();
526 }

References ilLMObject\_lookupTitle().

Referenced by render().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderNoPublicAccess()

ilLMContentRendererGUI::renderNoPublicAccess ( )
protected

Show info message, if page is not accessible in public area.

Returns
string

Definition at line 493 of file class.ilLMContentRendererGUI.php.

494 {
495 return $this->renderMessageScreen($this->lng->txt("msg_page_no_public_access"));
496 }

References renderMessageScreen().

Referenced by render().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderPreconditionsOfPage()

ilLMContentRendererGUI::renderPreconditionsOfPage ( )

show preconditions of the page

Definition at line 575 of file class.ilLMContentRendererGUI.php.

576 {
577 $conds = ilObjContentObject::_getMissingPreconditionsOfPage($this->lm->getRefId(), $this->lm->getId(), $this->current_page);
578 $topchap = ilObjContentObject::_getMissingPreconditionsTopChapter($this->lm->getRefId(), $this->lm->getId(), $this->current_page);
579
580 $ptpl = new ilTemplate("tpl.page_preconditions.html", true, true, "Modules/LearningModule");
581
582 // list all missing preconditions
583 foreach ($conds as $cond) {
584 $obj_link = ilLink::_getLink($cond["trigger_ref_id"]);
585 $ptpl->setCurrentBlock("condition");
586 $ptpl->setVariable("VAL_ITEM", ilObject::_lookupTitle($cond["trigger_obj_id"]));
587 $ptpl->setVariable("LINK_ITEM", $obj_link);
588 if ($cond["operator"] == "passed") {
589 $cond_str = $this->lng->txt("passed");
590 } else {
591 $cond_str = $this->lng->txt("condition_" . $cond["operator"]);
592 }
593 $ptpl->setVariable("VAL_CONDITION", $cond_str . " " . $cond["value"]);
594 $ptpl->parseCurrentBlock();
595 }
596
597 $ptpl->setVariable(
598 "TXT_MISSING_PRECONDITIONS",
599 sprintf(
600 $this->lng->txt("cont_missing_preconditions"),
602 )
603 );
604 $ptpl->setVariable("TXT_ITEM", $this->lng->txt("object"));
605 $ptpl->setVariable("TXT_CONDITION", $this->lng->txt("condition"));
606
607 // output skip chapter link
608 $parent = $this->lm_tree->getParentId($topchap);
609 $childs = $this->lm_tree->getChildsByType($parent, "st");
610 $j = -2;
611 $i = 1;
612 foreach ($childs as $child) {
613 if ($child["child"] == $topchap) {
614 $j = $i;
615 }
616 if ($i++ == ($j + 1)) {
617 $succ_node = $this->lm_tree->fetchSuccessorNode($child["child"], "pg");
618 }
619 }
620 if ($succ_node != "") {
621 $link = "<br /><a href=\"" .
622 $this->linker->getLink("layout", $succ_node["obj_id"], $_GET["frame"]) .
623 "\">" . $this->lng->txt("cont_skip_chapter") . "</a>";
624 $ptpl->setVariable("LINK_SKIP_CHAPTER", $link);
625 }
626
627 return $ptpl->get();
628 }
static _getMissingPreconditionsTopChapter($cont_obj_ref_id, $cont_obj_id, $page_id)
get top chapter of page for that any precondition is missing
static _getMissingPreconditionsOfPage($cont_ref_id, $cont_obj_id, $page_id)
gets all missing preconditions of page
static _lookupTitle($a_id)
lookup object title
$i
Definition: metadata.php:24

References $_GET, $i, ilLink\_getLink(), ilObjContentObject\_getMissingPreconditionsOfPage(), ilObjContentObject\_getMissingPreconditionsTopChapter(), ilObject\_lookupTitle(), and ilLMObject\_lookupTitle().

Referenced by render().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilLMContentRendererGUI::$access
protected

Definition at line 25 of file class.ilLMContentRendererGUI.php.

Referenced by __construct().

◆ $concrete_lang

ilLMContentRendererGUI::$concrete_lang
protected

Definition at line 97 of file class.ilLMContentRendererGUI.php.

◆ $ctrl

ilLMContentRendererGUI::$ctrl
protected

Definition at line 65 of file class.ilLMContentRendererGUI.php.

Referenced by __construct().

◆ $current_page

ilLMContentRendererGUI::$current_page
protected

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

Referenced by getSuccessorPage(), and render().

◆ $help

ilLMContentRendererGUI::$help
protected

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

Referenced by __construct(), and initHelp().

◆ $lang

ilLMContentRendererGUI::$lang
protected

Definition at line 85 of file class.ilLMContentRendererGUI.php.

◆ $linker

ilLMContentRendererGUI::$linker
protected

Definition at line 90 of file class.ilLMContentRendererGUI.php.

◆ $lm

ilLMContentRendererGUI::$lm
protected

Definition at line 45 of file class.ilLMContentRendererGUI.php.

◆ $lm_set

ilLMContentRendererGUI::$lm_set
protected

Definition at line 80 of file class.ilLMContentRendererGUI.php.

◆ $lm_tree

ilLMContentRendererGUI::$lm_tree
protected

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

◆ $lng

ilLMContentRendererGUI::$lng
protected

Definition at line 50 of file class.ilLMContentRendererGUI.php.

Referenced by __construct().

◆ $offline

ilLMContentRendererGUI::$offline
protected

Definition at line 55 of file class.ilLMContentRendererGUI.php.

◆ $ot

ilLMContentRendererGUI::$ot
protected

Definition at line 95 of file class.ilLMContentRendererGUI.php.

◆ $parent_gui

ilLMContentRendererGUI::$parent_gui
protected

Definition at line 75 of file class.ilLMContentRendererGUI.php.

Referenced by __construct().

◆ $tracker

ilLMContentRendererGUI::$tracker
protected

Definition at line 60 of file class.ilLMContentRendererGUI.php.

◆ $user

ilLMContentRendererGUI::$user
protected

◆ STATUS_ACCESS

const ilLMContentRendererGUI::STATUS_ACCESS = 0

Definition at line 13 of file class.ilLMContentRendererGUI.php.

Referenced by determineStatus().

◆ STATUS_CORRECT_ANSWER_MISSING

const ilLMContentRendererGUI::STATUS_CORRECT_ANSWER_MISSING = 4

Definition at line 17 of file class.ilLMContentRendererGUI.php.

Referenced by determineStatus(), and render().

◆ STATUS_DEACTIVATED_PAGE

const ilLMContentRendererGUI::STATUS_DEACTIVATED_PAGE = 6

Definition at line 19 of file class.ilLMContentRendererGUI.php.

Referenced by determineStatus(), and render().

◆ STATUS_FAILED_PRECONDITIONS

const ilLMContentRendererGUI::STATUS_FAILED_PRECONDITIONS = 3

Definition at line 16 of file class.ilLMContentRendererGUI.php.

Referenced by determineStatus(), and render().

◆ STATUS_NO_ACCESS

const ilLMContentRendererGUI::STATUS_NO_ACCESS = 1

Definition at line 14 of file class.ilLMContentRendererGUI.php.

Referenced by determineStatus(), and render().

◆ STATUS_NO_PAGE_FOUND

const ilLMContentRendererGUI::STATUS_NO_PAGE_FOUND = 7

Definition at line 20 of file class.ilLMContentRendererGUI.php.

Referenced by determineStatus(), and render().

◆ STATUS_NO_PAGE_IN_CHAPTER

const ilLMContentRendererGUI::STATUS_NO_PAGE_IN_CHAPTER = 5

Definition at line 18 of file class.ilLMContentRendererGUI.php.

Referenced by determineStatus(), and render().

◆ STATUS_NO_PUBLIC_ACCESS

const ilLMContentRendererGUI::STATUS_NO_PUBLIC_ACCESS = 2

Definition at line 15 of file class.ilLMContentRendererGUI.php.

Referenced by determineStatus(), and render().


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