ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilLMEditorExplorerGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once("./Modules/LearningModule/classes/class.ilLMExplorerGUI.php");
5
15{
16
20 public function __construct($a_parent_obj, $a_parent_cmd, ilObjContentObject $a_lm, $a_id = "")
21 {
22 global $DIC;
23 parent::__construct($a_parent_obj, $a_parent_cmd, $a_lm, $a_id);
24
25 $this->lng = $DIC->language();
26 $this->ctrl = $DIC->ctrl();
27 }
28
29
36 public function getNodeIcon($a_node)
37 {
38 if ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
39 $icon = ilUtil::getImagePath("icon_lm.svg");
40 } else {
41 $a_name = "icon_" . $a_node["type"] . ".svg";
42 if ($a_node["type"] == "pg") {
43 include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
44 $lm_set = new ilSetting("lm");
46 $a_node["child"],
47 $this->lm->getType(),
48 $lm_set->get("time_scheduled_page_activation")
49 );
50
51 // is page scheduled?
52 $img_sc = ($lm_set->get("time_scheduled_page_activation") &&
53 ilLMPage::_isScheduledActivation($a_node["child"], $this->lm->getType()))
54 ? "_sc"
55 : "";
56
57 $a_name = "icon_pg" . $img_sc . ".svg";
58
59 if (!$active) {
60 $a_name = "icon_pg_d" . $img_sc . ".svg";
61 } else {
62 include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
64 $a_node["child"],
65 $this->lm->getType()
66 );
67 if ($contains_dis) {
68 $a_name = "icon_pg_del" . $img_sc . ".svg";
69 }
70 }
71 }
72 $icon = ilUtil::getImagePath($a_name);
73 }
74
75 return $icon;
76 }
77
84 public function getNodeIconAlt($a_node)
85 {
87
88 include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
89
90 if ($a_node["type"] == "du") {
91 $a_node["type"] = "lm";
92 }
93
94 if ($a_node["type"] == "pg") {
95 include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
96 $lm_set = new ilSetting("lm");
98 $a_node["child"],
99 $this->lm->getType(),
100 $lm_set->get("time_scheduled_page_activation")
101 );
102
103 if (!$active) {
104 return $lng->txt("cont_page_deactivated");
105 } else {
107 $a_node["child"],
108 $this->lm->getType()
109 );
110 if ($contains_dis) {
111 return $lng->txt("cont_page_deactivated_elements");
112 }
113 }
114 }
115 return parent::getNodeIconAlt($a_node);
116 }
117
124 public function getNodeHref($a_node)
125 {
127
128 switch ($a_node["type"]) {
129 case "du":
130// $ilCtrl->setParameterByClass("ilobjlearningmodulegui", "obj_id", $a_node["child"]);
131 $ret = $ilCtrl->getLinkTargetByClass("ilobjlearningmodulegui", "chapters");
132// $ilCtrl->setParameterByClass("ilobjlearningmodulegui", "obj_id", $_GET["obj_id"]);
133 return $ret;
134 break;
135
136 case "pg":
137 $ilCtrl->setParameterByClass("illmpageobjectgui", "obj_id", $a_node["child"]);
138 $ret = $ilCtrl->getLinkTargetByClass(array("ilobjlearningmodulegui", "illmpageobjectgui"), "edit");
139 $ilCtrl->setParameterByClass("illmpageobjectgui", "obj_id", $_GET["obj_id"]);
140 return $ret;
141 break;
142
143 case "st":
144 $ilCtrl->setParameterByClass("ilstructureobjectgui", "obj_id", $a_node["child"]);
145 $ret = $ilCtrl->getLinkTargetByClass(array("ilobjlearningmodulegui", "ilstructureobjectgui"), "view");
146 $ilCtrl->setParameterByClass("ilstructureobjectgui", "obj_id", $_GET["obj_id"]);
147 return $ret;
148 break;
149 }
150 }
151}
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
LM editor explorer GUI class.
getNodeIconAlt($a_node)
Get node icon alt text.
__construct($a_parent_obj, $a_parent_cmd, ilObjContentObject $a_lm, $a_id="")
Constructor.
getNodeHref($a_node)
Get href for node.
getNodeIcon($a_node)
Get node icon.
LM editor explorer GUI class.
Class ilObjContentObject.
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
static _lookupContainsDeactivatedElements($a_id, $a_parent_type, $a_lang="-")
lookup whether page contains deactivated elements
static _isScheduledActivation($a_id, $a_parent_type, $a_lang="-")
Check whether page is activated by time schedule.
ILIAS Setting Class.
getNodeId($a_node)
Get id for node.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
global $ilCtrl
Definition: ilias.php:18
$ret
Definition: parser.php:6
global $DIC
Definition: saml.php:7
$lm_set