ILIAS  release_7 Revision v7.30-3-g800a261c036
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
4
14{
15
19 public function __construct($a_parent_obj, $a_parent_cmd, ilObjContentObject $a_lm, $a_id = "")
20 {
21 global $DIC;
22 parent::__construct($a_parent_obj, $a_parent_cmd, $a_lm, $a_id);
23
24 $this->lng = $DIC->language();
25 $this->ctrl = $DIC->ctrl();
26 }
27
28
35 public function getNodeIcon($a_node)
36 {
37 if ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
38 $icon = ilUtil::getImagePath("icon_lm.svg");
39 } else {
40 $a_name = "icon_" . $a_node["type"] . ".svg";
41 if ($a_node["type"] == "pg") {
42 $lm_set = new ilSetting("lm");
44 $a_node["child"],
45 $this->lm->getType(),
46 $lm_set->get("time_scheduled_page_activation")
47 );
48
49 // is page scheduled?
50 $img_sc = ($lm_set->get("time_scheduled_page_activation") &&
51 ilLMPage::_isScheduledActivation($a_node["child"], $this->lm->getType()))
52 ? "_sc"
53 : "";
54
55 $a_name = "icon_pg" . $img_sc . ".svg";
56
57 if (!$active) {
58 $a_name = "icon_pg_d" . $img_sc . ".svg";
59 } else {
61 $a_node["child"],
62 $this->lm->getType()
63 );
64 if ($contains_dis) {
65 $a_name = "icon_pg_del" . $img_sc . ".svg";
66 }
67 }
68 }
69 $icon = ilUtil::getImagePath($a_name);
70 }
71
72 return $icon;
73 }
74
81 public function getNodeIconAlt($a_node)
82 {
84
85 if ($a_node["type"] == "du") {
86 $a_node["type"] = "lm";
87 }
88
89 if ($a_node["type"] == "pg") {
90 $lm_set = new ilSetting("lm");
92 $a_node["child"],
93 $this->lm->getType(),
94 $lm_set->get("time_scheduled_page_activation")
95 );
96
97 if (!$active) {
98 return $lng->txt("cont_page_deactivated");
99 } else {
101 $a_node["child"],
102 $this->lm->getType()
103 );
104 if ($contains_dis) {
105 return $lng->txt("cont_page_deactivated_elements");
106 }
107 }
108 }
109 return parent::getNodeIconAlt($a_node);
110 }
111
118 public function getNodeHref($a_node)
119 {
120 $ilCtrl = $this->ctrl;
121
122 switch ($a_node["type"]) {
123 case "du":
124 $ilCtrl->setParameterByClass("ilobjlearningmodulegui", "obj_id", null);
125 $ret = $ilCtrl->getLinkTargetByClass("ilobjlearningmodulegui", "chapters");
126 $ilCtrl->setParameterByClass("ilobjlearningmodulegui", "obj_id", $_GET["obj_id"]);
127 return $ret;
128 break;
129
130 case "pg":
131 $ilCtrl->setParameterByClass("illmpageobjectgui", "obj_id", $a_node["child"]);
132 $ret = $ilCtrl->getLinkTargetByClass(array("ilobjlearningmodulegui", "illmpageobjectgui"), "edit");
133 $ilCtrl->setParameterByClass("illmpageobjectgui", "obj_id", $_GET["obj_id"]);
134 return $ret;
135 break;
136
137 case "st":
138 $ilCtrl->setParameterByClass("ilstructureobjectgui", "obj_id", $a_node["child"]);
139 $ret = $ilCtrl->getLinkTargetByClass(array("ilobjlearningmodulegui", "ilstructureobjectgui"), "view");
140 $ilCtrl->setParameterByClass("ilstructureobjectgui", "obj_id", $_GET["obj_id"]);
141 return $ret;
142 break;
143 }
144 }
145}
$_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 $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$ret
Definition: parser.php:6
$lm_set