ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
23 function getNodeIcon($a_node)
24 {
25 if ($a_node["child"] == $this->getNodeId($this->getRootNode()))
26 {
27 $icon = ilUtil::getImagePath("icon_lm.svg");
28 }
29 else
30 {
31 $a_name = "icon_".$a_node["type"].".svg";
32 if ($a_node["type"] == "pg")
33 {
34 include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
35 $lm_set = new ilSetting("lm");
36 $active = ilLMPage::_lookupActive($a_node["child"], $this->lm->getType(),
37 $lm_set->get("time_scheduled_page_activation"));
38
39 // is page scheduled?
40 $img_sc = ($lm_set->get("time_scheduled_page_activation") &&
41 ilLMPage::_isScheduledActivation($a_node["child"], $this->lm->getType()))
42 ? "_sc"
43 : "";
44
45 $a_name = "icon_pg".$img_sc.".svg";
46
47 if (!$active)
48 {
49 $a_name = "icon_pg_d".$img_sc.".svg";
50 }
51 else
52 {
53 include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
54 $contains_dis = ilLMPage::_lookupContainsDeactivatedElements($a_node["child"],
55 $this->lm->getType());
56 if ($contains_dis)
57 {
58 $a_name = "icon_pg_del".$img_sc.".svg";
59 }
60 }
61 }
62 $icon = ilUtil::getImagePath($a_name);
63 }
64
65 return $icon;
66 }
67
74 function getNodeIconAlt($a_node)
75 {
76 global $lng;
77
78 include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
79
80 if ($a_node["type"] == "du")
81 {
82 $a_node["type"] = "lm";
83 }
84
85 if ($a_node["type"] == "pg")
86 {
87 include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
88 $lm_set = new ilSetting("lm");
89 $active = ilLMPage::_lookupActive($a_node["child"], $this->lm->getType(),
90 $lm_set->get("time_scheduled_page_activation"));
91
92 if (!$active)
93 {
94 return $lng->txt("cont_page_deactivated");
95 }
96 else
97 {
98 $contains_dis = ilLMPage::_lookupContainsDeactivatedElements($a_node["child"],
99 $this->lm->getType());
100 if ($contains_dis)
101 {
102 return $lng->txt("cont_page_deactivated_elements");
103 }
104 }
105 }
106 return parent::getNodeIconAlt($a_node);
107 }
108
115 function getNodeHref($a_node)
116 {
117 global $ilCtrl;
118
119 switch($a_node["type"])
120 {
121 case "du":
122// $ilCtrl->setParameterByClass("ilobjlearningmodulegui", "obj_id", $a_node["child"]);
123 $ret = $ilCtrl->getLinkTargetByClass("ilobjlearningmodulegui", "chapters");
124// $ilCtrl->setParameterByClass("ilobjlearningmodulegui", "obj_id", $_GET["obj_id"]);
125 return $ret;
126 break;
127
128 case "pg":
129 $ilCtrl->setParameterByClass("illmpageobjectgui", "obj_id", $a_node["child"]);
130 $ret = $ilCtrl->getLinkTargetByClass(array("ilobjlearningmodulegui", "illmpageobjectgui"), "edit");
131 $ilCtrl->setParameterByClass("illmpageobjectgui", "obj_id", $_GET["obj_id"]);
132 return $ret;
133 break;
134
135 case "st":
136 $ilCtrl->setParameterByClass("ilstructureobjectgui", "obj_id", $a_node["child"]);
137 $ret = $ilCtrl->getLinkTargetByClass(array("ilobjlearningmodulegui", "ilstructureobjectgui"), "view");
138 $ilCtrl->setParameterByClass("ilstructureobjectgui", "obj_id", $_GET["obj_id"]);
139 return $ret;
140 break;
141 }
142 }
143
144}
145
146?>
$_GET["client_id"]
LM editor explorer GUI class.
getNodeIconAlt($a_node)
Get node icon alt text.
getNodeHref($a_node)
Get href for node.
getNodeIcon($a_node)
Get node icon.
LM editor explorer GUI class.
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
global $lng
Definition: privfeed.php:40
$lm_set