53 $this->
user = $DIC->user();
58 $exp_id = (!$this->
getOfflineMode() && $this->lm->getProgressIcons())
63 $this->lang = $a_lang;
64 if ($a_focus_id > 0) {
66 foreach ($this->tree->getSubTree($this->tree->getNodeData($a_focus_id)) as $node) {
67 $sec_high[] = $node[
"child"];
71 if ($this->lm->getTOCMode() !=
"pages") {
74 $this->focus_id = $a_focus_id;
84 $nodes = $this->tree->getCompleteTree();
85 foreach ($nodes as $node) {
86 $this->complete_tree[
"childs"][$node[
"parent"]][] = $node;
87 $this->complete_tree[
"parent"][$node[
"child"]] = $node[
"parent"];
88 $this->complete_tree[
"nodes"][$node[
"child"]] = $node;
91 $page_ids = array_column($this->complete_tree[
"nodes"],
"child");
92 $this->activation_data = $this->activation_repo->get(
95 (
bool) $this->lm_set->get(
"time_scheduled_page_activation"),
104 $current_node = $this->complete_tree[
"nodes"][$node_id];
106 if (isset($this->complete_tree[
"childs"][$node_id])) {
107 foreach ($this->complete_tree[
"childs"][$node_id] as $node) {
113 if ($current_node[
"type"] ==
"pg") {
114 $this->complete_tree[
"visibility"][$node_id] = ($this->activation_data[$node_id][
"active"] ||
115 $this->activation_data[$node_id][
"show_info"]);
116 } elseif ($current_node[
"type"] ==
"st") {
118 $this->complete_tree[
"visibility"][$node_id] =
false;
119 if (isset($this->complete_tree[
"childs"][$node_id])) {
120 foreach ($this->complete_tree[
"childs"][$node_id] as $node) {
121 if (isset($this->complete_tree[
"visibility"][$node[
"child"]]) &&
122 $this->complete_tree[
"visibility"][$node[
"child"]]) {
123 $this->complete_tree[
"visibility"][$node_id] =
true;
128 $this->complete_tree[
"visibility"][$node_id] =
true;
134 $root_id = $this->getTree()->readRootId();
135 if ($this->focus_id > 0 && $this->getTree()->isInTree($this->focus_id) &&
139 return $this->getTree()->getNodeData($root_id);
144 $this->tracker = $a_val;
149 return $this->tracker;
154 $this->highlight_node = $a_val;
159 return $this->highlight_node;
167 if ($a_node[
"child"] == $this->getHighlightNode()) {
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"),
200 } elseif ($a_node[
"child"] == $this->getNodeId($this->getRootNode())) {
201 $content = $this->service->getPresentationStatus()->getLMPresentationTitle();
204 return $this->highlightContent($a_node, $content);
209 if ($this->isNodeHighlighted($node)) {
210 $content =
"<b>" . $content .
"</b>";
212 $sec = $this->getSecondaryHighlightedNodes();
213 if (in_array($node[
"child"], $sec)) {
214 return "<span class='ilHighlighted'>" . $content .
"</span>";
226 if (!$this->getOfflineMode() && $a_node[
"type"] ==
"st") {
227 $icon = $this->checkLPIcon($a_node[
"child"]);
233 if (!$this->getOfflineMode() && $this->lm->getProgressIcons()) {
234 return $this->tracker->getIconForLMObject($a_node, $this->highlight_node);
237 if ($a_node[
"type"] ==
"du") {
238 $a_node[
"type"] =
"lm";
240 $a_name =
"standard/icon_" . $a_node[
"type"] .
".svg";
241 if ($a_node[
"type"] ==
"pg") {
245 $this->lm->getType(),
246 (
bool)
$lm_set->get(
"time_scheduled_page_activation")
250 $img_sc = (
$lm_set->get(
"time_scheduled_page_activation") &&
252 && !$this->getOfflineMode())
256 $a_name =
"standard/icon_pg" . $img_sc .
".svg";
258 if (!$active && !$this->getOfflineMode()) {
259 $a_name =
"standard/icon_pg_d" . $img_sc .
".svg";
271 $ilUser = $this->user;
272 $orig_node_id = $a_node[
"child"];
276 if (!$this->getOfflineMode()) {
277 if ($this->lm->getRestrictForwardNavigation()) {
278 if ($this->getTracker()->hasPredIncorrectAnswers($orig_node_id)) {
284 if ($a_node[
"type"] ==
"st") {
285 if (!$this->getOfflineMode()) {
286 if ($this->lm->getTOCMode() !=
"pages") {
287 $a_node = $this->getTree()->fetchSuccessorNode($a_node[
"child"],
"pg");
290 $a_node = $this->getSuccessorNode($a_node[
"child"],
"pg");
292 if (($a_node[
"child"] ?? 0) == 0) {
299 if ($this->lm->getTOCMode() !=
"pages") {
300 $a_node = $this->getTree()->fetchSuccessorNode($a_node[
"child"],
"pg");
302 $a_node = $this->getSuccessorNode($a_node[
"child"],
"pg");
306 $this->lm->getType(),
307 (
bool) $this->lm_set->get(
"time_scheduled_page_activation")
310 if ($a_node[
"child"] > 0 && !$active) {
316 if ($a_node[
"child"] <= 0) {
319 $path = $this->getTree()->getPathId($a_node[
"child"]);
320 if (!in_array($orig_node_id,
$path)) {
344 if (!$this->getOfflineMode()) {
345 return $this->linker->getLink(
"", $a_node[
"child"]);
348 if ($a_node[
"type"] !=
"pg") {
352 $a_node = $this->getTree()->fetchSuccessorNode($a_node[
"child"],
"pg");
355 $this->lm->getType(),
356 (
bool) $this->lm_set->get(
"time_scheduled_page_activation")
359 if ($a_node[
"child"] > 0 && !$active) {
368 if ($this->export_all_languages) {
369 if ($this->lang !=
"" && $this->lang !=
"-") {
375 return "lm_pg_" . $nid . $lang_suffix .
".html";
377 return "lm_pg_" . $a_node[
"child"] . $lang_suffix .
".html";
386 return (
bool) $this->complete_tree[
"visibility"][$a_node[
"child"]];
395 $this->renderLSTocNode($toc,
null);
401 if ($current_node == 0) {
403 $current_node = $this->tree->getNodeData($this->tree->readRootId());
406 $children = $this->getChildren($current_node);
407 if (count($children) > 0) {
413 $node_icon = $this->getNodeIcon($current_node);
414 if (strpos($node_icon,
"complete")) {
418 $node_toc = $toc->
node($current_node[
"title"], $current_node[
"child"], $lp);
420 foreach ($this->getChildren($current_node) as $child) {
421 $this->renderLSTocNode($node_toc, $child);
425 $highlight = $this->isNodeHighlighted($current_node);
426 $toc->
item($current_node[
"title"], $current_node[
"child"],
null, $highlight);
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....
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....
setSecondaryHighlightedNodes(array $a_val)
Set secondary (background) highlighted nodes.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getExportId(int $a_lm_id, int $a_lmobj_id, string $a_type="pg")
static _lookupType(int $a_obj_id, int $a_lm_id=0)
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...
Learning module presentation linker.
Main service init and factory.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setTracker(ilLMTracker $a_val)
ilLMPresentationLinker $linker
renderLSToc(\LSTOCBuilder $toc)
isNodeHighlighted($a_node)
ilLMPresentationService $service
bool $export_all_languages
initVisibilityData(int $node_id)
highlightContent(array $node, string $content)
getRootNode()
Get root node.
__construct( $a_parent_obj, string $a_parent_cmd, ilLMPresentationService $service, string $a_lang="-", int $a_focus_id=0, bool $export_all_languages=false)
Constructor.
setHighlightNode(int $a_val)
ilPageActivationDBRepository $activation_repo
renderLSTocNode(\LSTOCBuilder $toc, ?array $current_node=null)
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...
static _isScheduledActivation(int $a_id, string $a_parent_type, string $a_lang="-")
Check whether page is activated by time schedule.
static _lookupActive(int $a_id, string $a_parent_type, bool $a_check_scheduled_activation=false, string $a_lang="-")
lookup activation status
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)
setTypeWhiteList(array $a_val)
Set type white list.
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc