48 bool $export_all_languages =
false 53 $this->
user = $DIC->user();
58 $exp_id = (!$this->
getOfflineMode() && $this->lm->getProgressIcons())
63 $this->lang = $a_lang;
64 if ($a_focus_id > 0) {
67 if ($this->lm->getTOCMode() !=
"pages") {
70 $this->focus_id = $a_focus_id;
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;
87 $page_ids = array_column($this->complete_tree[
"nodes"],
"child");
88 $this->activation_data = $this->activation_repo->get(
91 (
bool) $this->lm_set->get(
"time_scheduled_page_activation"),
100 $current_node = $this->complete_tree[
"nodes"][$node_id];
102 if (isset($this->complete_tree[
"childs"][$node_id])) {
103 foreach ($this->complete_tree[
"childs"][$node_id] as $node) {
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") {
114 $this->complete_tree[
"visibility"][$node_id] =
false;
115 if (isset($this->complete_tree[
"childs"][$node_id])) {
116 foreach ($this->complete_tree[
"childs"][$node_id] as $node) {
117 if (isset($this->complete_tree[
"visibility"][$node[
"child"]]) &&
118 $this->complete_tree[
"visibility"][$node[
"child"]]) {
119 $this->complete_tree[
"visibility"][$node_id] =
true;
124 $this->complete_tree[
"visibility"][$node_id] =
true;
131 if ($this->focus_id > 0 && $this->
getTree()->isInTree($this->focus_id) &&
140 $this->tracker = $a_val;
150 $this->highlight_node = $a_val;
175 return $this->service->getPresentationStatus()->getLMPresentationTitle();
178 if ($a_node[
"type"] ==
"st") {
182 $this->lm->isActiveNumbering(),
189 } elseif ($a_node[
"type"] ==
"pg") {
192 $this->lm->getPageHeader(),
193 $this->lm->isActiveNumbering(),
194 (bool) $this->lm_set->get(
"time_scheduled_page_activation"),
201 return $this->lm->getTitle();
204 return $a_node[
"title"];
223 return $this->tracker->getIconForLMObject($a_node, $this->highlight_node);
226 if ($a_node[
"type"] ==
"du") {
227 $a_node[
"type"] =
"lm";
229 $a_name =
"standard/icon_" . $a_node[
"type"] .
".svg";
230 if ($a_node[
"type"] ==
"pg") {
234 $this->lm->getType(),
235 (bool) $lm_set->
get(
"time_scheduled_page_activation")
239 $img_sc = ($lm_set->
get(
"time_scheduled_page_activation") &&
245 $a_name =
"standard/icon_pg" . $img_sc .
".svg";
248 $a_name =
"standard/icon_pg_d" . $img_sc .
".svg";
262 $orig_node_id = $a_node[
"child"];
267 if ($this->lm->getRestrictForwardNavigation()) {
268 if ($this->
getTracker()->hasPredIncorrectAnswers($orig_node_id)) {
274 if ($a_node[
"type"] ==
"st") {
276 if ($this->lm->getTOCMode() !=
"pages") {
277 $a_node = $this->
getTree()->fetchSuccessorNode($a_node[
"child"],
"pg");
282 if (($a_node[
"child"] ?? 0) == 0) {
289 if ($this->lm->getTOCMode() !=
"pages") {
290 $a_node = $this->
getTree()->fetchSuccessorNode($a_node[
"child"],
"pg");
296 $this->lm->getType(),
297 (bool) $this->lm_set->get(
"time_scheduled_page_activation")
300 if ($a_node[
"child"] > 0 && !$active) {
306 if ($a_node[
"child"] <= 0) {
310 if (!in_array($orig_node_id,
$path)) {
317 if ($a_node[
"type"] ==
"pg") {
342 return $this->linker->getLink(
"", $a_node[
"child"]);
345 if ($a_node[
"type"] !=
"pg") {
349 $a_node = $this->
getTree()->fetchSuccessorNode($a_node[
"child"],
"pg");
352 $this->lm->getType(),
353 (bool) $this->lm_set->get(
"time_scheduled_page_activation")
356 if ($a_node[
"child"] > 0 && !$active) {
365 if ($this->export_all_languages) {
366 if ($this->lang !=
"" && $this->lang !=
"-") {
372 return "lm_pg_" . $nid . $lang_suffix .
".html";
374 return "lm_pg_" . $a_node[
"child"] . $lang_suffix .
".html";
383 return (
bool) $this->complete_tree[
"visibility"][$a_node[
"child"]];
398 if ($current_node == 0) {
400 $current_node = $this->tree->getNodeData($this->tree->readRootId());
404 if (count($children) > 0) {
411 if (strpos($node_icon,
"complete")) {
415 $node_toc = $toc->
node($current_node[
"title"], $current_node[
"child"], $lp);
417 foreach ($this->
getChildren($current_node) as $child) {
423 $toc->
item($current_node[
"title"], $current_node[
"child"], null, $highlight);
static _lookupActive(int $a_id, string $a_parent_type, bool $a_check_scheduled_activation=false, string $a_lang="-")
lookup activation status
isNodeHighlighted($a_node)
ilPageActivationDBRepository $activation_repo
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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _isPagePublic(int $a_node_id, bool $a_check_public_mode=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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 getExportId(int $a_lm_id, int $a_lmobj_id, string $a_type="pg")
setTypeWhiteList(array $a_val)
Set type white list.
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
ilLMPresentationService $service
renderLSToc(\LSTOCBuilder $toc)
bool $export_all_languages
initVisibilityData(int $node_id)
getSuccessorNode( $a_node_id, string $a_type="")
Get successor node (currently only(!) based on lft/rgt tree values)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getNodeId($a_node)
Get id for node.
ilLMPresentationLinker $linker
setTracker(ilLMTracker $a_val)
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupType(int $a_obj_id, int $a_lm_id=0)
node(string $label, int $parameter=null, int $lp=null)
Build a sub tree in the TOC.If a parameter is provided, the node in the TOC can be accessed itself...
setHighlightNode(int $a_val)
getChildren($record, $environment=null)
Get a list of records (that list can also be empty).
setSecondaryHighlightedNodes(array $a_val)
Set secondary (background) highlighted nodes.
item(string $label, int $parameter, $state=null, bool $current=false)
Build an entry in the TOC.The parameter will be appended to the command when updating the state...
renderLSTocNode(\LSTOCBuilder $toc, ?array $current_node=null)
__construct( $a_parent_obj, string $a_parent_cmd, ilLMPresentationService $service, string $a_lang="-", int $a_focus_id=0, bool $export_all_languages=false)
Constructor.
Main service init and factory.