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

Public Member Functions

 __construct ()
 Constructor. More...
 
 getExplorer (ilLMPresentationService $service, string $parent_cmd="")
 Get explorer. More...
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilLMTOCExplorerGUIFactory::__construct ( )

Constructor.

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

16 {
17 global $DIC;
18
19 $this->tpl = $DIC->ui()->mainTemplate();
20 }
global $DIC
Definition: goto.php:24

References $DIC.

Member Function Documentation

◆ getExplorer()

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

Get explorer.

Returns
ilLMTOCExplorerGUI

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

30 {
31 // this needs a proper interface
32 $tracker = $service->getTracker();
33 $chapter_has_no_active_page = $service->getNavigationStatus()->isChapterWithoutActivePage();
34 $lang = $service->getPresentationStatus()->getLang();
35 $focus_id = $service->getPresentationStatus()->getFocusId();
36 $export_all_languages = $service->getPresentationStatus()->exportAllLanguages();
37 $current_page = $service->getNavigationStatus()->getCurrentPage();
38 $deactivated_page = $service->getNavigationStatus()->isDeactivatedPage();
39 $requested_obj_id = $service->getRequest()->getRequestedObjId();
40 $lm = $service->getLearningModule();
41 $lm_tree = $service->getLMTree();
42 $offline = $service->getPresentationStatus()->offline();
43
44 $exp = new ilLMTOCExplorerGUI(
45 "illmpresentationgui",
46 $parent_cmd,
48 $lang,
49 $focus_id,
50 $export_all_languages
51 );
52 $exp->setMainTemplate($this->tpl);
53 $exp->setTracker($tracker);
54
55 // determine highlighted and force open nodes
56 $page_id = $current_page;
57 if ($deactivated_page) {
58 $page_id = $requested_obj_id;
59 }
60 if ($page_id > 0) {
61 $exp->setPathOpen((int) $page_id);
62 }
63 // empty chapter
64 if ($chapter_has_no_active_page &&
65 ilLMObject::_lookupType($requested_obj_id) == "st") {
66 $exp->setHighlightNode($requested_obj_id);
67 } else {
68 if ($lm->getTOCMode() == "pages") {
69 if ($deactivated_page) {
70 $exp->setHighlightNode($requested_obj_id);
71 } else {
72 $exp->setHighlightNode($page_id);
73 }
74 } else {
75 $exp->setHighlightNode($lm_tree->getParentId($page_id));
76 }
77 }
78 if ($offline) {
79 $exp->setOfflineMode(true);
80 }
81
82 return $exp;
83 }
static _lookupType($a_obj_id, $a_lm_id=0)
Lookup type.
LM presentation (left frame) explorer GUI class.
$service
Definition: result.php:17
$lang
Definition: xapiexit.php:8

References $lang, $service, and ilLMObject\_lookupType().

+ Here is the call graph for this function:

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