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") {
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;
125 $this->complete_tree[
"visibility"][$node_id] =
true;
131 $root_id = $this->getTree()->readRootId();
132 if ($this->focus_id > 0 && $this->getTree()->isInTree($this->focus_id) &&
136 return $this->getTree()->getNodeData($root_id);
141 $this->tracker = $a_val;
146 return $this->tracker;
151 $this->highlight_node = $a_val;
156 return $this->highlight_node;
164 if ($a_node[
"child"] == $this->getHighlightNode()) {
175 if ($a_node[
"child"] == $this->getNodeId($this->getRootNode())) {
176 return $this->service->getPresentationStatus()->getLMPresentationTitle();
179 if ($a_node[
"type"] ==
"st") {
183 $this->lm->isActiveNumbering(),
190 } elseif ($a_node[
"type"] ==
"pg") {
193 $this->lm->getPageHeader(),
194 $this->lm->isActiveNumbering(),
195 (
bool) $this->lm_set->get(
"time_scheduled_page_activation"),
201 } elseif ($a_node[
"child"] == $this->getNodeId($this->getRootNode())) {
202 return $this->lm->getTitle();
205 return $a_node[
"title"];
215 if (!$this->getOfflineMode() && $a_node[
"type"] ==
"st") {
216 $icon = $this->checkLPIcon($a_node[
"child"]);
223 if (!$this->getOfflineMode() && $this->lm->getProgressIcons()) {
224 return $this->tracker->getIconForLMObject($a_node, $this->highlight_node);
227 if ($a_node[
"type"] ==
"du") {
228 $a_node[
"type"] =
"lm";
230 $a_name =
"icon_" . $a_node[
"type"] .
".svg";
231 if ($a_node[
"type"] ==
"pg") {
235 $this->lm->getType(),
236 (
bool)
$lm_set->get(
"time_scheduled_page_activation")
240 $img_sc = (
$lm_set->get(
"time_scheduled_page_activation") &&
242 && !$this->getOfflineMode())
246 $a_name =
"icon_pg" . $img_sc .
".svg";
248 if (!$active && !$this->getOfflineMode()) {
249 $a_name =
"icon_pg_d" . $img_sc .
".svg";
263 $orig_node_id = $a_node[
"child"];
267 if (!$this->getOfflineMode()) {
268 if ($this->lm->getRestrictForwardNavigation()) {
269 if ($this->getTracker()->hasPredIncorrectAnswers($orig_node_id)) {
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");
281 $a_node = $this->getSuccessorNode($a_node[
"child"],
"pg");
283 if ($a_node[
"child"] == 0) {
290 if ($this->lm->getTOCMode() !=
"pages") {
291 $a_node = $this->getTree()->fetchSuccessorNode($a_node[
"child"],
"pg");
293 $a_node = $this->getSuccessorNode($a_node[
"child"],
"pg");
297 $this->lm->getType(),
298 (
bool) $this->lm_set->get(
"time_scheduled_page_activation")
301 if ($a_node[
"child"] > 0 && !$active) {
307 if ($a_node[
"child"] <= 0) {
310 $path = $this->getTree()->getPathId($a_node[
"child"]);
311 if (!in_array($orig_node_id,
$path)) {
318 if ($a_node[
"type"] ==
"pg") {
342 if (!$this->getOfflineMode()) {
343 return $this->linker->getLink(
"", $a_node[
"child"]);
346 if ($a_node[
"type"] !=
"pg") {
350 $a_node = $this->getTree()->fetchSuccessorNode($a_node[
"child"],
"pg");
353 $this->lm->getType(),
354 (
bool) $this->lm_set->get(
"time_scheduled_page_activation")
357 if ($a_node[
"child"] > 0 && !$active) {
366 if ($this->export_all_languages) {
367 if ($this->lang !=
"" && $this->lang !=
"-") {
373 return "lm_pg_" . $nid . $lang_suffix .
".html";
375 return "lm_pg_" . $a_node[
"child"] . $lang_suffix .
".html";
384 return (
bool) $this->complete_tree[
"visibility"][$a_node[
"child"]];
393 $this->renderLSTocNode($toc,
null);
399 if ($current_node == 0) {
401 $current_node = $this->tree->getNodeData($this->tree->readRootId());
404 $children = $this->getChildren($current_node);
405 if (count($children) > 0) {
411 $node_icon = $this->getNodeIcon($current_node);
412 if (strpos($node_icon,
"complete")) {
416 $node_toc = $toc->
node($current_node[
"title"], $current_node[
"child"], $lp);
418 foreach ($this->getChildren($current_node) as $child) {
419 $this->renderLSTocNode($node_toc, $child);
423 $highlight = $this->isNodeHighlighted($current_node);
424 $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 _isPagePublic(int $a_node_id, bool $a_check_public_mode=false)
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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)
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
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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 $img, 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