ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilLMEditorExplorerGUI.php
Go to the documentation of this file.
1<?php
2
25{
30 public function __construct(
31 $a_parent_obj,
32 string $a_parent_cmd,
34 string $a_id = ""
35 ) {
36 global $DIC;
37 parent::__construct($a_parent_obj, $a_parent_cmd, $a_lm, $a_id);
38
39 $this->lng = $DIC->language();
40 $this->ctrl = $DIC->ctrl();
41 }
42
43
47 public function getNodeIcon($a_node): string
48 {
49 if ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
50 $icon = ilUtil::getImagePath("standard/icon_lm.svg");
51 } else {
52 $a_name = "standard/icon_" . $a_node["type"] . ".svg";
53 if ($a_node["type"] == "pg") {
54 $lm_set = new ilSetting("lm");
56 $a_node["child"],
57 $this->lm->getType(),
58 (bool) $lm_set->get("time_scheduled_page_activation")
59 );
60
61 // is page scheduled?
62 $img_sc = ($lm_set->get("time_scheduled_page_activation") &&
63 ilLMPage::_isScheduledActivation($a_node["child"], $this->lm->getType()))
64 ? "_sc"
65 : "";
66
67 $a_name = "standard/icon_pg" . $img_sc . ".svg";
68
69 if (!$active) {
70 $a_name = "standard/icon_pg_d" . $img_sc . ".svg";
71 } else {
73 $a_node["child"],
74 $this->lm->getType()
75 );
76 if ($contains_dis) {
77 $a_name = "standard/icon_pg_del" . $img_sc . ".svg";
78 }
79 }
80 }
81 $icon = ilUtil::getImagePath($a_name);
82 }
83
84 return $icon;
85 }
86
90 public function getNodeIconAlt($a_node): string
91 {
93
94 if ($a_node["type"] == "du") {
95 $a_node["type"] = "lm";
96 }
97
98 if ($a_node["type"] == "pg") {
99 $lm_set = new ilSetting("lm");
100 $active = ilLMPage::_lookupActive(
101 $a_node["child"],
102 $this->lm->getType(),
103 (bool) $lm_set->get("time_scheduled_page_activation")
104 );
105
106 if (!$active) {
107 return $lng->txt("cont_page_deactivated");
108 } else {
110 $a_node["child"],
111 $this->lm->getType()
112 );
113 if ($contains_dis) {
114 return $lng->txt("cont_page_deactivated_elements");
115 }
116 }
117 }
118 return parent::getNodeIconAlt($a_node);
119 }
120
124 public function getNodeHref($a_node): string
125 {
126 $ilCtrl = $this->ctrl;
127
128 if ($a_node["child"] == "") {
129 $a_node["child"] = null;
130 }
131 $obj_id = ($this->obj_id == "")
132 ? null
133 : $this->obj_id;
134
135 switch ($a_node["type"]) {
136 case "du":
137 $ilCtrl->setParameterByClass("ilobjlearningmodulegui", "obj_id", null);
138 $ret = $ilCtrl->getLinkTargetByClass("ilobjlearningmodulegui", "chapters");
139 return $ret;
140
141 case "pg":
142 $ilCtrl->setParameterByClass("illmpageobjectgui", "obj_id", $a_node["child"]);
143 $ret = $ilCtrl->getLinkTargetByClass(array("ilobjlearningmodulegui", "illmpageobjectgui"), "edit");
144 $ilCtrl->setParameterByClass("illmpageobjectgui", "obj_id", $obj_id);
145 return $ret;
146
147 case "st":
148 $ilCtrl->setParameterByClass("ilstructureobjectgui", "obj_id", $a_node["child"]);
149 $ret = $ilCtrl->getLinkTargetByClass(array("ilobjlearningmodulegui", "ilstructureobjectgui"), "view");
150 $ilCtrl->setParameterByClass("ilstructureobjectgui", "obj_id", $obj_id);
151 return $ret;
152 }
153 return "";
154 }
155}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct( $a_parent_obj, string $a_parent_cmd, ilObjContentObject $a_lm, string $a_id="")
ilLMEditorExplorerGUI constructor.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
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 _lookupContainsDeactivatedElements(int $a_id, string $a_parent_type, string $a_lang="-")
lookup whether page contains deactivated elements
ILIAS Setting Class.
getNodeId($a_node)
Get id for node.
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
global $DIC
Definition: shib_login.php:26
$lm_set