ILIAS  release_8 Revision v8.23
ilLMTOCExplorerGUIFactory Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilLMTOCExplorerGUIFactory:

Public Member Functions

 __construct ()
 
 getExplorer (ilLMPresentationService $service, string $parent_cmd="")
 

Protected Attributes

ilGlobalTemplateInterface $tpl
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 22 of file class.ilLMTOCExplorerGUIFactory.php.

Constructor & Destructor Documentation

◆ __construct()

ilLMTOCExplorerGUIFactory::__construct ( )

Definition at line 26 of file class.ilLMTOCExplorerGUIFactory.php.

References $DIC.

27  {
28  global $DIC;
29 
30  $this->tpl = $DIC->ui()->mainTemplate();
31  }
global $DIC
Definition: feed.php:28

Member Function Documentation

◆ getExplorer()

ilLMTOCExplorerGUIFactory::getExplorer ( ilLMPresentationService  $service,
string  $parent_cmd = "" 
)

Definition at line 33 of file class.ilLMTOCExplorerGUIFactory.php.

References $lang, ilLMObject\_lookupType(), ilLMPresentationService\getLearningModule(), ilLMPresentationService\getLMTree(), ilLMPresentationService\getNavigationStatus(), ilLMPresentationService\getPresentationStatus(), ilLMPresentationService\getRequest(), and ilLMPresentationService\getTracker().

37  // this needs a proper interface
38  $tracker = $service->getTracker();
39  $chapter_has_no_active_page = $service->getNavigationStatus()->isChapterWithoutActivePage();
40  $lang = $service->getPresentationStatus()->getLang();
41  $focus_id = $service->getPresentationStatus()->getFocusId();
42  $export_all_languages = $service->getPresentationStatus()->exportAllLanguages();
43  $current_page = $service->getNavigationStatus()->getCurrentPage();
44  $deactivated_page = $service->getNavigationStatus()->isDeactivatedPage();
45  $requested_obj_id = $service->getRequest()->getObjId();
46  $lm = $service->getLearningModule();
47  $lm_tree = $service->getLMTree();
48  $offline = $service->getPresentationStatus()->offline();
49 
50  $exp = new ilLMTOCExplorerGUI(
51  "illmpresentationgui",
52  $parent_cmd,
53  $service,
54  $lang,
55  $focus_id,
56  $export_all_languages
57  );
58  $exp->setMainTemplate($this->tpl);
59  $exp->setTracker($tracker);
60 
61  // determine highlighted and force open nodes
62  $page_id = $current_page;
63  if ($deactivated_page) {
64  $page_id = $requested_obj_id;
65  }
66  if ($page_id > 0) {
67  $exp->setPathOpen((int) $page_id);
68  }
69  // empty chapter
70  if ($chapter_has_no_active_page &&
71  ilLMObject::_lookupType($requested_obj_id) == "st") {
72  $exp->setHighlightNode($requested_obj_id);
73  } else {
74  if ($lm->getTOCMode() == "pages") {
75  if ($deactivated_page) {
76  $exp->setHighlightNode($requested_obj_id);
77  } else {
78  $exp->setHighlightNode($page_id);
79  }
80  } else {
81  $exp->setHighlightNode((int) $lm_tree->getParentId($page_id));
82  }
83  }
84  if ($offline) {
85  $exp->setOfflineMode(true);
86  }
87 
88  return $exp;
89  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$lang
Definition: xapiexit.php:26
static _lookupType(int $a_obj_id, int $a_lm_id=0)
+ Here is the call graph for this function:

Field Documentation

◆ $tpl

ilGlobalTemplateInterface ilLMTOCExplorerGUIFactory::$tpl
protected

Definition at line 24 of file class.ilLMTOCExplorerGUIFactory.php.


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