ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilLMTOCExplorerGUI Class Reference

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

+ Inheritance diagram for ilLMTOCExplorerGUI:
+ Collaboration diagram for ilLMTOCExplorerGUI:

Public Member Functions

 __construct ( $a_parent_obj, string $a_parent_cmd, ilLMPresentationService $service, string $a_lang="-", int $a_focus_id=0, bool $export_all_languages=false)
 Constructor. More...
 
 getRootNode ()
 
 setTracker (ilLMTracker $a_val)
 
 getTracker ()
 
 setHighlightNode (int $a_val)
 
 getHighlightNode ()
 
 isNodeHighlighted ($a_node)
 
 getNodeContent ($a_node)
 
 getNodeIcon ($a_node)
 
 isNodeClickable ($a_node)
 
 getNodeIconAlt ($a_node)
 
 getNodeHref ($a_node)
 
 isNodeVisible ($a_node)
 
 renderLSToc (\LSTOCBuilder $toc)
 
- Public Member Functions inherited from ilLMExplorerGUI
 __construct ( $a_parent_obj, string $a_parent_cmd, ilObjContentObject $a_lm, string $a_id="")
 
 beforeRendering ()
 
 getNodeContent ($a_node)
 
 isNodeHighlighted ($a_node)
 
- Public Member Functions inherited from ilTreeExplorerGUI
 __construct (string $a_expl_id, $a_parent_obj, string $a_parent_cmd, ilTree $a_tree, string $a_node_parameter_name="node_id")
 
 getTree ()
 
 setOrderField (string $a_val, bool $a_numeric=false)
 
 getOrderField ()
 
 setTypeWhiteList (array $a_val)
 Set type white list. More...
 
 getTypeWhiteList ()
 Get type white list. More...
 
 setTypeBlackList (array $a_val)
 Set type black list. More...
 
 getTypeBlackList ()
 Get type black list. More...
 
 setPreloadChilds (bool $a_val)
 
 getPreloadChilds ()
 
 getSuccessorNode ( $a_node_id, string $a_type="")
 Get successor node (currently only(!) based on lft/rgt tree values) More...
 
 getChildsOfNode ($a_parent_node_id)
 Get childs of node. More...
 
 getNodeId ($a_node)
 Get id for node. More...
 
 getNodeIconAlt ($a_node)
 Get node icon alt attribute. More...
 
 getRootNode ()
 Get root node. More...
 
 setRootId ($a_root)
 
 setPathOpen ($a_id)
 Set node path to be opened. More...
 
 getHTML ($new=false)
 Get HTML. More...
 
 getChildren ($record, $environment=null)
 Get a list of records (that list can also be empty). More...
 
 build (\ILIAS\UI\Component\Tree\Node\Factory $factory, $record, $environment=null)
 
 getTreeLabel ()
 
 getTreeComponent ()
 
 toggleExplorerNodeState ()
 Should be called by an ilCtrl-enabled command class if a tree node toggle action should be processed. More...
 
- Public Member Functions inherited from ilExplorerBaseGUI
 setChildLimit (int $a_val)
 
 getChildLimit ()
 
 setSearchTerm (string $a_val)
 
 getSearchTerm ()
 
 setMainTemplate (ilGlobalTemplateInterface $a_main_tpl=null)
 
 getRootNode ()
 Get root node. More...
 
 getChildsOfNode ($a_parent_node_id)
 Get children of node. More...
 
 getNodeContent ($a_node)
 Get content of a node. More...
 
 getNodeId ($a_node)
 Get id of a node. More...
 
 getNodeHref ($a_node)
 Get href for node. More...
 
 nodeHasVisibleChilds ($a_node)
 Node has children Please note that this standard method may not be optimal depending on what a derived class does in isNodeVisible. More...
 
 sortChilds (array $a_childs, $a_parent_node_id)
 Sort childs. More...
 
 getNodeIcon ($a_node)
 Get node icon path. More...
 
 getNodeIconAlt ($a_node)
 Get node icon alt attribute. More...
 
 getNodeTarget ($a_node)
 Get node target (frame) attribute. More...
 
 getNodeOnClick ($a_node)
 Get node onclick attribute. More...
 
 isNodeVisible ($a_node)
 Is node visible? More...
 
 isNodeHighlighted ($a_node)
 Is node highlighted? More...
 
 isNodeClickable ($a_node)
 Is node clickable? More...
 
 getId ()
 Get id of explorer element. More...
 
 setSkipRootNode (bool $a_val)
 
 getSkipRootNode ()
 
 setAjax (bool $a_val)
 
 getAjax ()
 
 setSecondaryHighlightedNodes (array $a_val)
 Set secondary (background) highlighted nodes. More...
 
 getSecondaryHighlightedNodes ()
 Get secondary (background) highlighted nodes. More...
 
 setNodeOpen ($a_id)
 Set node to be opened (additional custom opened node, not standard expand behaviour) More...
 
 setSelectMode (string $a_postvar, bool $a_multi=false)
 Set select mode (to deactivate, pass an empty string as postvar) More...
 
 setNodeSelected ($a_id)
 Set node to be opened (additional custom opened node, not standard expand behaviour) More...
 
 setOfflineMode (bool $a_val)
 
 getOfflineMode ()
 
 handleCommand ()
 Handle explorer internal command. More...
 
 getContainerId ()
 
 openNode ()
 Open node. More...
 
 closeNode ()
 Close node. More...
 
 getNodeAsync ()
 Get node asynchronously. More...
 
 beforeRendering ()
 Before rendering. More...
 
 getOnLoadCode ()
 Get on load code. More...
 
 getHTML ()
 
 renderNode ($a_node, ilTemplate $tpl)
 Render node. More...
 
 renderChilds ($a_node_id, ilTemplate $tpl)
 Render childs. More...
 
 getDomNodeIdForNodeId ($a_node_id)
 Get DOM node id for node id. More...
 
 getNodeIdForDomNodeId (string $a_dom_node_id)
 Get node id for dom node id. More...
 
 listItemStart (ilTemplate $tpl, $a_node)
 List item start. More...
 
 listItemEnd (ilTemplate $tpl)
 
 listStart (ilTemplate $tpl)
 
 listEnd (ilTemplate $tpl)
 
 isNodeOnclickEnabled ()
 
 setNodeOnclickEnabled (bool $nodeOnclickEnabled)
 
 isEnableDnd ()
 
 setEnableDnd (bool $enable_dnd)
 
- Public Member Functions inherited from ILIAS\UI\Component\Tree\TreeRecursion
 build (Node\Factory $factory, $record, $environment=null)
 Build and return a Node. More...
 

Protected Member Functions

 initTreeData ()
 
 initVisibilityData (int $node_id)
 
 renderLSTocNode (\LSTOCBuilder $toc, ?array $current_node=null)
 
- Protected Member Functions inherited from ilLMExplorerGUI
 checkLPIcon (int $a_id)
 
- Protected Member Functions inherited from ilTreeExplorerGUI
 preloadChilds ()
 
 matches ($node)
 Does a node match a search term (or is search term empty) More...
 
 getRootId ()
 
 createNode (\ILIAS\UI\Component\Tree\Node\Factory $factory, $record)
 Creates at tree node, can be overwritten in derivatives if another node type should be used. More...
 
 getNodeStateToggleCmdClasses ($record)
 Should return an array of ilCtrl-enabled command classes which should be used to build the URL for the expand/collapse actions applied on a tree node. More...
 
 render ()
 
- Protected Member Functions inherited from ilExplorerBaseGUI
 isNodeSelectable ($a_node)
 Is node selectable? More...
 
 getNodeToggleOnClick ($a_node)
 Get onclick attribute for node toggling. More...
 
 getSelectOnClick ($a_node)
 Get onclick attribute for selecting radio/checkbox. More...
 
 isNodeOpen ($node_id)
 Get all open nodes. More...
 
 getJSTreePlugins ()
 
 isNodeRequested (string $a_node_id)
 

Protected Attributes

string $lang
 
int $highlight_node = 0
 
bool $export_all_languages
 
ilPageActivationDBRepository $activation_repo
 
array $complete_tree = []
 
array $activation_data = []
 
ilSetting $lm_set
 
ilLMPresentationLinker $linker
 
int $focus_id = 0
 
ilLMPresentationService $service
 
ilLMTracker $tracker
 
- Protected Attributes inherited from ilLMExplorerGUI
ilObjContentObject $lm
 
ilObjUser $user
 
array $lp_cache = []
 
int $cnt_lmobj = 0
 
string $obj_id = ""
 
string $transl = ""
 
- Protected Attributes inherited from ilTreeExplorerGUI
ilLanguage $lng
 
Psr Http Message ServerRequestInterface $httpRequest
 
ilTree $tree = null
 
string $tree_label = ""
 
string $order_field = ""
 
bool $order_field_numeric = false
 
array $type_white_list = array()
 
array $type_black_list = array()
 
array $childs = array()
 
bool $preloaded = false
 
bool $preload_childs = false
 
array $root_node_data = null
 
array $all_childs = array()
 
 $root_id = 0
 
ILIAS DI UIServices $ui
 
- Protected Attributes inherited from ilExplorerBaseGUI
string $node_parameter_name
 
ilLogger $log
 
ilCtrl $ctrl
 
ilGlobalTemplateInterface $tpl
 
bool $skip_root_node = false
 
bool $ajax = false
 
array $custom_open_nodes = array()
 
array $selected_nodes = array()
 
string $select_postvar = ""
 
bool $offline_mode = false
 
array $sec_highl_nodes = array()
 
bool $enable_dnd = false
 
string $search_term = ""
 
array $open_nodes = []
 
ilSessionIStorage $store
 
bool $select_multi = false
 
 $parent_obj
 
int $child_limit = 0
 
string $parent_cmd = ''
 
string $requested_exp_cmd = ""
 
string $requested_exp_cont = ""
 
string $requested_searchterm = ""
 
string $requested_node_id = ""
 
string $id
 

Additional Inherited Members

- Static Public Member Functions inherited from ilExplorerBaseGUI
static getLocalExplorerJsPath ()
 
static getLocalJsTreeJsPath ()
 
static getLocalJsTreeCssPath ()
 
static createHTMLExportDirs (string $a_target_dir)
 
static init (ilGlobalTemplateInterface $a_main_tpl=null)
 
- Static Protected Attributes inherited from ilExplorerBaseGUI
static string $js_tree_path = "./node_modules/jstree/dist/jstree.js"
 
static string $js_tree_path_css = "./node_modules/jstree/dist/themes/default/style.min.css"
 
static string $js_expl_path = "./Services/UIComponent/Explorer2/js/Explorer2.js"
 

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 LM presentation (left frame) explorer GUI class

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

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

Constructor & Destructor Documentation

◆ __construct()

ilLMTOCExplorerGUI::__construct (   $a_parent_obj,
string  $a_parent_cmd,
ilLMPresentationService  $service,
string  $a_lang = "-",
int  $a_focus_id = 0,
bool  $export_all_languages = false 
)

Constructor.

Parameters
object | string$a_parent_objparent gui object

Definition at line 42 of file class.ilLMTOCExplorerGUI.php.

References $DIC, $export_all_languages, $service, ILIAS\GlobalScreen\Provider\__construct(), ilLMPresentationService\getLearningModule(), ilLMPresentationService\getLinker(), ilExplorerBaseGUI\getOfflineMode(), ilLMPresentationService\getTracker(), initTreeData(), ilExplorerBaseGUI\setSecondaryHighlightedNodes(), ilTreeExplorerGUI\setTypeWhiteList(), and ILIAS\Repository\user().

49  {
50  global $DIC;
51 
52  $this->service = $service;
53  $this->user = $DIC->user();
54  $this->lm = $service->getLearningModule();
55  $this->linker = $service->getLinker();
56  $this->tracker = $service->getTracker();
57 
58  $exp_id = (!$this->getOfflineMode() && $this->lm->getProgressIcons())
59  ? "ilLMProgressTree"
60  : "";
61  parent::__construct($a_parent_obj, $a_parent_cmd, $this->lm, $exp_id);
62  $this->lm_set = new ilSetting("lm");
63  $this->lang = $a_lang;
64  if ($a_focus_id > 0) {
65  $this->setSecondaryHighlightedNodes(array($a_focus_id));
66  }
67  if ($this->lm->getTOCMode() != "pages") {
68  $this->setTypeWhiteList(array("st", "du"));
69  }
70  $this->focus_id = $a_focus_id;
71  $this->export_all_languages = $export_all_languages;
72 
73  $this->activation_repo = new ilPageActivationDBRepository();
74 
75  $this->initTreeData();
76  }
setTypeWhiteList(array $a_val)
Set type white list.
ilLMPresentationService $service
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
setSecondaryHighlightedNodes(array $a_val)
Set secondary (background) highlighted nodes.
+ Here is the call graph for this function:

Member Function Documentation

◆ getHighlightNode()

ilLMTOCExplorerGUI::getHighlightNode ( )

Definition at line 154 of file class.ilLMTOCExplorerGUI.php.

References $highlight_node.

Referenced by isNodeHighlighted().

154  : int
155  {
156  return $this->highlight_node;
157  }
+ Here is the caller graph for this function:

◆ getNodeContent()

ilLMTOCExplorerGUI::getNodeContent (   $a_node)
Parameters
array | object$a_node

Definition at line 173 of file class.ilLMTOCExplorerGUI.php.

References $lang, ilStructureObject\_getPresentationTitle(), ilLMPageObject\_getPresentationTitle(), ilLMObject\CHAPTER_TITLE, ilTreeExplorerGUI\getNodeId(), and getRootNode().

173  : string
174  {
175  if ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
176  return $this->service->getPresentationStatus()->getLMPresentationTitle();
177  }
178 
179  if ($a_node["type"] == "st") {
181  $a_node["child"],
183  $this->lm->isActiveNumbering(),
184  false,
185  false,
186  $this->lm->getId(),
187  $this->lang,
188  true
189  );
190  } elseif ($a_node["type"] == "pg") {
192  $a_node["child"],
193  $this->lm->getPageHeader(),
194  $this->lm->isActiveNumbering(),
195  (bool) $this->lm_set->get("time_scheduled_page_activation"),
196  true,
197  $this->lm->getId(),
198  $this->lang,
199  true
200  );
201  } elseif ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
202  return $this->lm->getTitle();
203  }
204 
205  return $a_node["title"];
206  }
static _getPresentationTitle(int $a_st_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)
getNodeId($a_node)
Get id for node.
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...
+ Here is the call graph for this function:

◆ getNodeHref()

ilLMTOCExplorerGUI::getNodeHref (   $a_node)
Parameters
array | object$a_node

Definition at line 340 of file class.ilLMTOCExplorerGUI.php.

References $lang, ilPageObject\_lookupActive(), ilLMObject\getExportId(), ilExplorerBaseGUI\getOfflineMode(), and ilTreeExplorerGUI\getTree().

340  : string
341  {
342  if (!$this->getOfflineMode()) {
343  return $this->linker->getLink("", $a_node["child"]);
344  //return parent::buildLinkTarget($a_node_id, $a_type);
345  } else {
346  if ($a_node["type"] != "pg") {
347  // get next activated page
348  $found = false;
349  while (!$found) {
350  $a_node = $this->getTree()->fetchSuccessorNode($a_node["child"], "pg");
351  $active = ilLMPage::_lookupActive(
352  $a_node["child"],
353  $this->lm->getType(),
354  (bool) $this->lm_set->get("time_scheduled_page_activation")
355  );
356 
357  if ($a_node["child"] > 0 && !$active) {
358  $found = false;
359  } else {
360  $found = true;
361  }
362  }
363  }
364 
365  $lang_suffix = "";
366  if ($this->export_all_languages) {
367  if ($this->lang != "" && $this->lang != "-") {
368  $lang_suffix = "_" . $this->lang;
369  }
370  }
371 
372  if ($nid = ilLMPageObject::getExportId($this->lm->getId(), $a_node["child"])) {
373  return "lm_pg_" . $nid . $lang_suffix . ".html";
374  }
375  return "lm_pg_" . $a_node["child"] . $lang_suffix . ".html";
376  }
377  }
static _lookupActive(int $a_id, string $a_parent_type, bool $a_check_scheduled_activation=false, string $a_lang="-")
lookup activation status
static getExportId(int $a_lm_id, int $a_lmobj_id, string $a_type="pg")
+ Here is the call graph for this function:

◆ getNodeIcon()

ilLMTOCExplorerGUI::getNodeIcon (   $a_node)
Parameters
array | object$a_node

Definition at line 212 of file class.ilLMTOCExplorerGUI.php.

References ilPageObject\_isScheduledActivation(), ilPageObject\_lookupActive(), ilLMExplorerGUI\checkLPIcon(), ilSetting\get(), ilUtil\getImagePath(), and ilExplorerBaseGUI\getOfflineMode().

Referenced by renderLSTocNode().

212  : string
213  {
214  // overwrite chapter icons with lp info?
215  if (!$this->getOfflineMode() && $a_node["type"] == "st") {
216  $icon = $this->checkLPIcon($a_node["child"]);
217  if ($icon != "") {
218  return $icon;
219  }
220  }
221 
222  // use progress icons (does not depend on lp mode)
223  if (!$this->getOfflineMode() && $this->lm->getProgressIcons()) {
224  return $this->tracker->getIconForLMObject($a_node, $this->highlight_node);
225  }
226 
227  if ($a_node["type"] == "du") {
228  $a_node["type"] = "lm";
229  }
230  $a_name = "icon_" . $a_node["type"] . ".svg";
231  if ($a_node["type"] == "pg") {
232  $lm_set = new ilSetting("lm");
233  $active = ilLMPage::_lookupActive(
234  $a_node["child"],
235  $this->lm->getType(),
236  (bool) $lm_set->get("time_scheduled_page_activation")
237  );
238 
239  // is page scheduled?
240  $img_sc = ($lm_set->get("time_scheduled_page_activation") &&
241  ilLMPage::_isScheduledActivation($a_node["child"], $this->lm->getType()) && !$active
242  && !$this->getOfflineMode())
243  ? "_sc"
244  : "";
245 
246  $a_name = "icon_pg" . $img_sc . ".svg";
247 
248  if (!$active && !$this->getOfflineMode()) {
249  $a_name = "icon_pg_d" . $img_sc . ".svg";
250  }
251  }
252 
253  return ilUtil::getImagePath($a_name, false, "output", $this->getOfflineMode());
254  }
static _lookupActive(int $a_id, string $a_parent_type, bool $a_check_scheduled_activation=false, string $a_lang="-")
lookup activation status
get(string $a_keyword, ?string $a_default_value=null)
get setting
static _isScheduledActivation(int $a_id, string $a_parent_type, string $a_lang="-")
Check whether page is activated by time schedule.
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNodeIconAlt()

ilLMTOCExplorerGUI::getNodeIconAlt (   $a_node)
Parameters
array | object$a_node

Definition at line 332 of file class.ilLMTOCExplorerGUI.php.

332  : string
333  {
334  return "";
335  }

◆ getRootNode()

ilLMTOCExplorerGUI::getRootNode ( )

Definition at line 129 of file class.ilLMTOCExplorerGUI.php.

References ilTreeExplorerGUI\$root_id, ilLMObject\_lookupType(), and ilTreeExplorerGUI\getTree().

Referenced by getNodeContent().

129  : array
130  {
131  $root_id = $this->getTree()->readRootId();
132  if ($this->focus_id > 0 && $this->getTree()->isInTree($this->focus_id) &&
133  ilLMObject::_lookupType($this->focus_id) == "st") {
134  // $root_id = $this->focus_id;
135  }
136  return $this->getTree()->getNodeData($root_id);
137  }
static _lookupType(int $a_obj_id, int $a_lm_id=0)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTracker()

ilLMTOCExplorerGUI::getTracker ( )

Definition at line 144 of file class.ilLMTOCExplorerGUI.php.

References $tracker.

Referenced by isNodeClickable().

144  : ilLMTracker
145  {
146  return $this->tracker;
147  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ initTreeData()

ilLMTOCExplorerGUI::initTreeData ( )
protected

Definition at line 78 of file class.ilLMTOCExplorerGUI.php.

References $lang, and initVisibilityData().

Referenced by __construct().

78  : void
79  {
80  $nodes = $this->tree->getCompleteTree();
81  foreach ($nodes as $node) {
82  $this->complete_tree["childs"][$node["parent"]][] = $node;
83  $this->complete_tree["parent"][$node["child"]] = $node["parent"];
84  $this->complete_tree["nodes"][$node["child"]] = $node;
85  }
86 
87  $page_ids = array_column($this->complete_tree["nodes"], "child");
88  $this->activation_data = $this->activation_repo->get(
89  "lm",
90  $page_ids,
91  (bool) $this->lm_set->get("time_scheduled_page_activation"),
93  );
94  $this->initVisibilityData($this->tree->readRootId());
95  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initVisibilityData()

ilLMTOCExplorerGUI::initVisibilityData ( int  $node_id)
protected

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

Referenced by initTreeData().

99  : void {
100  $current_node = $this->complete_tree["nodes"][$node_id];
101 
102  if (isset($this->complete_tree["childs"][$node_id])) {
103  foreach ($this->complete_tree["childs"][$node_id] as $node) {
104  $this->initVisibilityData($node["child"]);
105  }
106  }
107 
108  // pages are visible if they are active or activation info should be shown
109  if ($current_node["type"] == "pg") {
110  $this->complete_tree["visibility"][$node_id] = ($this->activation_data[$node_id]["active"] ||
111  $this->activation_data[$node_id]["show_info"]);
112  } elseif ($current_node["type"] == "st") {
113 
114  // make chapters visible as soon as there is one visible child
115  $this->complete_tree["visibility"][$node_id] = false;
116  if (isset($this->complete_tree["childs"][$node_id])) {
117  foreach ($this->complete_tree["childs"][$node_id] as $node) {
118  if (isset($this->complete_tree["visibility"][$node["child"]]) &&
119  $this->complete_tree["visibility"][$node["child"]]) {
120  $this->complete_tree["visibility"][$node_id] = true;
121  }
122  }
123  }
124  } else {
125  $this->complete_tree["visibility"][$node_id] = true;
126  }
127  }
+ Here is the caller graph for this function:

◆ isNodeClickable()

ilLMTOCExplorerGUI::isNodeClickable (   $a_node)
Parameters
array | object$a_node

Definition at line 259 of file class.ilLMTOCExplorerGUI.php.

References $ilUser, $path, ilLMExplorerGUI\$user, ilLMObject\_isPagePublic(), ilPageObject\_lookupActive(), ANONYMOUS_USER_ID, ilExplorerBaseGUI\getOfflineMode(), ilTreeExplorerGUI\getSuccessorNode(), getTracker(), and ilTreeExplorerGUI\getTree().

259  : bool
260  {
262 
263  $orig_node_id = $a_node["child"];
264 
265  // if navigation is restricted based on correct answered questions
266  // check if we have preceeding pages including unsanswered/incorrect answered questions
267  if (!$this->getOfflineMode()) {
268  if ($this->lm->getRestrictForwardNavigation()) {
269  if ($this->getTracker()->hasPredIncorrectAnswers($orig_node_id)) {
270  return false;
271  }
272  }
273  }
274 
275  if ($a_node["type"] == "st") {
276  if (!$this->getOfflineMode()) {
277  if ($this->lm->getTOCMode() != "pages") {
278  $a_node = $this->getTree()->fetchSuccessorNode($a_node["child"], "pg");
279  } else {
280  // faster, but needs pages to be in explorer
281  $a_node = $this->getSuccessorNode($a_node["child"], "pg");
282  }
283  if ($a_node["child"] == 0) {
284  return false;
285  }
286  } else {
287  // get next activated page
288  $found = false;
289  while (!$found) {
290  if ($this->lm->getTOCMode() != "pages") {
291  $a_node = $this->getTree()->fetchSuccessorNode($a_node["child"], "pg");
292  } else {
293  $a_node = $this->getSuccessorNode($a_node["child"], "pg");
294  }
295  $active = ilLMPage::_lookupActive(
296  $a_node["child"],
297  $this->lm->getType(),
298  (bool) $this->lm_set->get("time_scheduled_page_activation")
299  );
300 
301  if ($a_node["child"] > 0 && !$active) {
302  $found = false;
303  } else {
304  $found = true;
305  }
306  }
307  if ($a_node["child"] <= 0) {
308  return false;
309  } else {
310  $path = $this->getTree()->getPathId($a_node["child"]);
311  if (!in_array($orig_node_id, $path)) {
312  return false;
313  }
314  }
315  }
316  }
317 
318  if ($a_node["type"] == "pg") {
319  // check public area mode
320  if ($ilUser->getId() == ANONYMOUS_USER_ID && !ilLMObject::_isPagePublic($a_node["child"], true)) {
321  return false;
322  }
323  }
324 
325  return true;
326  }
static _lookupActive(int $a_id, string $a_parent_type, bool $a_check_scheduled_activation=false, string $a_lang="-")
lookup activation status
static _isPagePublic(int $a_node_id, bool $a_check_public_mode=false)
const ANONYMOUS_USER_ID
Definition: constants.php:27
$path
Definition: ltiservices.php:32
getSuccessorNode( $a_node_id, string $a_type="")
Get successor node (currently only(!) based on lft/rgt tree values)
$ilUser
Definition: imgupload.php:34
+ Here is the call graph for this function:

◆ isNodeHighlighted()

ilLMTOCExplorerGUI::isNodeHighlighted (   $a_node)
Parameters
object | array$a_node

Definition at line 162 of file class.ilLMTOCExplorerGUI.php.

References getHighlightNode().

Referenced by renderLSTocNode().

162  : bool
163  {
164  if ($a_node["child"] == $this->getHighlightNode()) {
165  return true;
166  }
167  return false;
168  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isNodeVisible()

ilLMTOCExplorerGUI::isNodeVisible (   $a_node)
Parameters
array | object$a_node

Definition at line 382 of file class.ilLMTOCExplorerGUI.php.

382  : bool
383  {
384  return (bool) $this->complete_tree["visibility"][$a_node["child"]];
385  }

◆ renderLSToc()

ilLMTOCExplorerGUI::renderLSToc ( \LSTOCBuilder  $toc)

Definition at line 391 of file class.ilLMTOCExplorerGUI.php.

References renderLSTocNode().

391  : void
392  {
393  $this->renderLSTocNode($toc, null);
394  }
renderLSTocNode(\LSTOCBuilder $toc, ?array $current_node=null)
+ Here is the call graph for this function:

◆ renderLSTocNode()

ilLMTOCExplorerGUI::renderLSTocNode ( \LSTOCBuilder  $toc,
?array  $current_node = null 
)
protected

Definition at line 396 of file class.ilLMTOCExplorerGUI.php.

References ilTreeExplorerGUI\getChildren(), getNodeIcon(), isNodeHighlighted(), LSTOCBuilder\item(), ILIAS\KioskMode\TOCBuilder\LP_COMPLETED, ILIAS\KioskMode\TOCBuilder\LP_IN_PROGRESS, and LSTOCBuilder\node().

Referenced by renderLSToc().

396  : void
397  {
398  $root = false;
399  if ($current_node == 0) {
400  $root = true;
401  $current_node = $this->tree->getNodeData($this->tree->readRootId());
402  }
403 
404  $children = $this->getChildren($current_node);
405  if (count($children) > 0) {
406  if ($root) {
407  $node_toc = $toc;
408  } else {
409  // current workaround
411  $node_icon = $this->getNodeIcon($current_node);
412  if (strpos($node_icon, "complete")) {
414  }
415 
416  $node_toc = $toc->node($current_node["title"], $current_node["child"], $lp);
417  }
418  foreach ($this->getChildren($current_node) as $child) {
419  $this->renderLSTocNode($node_toc, $child);
420  }
421  $node_toc->end();
422  } else {
423  $highlight = $this->isNodeHighlighted($current_node);
424  $toc->item($current_node["title"], $current_node["child"], null, $highlight);
425  }
426  }
getChildren($record, $environment=null)
Get a list of records (that list can also be empty).
renderLSTocNode(\LSTOCBuilder $toc, ?array $current_node=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setHighlightNode()

ilLMTOCExplorerGUI::setHighlightNode ( int  $a_val)

Definition at line 149 of file class.ilLMTOCExplorerGUI.php.

149  : void
150  {
151  $this->highlight_node = $a_val;
152  }

◆ setTracker()

ilLMTOCExplorerGUI::setTracker ( ilLMTracker  $a_val)

Definition at line 139 of file class.ilLMTOCExplorerGUI.php.

139  : void
140  {
141  $this->tracker = $a_val;
142  }

Field Documentation

◆ $activation_data

array ilLMTOCExplorerGUI::$activation_data = []
protected

Definition at line 31 of file class.ilLMTOCExplorerGUI.php.

◆ $activation_repo

ilPageActivationDBRepository ilLMTOCExplorerGUI::$activation_repo
protected

Definition at line 29 of file class.ilLMTOCExplorerGUI.php.

◆ $complete_tree

array ilLMTOCExplorerGUI::$complete_tree = []
protected

Definition at line 30 of file class.ilLMTOCExplorerGUI.php.

◆ $export_all_languages

bool ilLMTOCExplorerGUI::$export_all_languages
protected

Definition at line 28 of file class.ilLMTOCExplorerGUI.php.

Referenced by __construct().

◆ $focus_id

int ilLMTOCExplorerGUI::$focus_id = 0
protected

Definition at line 34 of file class.ilLMTOCExplorerGUI.php.

◆ $highlight_node

int ilLMTOCExplorerGUI::$highlight_node = 0
protected

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

Referenced by getHighlightNode().

◆ $lang

string ilLMTOCExplorerGUI::$lang
protected

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

Referenced by getNodeContent(), getNodeHref(), and initTreeData().

◆ $linker

ilLMPresentationLinker ilLMTOCExplorerGUI::$linker
protected

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

◆ $lm_set

ilSetting ilLMTOCExplorerGUI::$lm_set
protected

Definition at line 32 of file class.ilLMTOCExplorerGUI.php.

◆ $service

ilLMPresentationService ilLMTOCExplorerGUI::$service
protected

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

Referenced by __construct().

◆ $tracker

ilLMTracker ilLMTOCExplorerGUI::$tracker
protected

Definition at line 36 of file class.ilLMTOCExplorerGUI.php.

Referenced by getTracker().


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