5 include_once(
"./Services/Form/classes/class.ilHierarchyFormGUI.php");
6 include_once(
"./Modules/LearningModule/classes/class.ilLMObjTranslation.php");
25 $this->lm_type = $a_lm_type;
27 $this->lang = ($a_lang ==
"")
30 parent::__construct();
42 if ($this->lang !=
"-")
45 return $lmobjtrans->getTitle();
47 return $a_child[
"title"];
58 if ($this->lang !=
"-")
60 return $a_child[
"title"];
68 function getMenuItems($a_node, $a_depth, $a_first_child =
false, $a_next_sibling = null, $a_childs = null)
76 if ($a_node[
"type"] ==
"pg" || ($a_node[
"type"] ==
"st" && count($a_childs) == 0 && $this->
getMaxDepth() != 0))
78 if ($a_node[
"type"] ==
"st")
80 $cmds[] =
array(
"text" => $lng->txt(
"cont_insert_page"),
"cmd" =>
"insertPage",
"multi" => 10,
81 "as_subitem" =>
true);
82 if ($ilUser->clipboardHasObjectsOfType(
"pg"))
84 $cmds[] =
array(
"text" => $lng->txt(
"cont_insert_page_from_clip"),
85 "cmd" =>
"insertPageClip",
"as_subitem" =>
true);
90 $cmds[] =
array(
"text" => $lng->txt(
"cont_insert_page"),
"cmd" =>
"insertPage",
"multi" => 10);
91 if ($ilUser->clipboardHasObjectsOfType(
"pg"))
93 $cmds[] =
array(
"text" => $lng->txt(
"cont_insert_page_from_clip"),
94 "cmd" =>
"insertPageClip");
98 if ($a_node[
"type"] !=
"pg" && $this->
getMaxDepth() != 0)
100 $cmds[] =
array(
"text" => $lng->txt(
"cont_insert_subchapter"),
101 "cmd" =>
"insertSubchapter",
"multi" => 10);
102 if ($ilUser->clipboardHasObjectsOfType(
"st"))
104 $cmds[] =
array(
"text" => $lng->txt(
"cont_insert_subchapter_from_clip"),
105 "cmd" =>
"insertSubchapterClip");
109 if (($a_next_sibling[
"type"] !=
"pg" && ($a_depth == 0 || $a_next_sibling[
"type"] ==
"st"))
110 || $a_node[
"type"] ==
"st")
112 $cmds[] =
array(
"text" => $lng->txt(
"cont_insert_chapter"),
113 "cmd" =>
"insertChapter",
"multi" => 10);
114 if ($ilUser->clipboardHasObjectsOfType(
"st"))
116 $cmds[] =
array(
"text" => $lng->txt(
"cont_insert_chapter_from_clip"),
117 "cmd" =>
"insertChapterClip");
123 if ($a_node[
"type"] ==
"st" && $this->
getMaxDepth() != 0)
125 $cmds[] =
array(
"text" => $lng->txt(
"cont_insert_page"),
126 "cmd" =>
"insertPage",
"multi" => 10);
127 if ($ilUser->clipboardHasObjectsOfType(
"pg"))
129 $cmds[] =
array(
"text" => $lng->txt(
"cont_insert_page_from_clip"),
130 "cmd" =>
"insertPageClip");
133 if ($a_childs[0][
"type"] !=
"pg")
135 $cmds[] =
array(
"text" => $lng->txt(
"cont_insert_chapter"),
136 "cmd" =>
"insertChapter",
"multi" => 10);
137 if ($ilUser->clipboardHasObjectsOfType(
"st"))
139 $cmds[] =
array(
"text" => $lng->txt(
"cont_insert_chapter_from_clip"),
140 "cmd" =>
"insertChapterClip");
153 if ($a_node[
"type"] ==
"pg")
165 function manageDragAndDrop($a_node, $a_depth, $a_first_child_drop_area =
false, $a_next_sibling = null, $a_childs = null)
171 if (!$a_first_child_drop_area)
173 if ($a_node[
"type"] ==
"pg" || ($a_node[
"type"] ==
"st" && count($a_childs) == 0 && $this->
getMaxDepth() != 0))
175 if ($a_node[
"type"] ==
"st")
177 $this->
makeDragTarget($a_node[
"node_id"],
"grp_pg", $a_first_child_drop_area,
182 $this->
makeDragTarget($a_node[
"node_id"],
"grp_pg", $a_first_child_drop_area,
187 if ($a_node[
"type"] !=
"pg" && $this->
getMaxDepth() != 0)
189 $this->
makeDragTarget($a_node[
"node_id"],
"grp_st", $a_first_child_drop_area,
190 true, $lng->txt(
"cont_insert_as_subchapter"));
193 if (($a_next_sibling[
"type"] !=
"pg" && ($a_depth == 0 || $a_next_sibling[
"type"] ==
"st"))
194 || $a_node[
"type"] ==
"st")
196 $this->
makeDragTarget($a_node[
"node_id"],
"grp_st", $a_first_child_drop_area,
197 false, $lng->txt(
"cont_insert_as_chapter"));
202 if ($a_node[
"type"] ==
"st" && $this->
getMaxDepth() != 0)
204 $this->
makeDragTarget($a_node[
"node_id"],
"grp_pg", $a_first_child_drop_area,
207 if ($a_childs[0][
"type"] !=
"pg")
209 $this->
makeDragTarget($a_node[
"node_id"],
"grp_st", $a_first_child_drop_area,
223 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
225 $img =
"icon_".$a_item[
"type"].
".svg";
227 if ($a_item[
"type"] ==
"pg")
229 include_once(
"./Modules/LearningModule/classes/class.ilLMPage.php");
232 $lm_set->get(
"time_scheduled_page_activation"));
235 $img_sc = (
$lm_set->get(
"time_scheduled_page_activation") &&
240 $img =
"icon_pg".$img_sc.
".svg";
244 $img =
"icon_pg_d".$img_sc.
".svg";
248 include_once(
"./Modules/LearningModule/classes/class.ilLMPage.php");
253 $img =
"icon_pg_del".$img_sc.
".svg";
270 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
272 if ($a_item[
"type"] ==
"pg")
274 include_once(
"./Modules/LearningModule/classes/class.ilLMPage.php");
279 return $lng->txt(
"cont_page_deactivated");
283 include_once(
"./Modules/LearningModule/classes/class.ilLMPage.php");
288 return $lng->txt(
"cont_page_deactivated_elements");
305 $lm_class =
"ilobjlearningmodulegui";
308 switch ($a_item[
"type"])
311 $ilCtrl->setParameterByClass(
"illmpageobjectgui",
"obj_id",
313 $commands[] =
array(
"text" => $lng->txt(
"edit"),
314 "link" => $ilCtrl->getLinkTargetByClass(
array($lm_class,
"illmpageobjectgui"),
"edit"));
318 $ilCtrl->setParameterByClass(
"ilstructureobjectgui",
"obj_id",
320 $commands[] =
array(
"text" => $lng->txt(
"edit"),
321 "link" => $ilCtrl->getLinkTargetByClass(
array($lm_class,
"ilstructureobjectgui"),
"view"));
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Create styles array
The data for the language used.
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.
Translation information on lm object.