ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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
 

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 95 of file class.ilLMContentRendererGUI.php.

References $access, $ctrl, $DIC, $help, $lng, $parent_gui, $user, ilLMPresentationService\getLearningModule(), ilLMPresentationService\getLinker(), ilLMPresentationService\getLMTree(), ilLMPresentationService\getNavigationStatus(), ilLMPresentationService\getPresentationStatus(), ilLMPresentationService\getSettings(), ilLMPresentationService\getTracker(), help(), and user().

104  {
105  global $DIC;
106 
107  $this->access = $access;
108  $this->user = $user;
109  $this->help = $help;
110  $this->ctrl = $ctrl;
111  $this->lm_tree = $service->getLMTree();
112  $this->lang = $service->getPresentationStatus()->getLang();
113  $this->current_page = $service->getNavigationStatus()->getCurrentPage();
114  $this->lm = $service->getLearningModule();
115  $this->lm_set = $service->getSettings();
116  $this->lng = $lng;
117  $this->offline = $service->getPresentationStatus()->offline;
118  $this->tracker = $service->getTracker();
119  $this->linker = $service->getLinker();
120  $this->parent_gui = $parent_gui;
121  $this->chapter_has_no_active_page = $service->getNavigationStatus()->isChapterWithoutActivePage();
122  $this->deactivated_page = $service->getNavigationStatus()->isDeactivatedPage();
123  $this->focus_id = $service->getPresentationStatus()->getFocusId();
124 
125  $this->search_string = $service->getPresentationStatus()->getSearchString();
126  $this->requested_obj_id = $requested_obj_id;
127  $this->requested_focus_return = $service->getPresentationStatus()->getFocusReturn();
128  }
user()
Definition: user.php:4
help()
Definition: help.php:2
getSettings()
Get learning module settings.
$DIC
Definition: xapitoken.php:46
+ 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

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

References $current_page, $user, ilObjContentObject\_checkPreconditionsOfPage(), ilLMObject\_isPagePublic(), ilLMObject\_lookupType(), and ilPageObject\lookupParentId().

Referenced by render().

148  {
149  $user = $this->user;
150 
151  $status = self::STATUS_ACCESS;
152 
153  // check page id
154  $requested_page_lm = ilLMPage::lookupParentId($this->current_page, "lm");
155  if ($requested_page_lm != $this->lm->getId()) {
156  $status = self::STATUS_NO_ACCESS;
157  }
158 
159 
160  // check if page is (not) visible in public area
161  if ($user->getId() == ANONYMOUS_USER_ID &&
162  $this->lm->getPublicAccessMode() == 'selected') {
163  if (!ilLMObject::_isPagePublic($this->current_page)) {
164  $status = self::STATUS_NO_PUBLIC_ACCESS;
165  }
166  }
167 
168  // preconditions
169  if (!ilObjContentObject::_checkPreconditionsOfPage($this->lm->getRefId(), $this->lm->getId(), $this->current_page)) {
170  $status = self::STATUS_FAILED_PRECONDITIONS;
171  }
172 
173  // if navigation is restricted based on correct answered questions
174  // check if we have preceeding pages including unsanswered/incorrect answered questions
175  if (!$this->offline) {
176  if ($this->lm->getRestrictForwardNavigation()) {
177  if ($this->tracker->hasPredIncorrectAnswers($this->current_page)) {
178  $status = self::STATUS_CORRECT_ANSWER_MISSING;
179  }
180  }
181  }
182 
183  // no active page found in chapter
184  if ($this->chapter_has_no_active_page &&
185  ilLMObject::_lookupType($this->requested_obj_id) == "st") {
186  $status = self::STATUS_NO_PAGE_IN_CHAPTER;
187  }
188 
189  if ($this->deactivated_page) {
190  $status = self::STATUS_DEACTIVATED_PAGE;
191  }
192 
193  if ($this->current_page == 0) {
194  $status = self::STATUS_NO_PAGE_FOUND;
195  }
196 
197 
198  return $status;
199  }
static _lookupType($a_obj_id, $a_lm_id=0)
Lookup type.
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.
static _isPagePublic($a_node_id, $a_check_public_mode=false)
+ 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

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

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

Referenced by render().

360  {
361  if ($this->lang != "-" && ilPageObject::_exists("lm", $a_id, $this->lang)) {
362  $page_gui = new ilLMPageGUI($a_id, 0, false, $this->lang);
363  } else {
364  $page_gui = new ilLMPageGUI($a_id);
365  }
366  if ($this->offline) {
367  $page_gui->setOutputMode(ilPageObjectGUI::OFFLINE);
368  }
369  return $page_gui;
370  }
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
Extension of ilPageObjectGUI for learning modules.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSuccessorPage()

ilLMContentRendererGUI::getSuccessorPage ( )

Get successor page.

Parameters

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

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

Referenced by renderFocusMessage().

623  {
625 
626  $page_id = $this->current_page;
627 
628  if (empty($page_id)) {
629  return 0;
630  }
631 
632  // determine successor page_id
633  $found = false;
634 
635  // empty chapter
636  if ($this->chapter_has_no_active_page &&
637  ilLMObject::_lookupType($this->requested_obj_id) == "st") {
638  $c_id = $this->requested_obj_id;
639  } else {
640  if ($this->deactivated_page) {
641  $c_id = $this->requested_obj_id;
642  } else {
643  $c_id = $page_id;
644  }
645  }
646  while (!$found) {
647  $succ_node = $this->lm_tree->fetchSuccessorNode($c_id, "pg");
648  $c_id = $succ_node["obj_id"];
649 
650  $active = ilLMPage::_lookupActive(
651  $c_id,
652  $this->lm->getType(),
653  $this->lm_set->get("time_scheduled_page_activation")
654  );
655 
656  if ($succ_node["obj_id"] > 0 &&
657  $ilUser->getId() == ANONYMOUS_USER_ID &&
658  ($this->lm->getPublicAccessMode() == "selected" &&
659  !ilLMObject::_isPagePublic($succ_node["obj_id"]))) {
660  $found = false;
661  } elseif ($succ_node["obj_id"] > 0 && !$active) {
662  // look, whether activation data should be shown
663  $act_data = ilLMPage::_lookupActivationData((int) $succ_node["obj_id"], $this->lm->getType());
664  if ($act_data["show_activation_info"] &&
665  (ilUtil::now() < $act_data["activation_start"])) {
666  $found = true;
667  } else {
668  $found = false;
669  }
670  } else {
671  $found = true;
672  }
673  }
674 
675  if ($found) {
676  return $succ_node["obj_id"];
677  }
678  return 0;
679  }
static _lookupType($a_obj_id, $a_lm_id=0)
Lookup type.
static now()
Return current timestamp in Y-m-d H:i:s format.
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
$ilUser
Definition: imgupload.php:18
static _lookupActivationData($a_id, $a_parent_type, $a_lang="-")
Lookup activation data.
static _isPagePublic($a_node_id, $a_check_public_mode=false)
+ 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 133 of file class.ilLMContentRendererGUI.php.

References $help.

Referenced by render().

134  {
135  $ilHelp = $this->help;
136  $ilHelp->setScreenIdComponent("lm");
137  $ilHelp->setScreenId("content");
138  $ilHelp->setSubScreenId("content");
139  }
+ Here is the caller graph for this function:

◆ initSearchHighlighting()

ilLMContentRendererGUI::initSearchHighlighting ( )
protected

Init search highlighting.

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

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

Referenced by render().

205  {
206  $user = $this->user;
207 
208  if ($this->search_string != "" && !$this->offline) {
209  $cache = ilUserSearchCache::_getInstance($user->getId());
210  $cache->switchSearchType(ilUserSearchCache::LAST_QUERY);
211  $search_string = $cache->getQuery();
212 
213  // advanced search?
214  if (is_array($search_string)) {
215  $search_string = $search_string["lom_content"];
216  }
217 
218  $p = new ilQueryParser($search_string);
219  $p->parse();
220 
221  $words = $p->getQuotedWords();
222  if (is_array($words)) {
223  foreach ($words as $w) {
224  ilTextHighlighterGUI::highlight("ilLMPageContent", $w);
225  }
226  }
227  }
228  }
static _getInstance($a_usr_id)
Get singleton instance.
static highlight($a_dom_node_id, $a_text, $a_tpl=null)
Searches for all occurences of a text (case-insensitive) and highlights it.
+ 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 237 of file class.ilLMContentRendererGUI.php.

References $_GET, $current_page, $ilUser, $lang, $ret, $user, ilLMObject\_exists(), ilLMPageObject\_getPresentationTitle(), ilCourseLMHistory\_updateLastAccess(), determineStatus(), getLMPageGUI(), initHelp(), initSearchHighlighting(), renderDeactivatedPageMessage(), renderFocusMessage(), renderNavRestrictionDueToQuestions(), renderNoPageAccess(), renderNoPageFoundMessage(), renderNoPageInChapterMessage(), renderNoPublicAccess(), and renderPreconditionsOfPage().

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

◆ renderDeactivatedPageMessage()

ilLMContentRendererGUI::renderDeactivatedPageMessage ( )
protected

Render deactivated page message.

Returns
string

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

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

Referenced by render().

529  {
530  $mtpl = new ilTemplate(
531  "tpl.no_content_message.html",
532  true,
533  true,
534  "Modules/LearningModule"
535  );
536  $m = $this->lng->txt("cont_page_currently_deactivated");
537  $act_data = ilLMPage::_lookupActivationData($this->requested_obj_id, $this->lm->getType());
538  if ($act_data["show_activation_info"] &&
539  (ilUtil::now() < $act_data["activation_start"])) {
540  $m .= "<p>" . sprintf(
541  $this->lng->txt("cont_page_activation_on"),
543  new ilDateTime($act_data["activation_start"], IL_CAL_DATETIME)
544  )
545  ) .
546  "</p>";
547  }
548  $mtpl->setVariable("MESSAGE", $m);
549  $mtpl->setVariable(
550  "ITEM_TITLE",
551  ilLMObject::_lookupTitle($this->requested_obj_id)
552  );
553  return $mtpl->get();
554  }
const IL_CAL_DATETIME
static _lookupTitle($a_obj_id)
Lookup title.
static now()
Return current timestamp in Y-m-d H:i:s format.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
static _lookupActivationData($a_id, $a_parent_type, $a_lang="-")
Lookup activation data.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderFocusMessage()

ilLMContentRendererGUI::renderFocusMessage ( )
protected

Render focus message.

Parameters

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

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

Referenced by render().

381  {
382  $focus_mess = "";
383  if ($this->focus_id > 0) {
384  $path = $this->lm_tree->getPathId($this->current_page);
385 
386  // out of focus
387  if (!in_array($this->focus_id, $path)) {
388  $mtpl = new ilTemplate(
389  "tpl.out_of_focus_message.html",
390  true,
391  true,
392  "Modules/LearningModule"
393  );
394  $mtpl->setVariable("MESSAGE", $this->lng->txt("cont_out_of_focus_message"));
395  $mtpl->setVariable("TXT_SHOW_CONTENT", $this->lng->txt("cont_show_content_after_focus"));
396 
397  if ($this->requested_focus_return == 0 || ilObject::_lookupType((int) $this->requested_focus_return, true) != "crs") {
398  $mtpl->setVariable("TXT_BACK_BEGINNING", $this->lng->txt("cont_to_focus_beginning"));
399  $this->ctrl->setParameter($this->parent_gui, "obj_id", $this->focus_id);
400  $mtpl->setVariable("LINK_BACK_TO_BEGINNING", $this->ctrl->getLinkTarget($this->parent_gui, "layout"));
401  $this->ctrl->setParameter($this->parent_gui, "obj_id", $this->requested_obj_id);
402  } else {
403  $mtpl->setVariable("TXT_BACK_BEGINNING", $this->lng->txt("cont_to_focus_return_crs"));
404  $mtpl->setVariable("LINK_BACK_TO_BEGINNING", ilLink::_getLink($this->requested_focus_return));
405  }
406 
407  $this->ctrl->setParameter($this->parent_gui, "focus_id", "");
408  $mtpl->setVariable("LINK_SHOW_CONTENT", $this->ctrl->getLinkTarget($this->parent_gui, "layout"));
409  $this->ctrl->setParameter($this->parent_gui, "focus_id", $this->requested_obj_id);
410 
411  $focus_mess = $mtpl->get();
412  } else {
413  $sp = $this->getSuccessorPage();
414  $path2 = array();
415  if ($sp > 0) {
416  $path2 = $this->lm_tree->getPathId($this->getSuccessorPage());
417  }
418  if ($sp == 0 || !in_array($this->focus_id, $path2)) {
419  $mtpl = new ilTemplate(
420  "tpl.out_of_focus_message.html",
421  true,
422  true,
423  "Modules/LearningModule"
424  );
425  $mtpl->setVariable("MESSAGE", $this->lng->txt("cont_out_of_focus_message_last_page"));
426  $mtpl->setVariable("TXT_SHOW_CONTENT", $this->lng->txt("cont_show_content_after_focus"));
427 
428  if ($this->requested_focus_return == 0 || ilObject::_lookupType($this->requested_focus_return, true) != "crs") {
429  $mtpl->setVariable("TXT_BACK_BEGINNING", $this->lng->txt("cont_to_focus_beginning"));
430  $this->ctrl->setParameter($this->parent_gui, "obj_id", $this->focus_id);
431  $mtpl->setVariable("LINK_BACK_TO_BEGINNING", $this->ctrl->getLinkTarget($this->parent_gui, "layout"));
432  $this->ctrl->setParameter($this->parent_gui, "obj_id", $this->requested_obj_id);
433  } else {
434  $mtpl->setVariable("TXT_BACK_BEGINNING", $this->lng->txt("cont_to_focus_return_crs"));
435  $mtpl->setVariable("LINK_BACK_TO_BEGINNING", ilLink::_getLink($this->requested_focus_return));
436  }
437 
438  $this->ctrl->setParameter($this->parent_gui, "focus_id", "");
439  $mtpl->setVariable("LINK_SHOW_CONTENT", $this->ctrl->getLinkTarget($this->parent_gui, "layout"));
440  $this->ctrl->setParameter($this->parent_gui, "focus_id", $this->requested_obj_id);
441 
442  $focus_mess = $mtpl->get();
443  }
444  }
445  }
446  return $focus_mess;
447  }
getSuccessorPage()
Get successor page.
static _lookupType($a_id, $a_reference=false)
lookup object type
+ 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 465 of file class.ilLMContentRendererGUI.php.

References $a_content, and $tpl.

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

466  {
467  // content style
468  $tpl = new ilTemplate("tpl.page_message_screen.html", true, true, "Modules/LearningModule");
469  $tpl->setVariable("TXT_PAGE_NO_PUBLIC_ACCESS", $a_content);
470 
471  return $tpl->get();
472  }
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
$a_content
Definition: workflow.php:93
+ 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 488 of file class.ilLMContentRendererGUI.php.

References renderMessageScreen().

Referenced by render().

489  {
490  return $this->renderMessageScreen($this->lng->txt("cont_no_page_access_unansw_q"));
491  }
renderMessageScreen($a_content)
Show message screen.
+ 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 454 of file class.ilLMContentRendererGUI.php.

References renderMessageScreen().

Referenced by render().

455  {
456  return $this->renderMessageScreen($this->lng->txt("msg_no_page_access"));
457  }
renderMessageScreen($a_content)
Show message screen.
+ 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 517 of file class.ilLMContentRendererGUI.php.

References renderMessageScreen().

Referenced by render().

518  {
519  return $this->renderMessageScreen($this->lng->txt("cont_no_page"));
520  }
renderMessageScreen($a_content)
Show message screen.
+ 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 497 of file class.ilLMContentRendererGUI.php.

References ilLMObject\_lookupTitle().

Referenced by render().

498  {
499  $mtpl = new ilTemplate(
500  "tpl.no_content_message.html",
501  true,
502  true,
503  "Modules/LearningModule"
504  );
505  $mtpl->setVariable("MESSAGE", $this->lng->txt("cont_no_page_in_chapter"));
506  $mtpl->setVariable(
507  "ITEM_TITLE",
508  ilLMObject::_lookupTitle($this->requested_obj_id)
509  );
510  return $mtpl->get();
511  }
static _lookupTitle($a_obj_id)
Lookup title.
+ 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 478 of file class.ilLMContentRendererGUI.php.

References renderMessageScreen().

Referenced by render().

479  {
480  return $this->renderMessageScreen($this->lng->txt("msg_page_no_public_access"));
481  }
renderMessageScreen($a_content)
Show message screen.
+ 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 560 of file class.ilLMContentRendererGUI.php.

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

Referenced by render().

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

◆ $ctrl

ilLMContentRendererGUI::$ctrl
protected

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

Referenced by __construct().

◆ $current_page

ilLMContentRendererGUI::$current_page
protected

◆ $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.

Referenced by render().

◆ $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.

◆ $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.

◆ STATUS_CORRECT_ANSWER_MISSING

const ilLMContentRendererGUI::STATUS_CORRECT_ANSWER_MISSING = 4

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

◆ STATUS_DEACTIVATED_PAGE

const ilLMContentRendererGUI::STATUS_DEACTIVATED_PAGE = 6

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

◆ STATUS_FAILED_PRECONDITIONS

const ilLMContentRendererGUI::STATUS_FAILED_PRECONDITIONS = 3

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

◆ STATUS_NO_ACCESS

const ilLMContentRendererGUI::STATUS_NO_ACCESS = 1

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

◆ STATUS_NO_PAGE_FOUND

const ilLMContentRendererGUI::STATUS_NO_PAGE_FOUND = 7

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

◆ STATUS_NO_PAGE_IN_CHAPTER

const ilLMContentRendererGUI::STATUS_NO_PAGE_IN_CHAPTER = 5

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

◆ STATUS_NO_PUBLIC_ACCESS

const ilLMContentRendererGUI::STATUS_NO_PUBLIC_ACCESS = 2

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


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