5 include_once(
"./Services/Form/classes/class.ilHierarchyFormGUI.php");
24 $this->lm_type = $a_lm_type;
33 function getMenuItems($a_node, $a_depth, $a_first_child =
false, $a_next_sibling = null, $a_childs = null)
41 if ($a_node[
"type"] ==
"pg" || ($a_node[
"type"] ==
"st" && count($a_childs) == 0 && $this->
getMaxDepth() != 0))
43 if ($a_node[
"type"] ==
"st")
45 $cmds[] = array(
"text" => $lng->txt(
"cont_insert_page"),
"cmd" =>
"insertPage",
"multi" => 10,
46 "as_subitem" =>
true);
47 if ($ilUser->clipboardHasObjectsOfType(
"pg"))
49 $cmds[] = array(
"text" => $lng->txt(
"cont_insert_page_from_clip"),
50 "cmd" =>
"insertPageClip",
"as_subitem" =>
true);
55 $cmds[] = array(
"text" => $lng->txt(
"cont_insert_page"),
"cmd" =>
"insertPage",
"multi" => 10);
56 if ($ilUser->clipboardHasObjectsOfType(
"pg"))
58 $cmds[] = array(
"text" => $lng->txt(
"cont_insert_page_from_clip"),
59 "cmd" =>
"insertPageClip");
63 if ($a_node[
"type"] !=
"pg" && $this->
getMaxDepth() != 0)
65 $cmds[] = array(
"text" => $lng->txt(
"cont_insert_subchapter"),
66 "cmd" =>
"insertSubchapter",
"multi" => 10);
67 if ($ilUser->clipboardHasObjectsOfType(
"st"))
69 $cmds[] = array(
"text" => $lng->txt(
"cont_insert_subchapter_from_clip"),
70 "cmd" =>
"insertSubchapterClip");
74 if (($a_next_sibling[
"type"] !=
"pg" && ($a_depth == 0 || $a_next_sibling[
"type"] ==
"st"))
75 || $a_node[
"type"] ==
"st")
77 $cmds[] = array(
"text" => $lng->txt(
"cont_insert_chapter"),
78 "cmd" =>
"insertChapter",
"multi" => 10);
79 if ($ilUser->clipboardHasObjectsOfType(
"st"))
81 $cmds[] = array(
"text" => $lng->txt(
"cont_insert_chapter_from_clip"),
82 "cmd" =>
"insertChapterClip");
88 if ($a_node[
"type"] ==
"st" && $this->
getMaxDepth() != 0)
90 $cmds[] = array(
"text" => $lng->txt(
"cont_insert_page"),
91 "cmd" =>
"insertPage",
"multi" => 10);
92 if ($ilUser->clipboardHasObjectsOfType(
"pg"))
94 $cmds[] = array(
"text" => $lng->txt(
"cont_insert_page_from_clip"),
95 "cmd" =>
"insertPageClip");
98 if ($a_childs[0][
"type"] !=
"pg")
100 $cmds[] = array(
"text" => $lng->txt(
"cont_insert_chapter"),
101 "cmd" =>
"insertChapter",
"multi" => 10);
102 if ($ilUser->clipboardHasObjectsOfType(
"st"))
104 $cmds[] = array(
"text" => $lng->txt(
"cont_insert_chapter_from_clip"),
105 "cmd" =>
"insertChapterClip");
118 if ($a_node[
"type"] ==
"pg")
130 function manageDragAndDrop($a_node, $a_depth, $a_first_child_drop_area =
false, $a_next_sibling = null, $a_childs = null)
136 if (!$a_first_child_drop_area)
138 if ($a_node[
"type"] ==
"pg" || ($a_node[
"type"] ==
"st" && count($a_childs) == 0 && $this->
getMaxDepth() != 0))
140 if ($a_node[
"type"] ==
"st")
142 $this->
makeDragTarget($a_node[
"node_id"],
"grp_pg", $a_first_child_drop_area,
147 $this->
makeDragTarget($a_node[
"node_id"],
"grp_pg", $a_first_child_drop_area,
152 if ($a_node[
"type"] !=
"pg" && $this->
getMaxDepth() != 0)
154 $this->
makeDragTarget($a_node[
"node_id"],
"grp_st", $a_first_child_drop_area,
155 true, $lng->txt(
"cont_insert_as_subchapter"));
158 if (($a_next_sibling[
"type"] !=
"pg" && ($a_depth == 0 || $a_next_sibling[
"type"] ==
"st"))
159 || $a_node[
"type"] ==
"st")
161 $this->
makeDragTarget($a_node[
"node_id"],
"grp_st", $a_first_child_drop_area,
162 false, $lng->txt(
"cont_insert_as_chapter"));
167 if ($a_node[
"type"] ==
"st" && $this->
getMaxDepth() != 0)
169 $this->
makeDragTarget($a_node[
"node_id"],
"grp_pg", $a_first_child_drop_area,
172 if ($a_childs[0][
"type"] !=
"pg")
174 $this->
makeDragTarget($a_node[
"node_id"],
"grp_st", $a_first_child_drop_area,
188 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
190 $img =
"icon_".$a_item[
"type"].
".gif";
192 if ($a_item[
"type"] ==
"pg")
194 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
197 $lm_set->get(
"time_scheduled_page_activation"));
200 $img_sc = ($lm_set->get(
"time_scheduled_page_activation") &&
205 $img =
"icon_pg".$img_sc.
".gif";
209 $img =
"icon_pg_d".$img_sc.
".gif";
213 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
218 $img =
"icon_pg_del".$img_sc.
".gif";
235 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
237 if ($a_item[
"type"] ==
"pg")
239 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
244 return $lng->txt(
"cont_page_deactivated");
248 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
253 return $lng->txt(
"cont_page_deactivated_elements");
270 $lm_class = ($this->lm_type ==
"lm")
271 ?
"ilobjlearningmodulegui"
275 switch ($a_item[
"type"])
278 $ilCtrl->setParameterByClass(
"illmpageobjectgui",
"obj_id",
280 $commands[] = array(
"text" => $lng->txt(
"edit"),
281 "link" => $ilCtrl->getLinkTargetByClass(array($lm_class,
"illmpageobjectgui"),
"edit"));
285 $ilCtrl->setParameterByClass(
"ilstructureobjectgui",
"obj_id",
287 $commands[] = array(
"text" => $lng->txt(
"edit"),
288 "link" => $ilCtrl->getLinkTargetByClass(array($lm_class,
"ilstructureobjectgui"),
"view"));