24 include_once(
"./Services/Form/classes/class.ilHierarchyFormGUI.php");
46 $lng->loadLanguageModule(
"sahs");
53 function getMenuItems($a_node, $a_depth, $a_first_child =
false, $a_next_sibling = null, $a_childs)
62 if ($a_node[
"type"] ==
"page" || ($a_node[
"type"] ==
"sco" && count($a_childs) == 0))
64 if ($a_node[
"type"] ==
"sco")
66 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_page"),
"cmd" =>
"insertPage",
"multi" => 10,
67 "as_subitem" =>
true);
68 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_pagelayout"),
"cmd" =>
"insertTemplateGUI",
"multi" => 10,
69 "as_subitem" =>
true);
70 if ($ilUser->clipboardHasObjectsOfType(
"page"))
72 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_page_from_clip"),
73 "cmd" =>
"insertPageClip",
"as_subitem" =>
true);
78 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_page"),
"cmd" =>
"insertPage",
"multi" => 10);
79 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_pagelayout"),
"cmd" =>
"insertTemplateGUI",
"multi" => 10);
81 if ($ilUser->clipboardHasObjectsOfType(
"page"))
83 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_page_from_clip"),
84 "cmd" =>
"insertPageClip");
90 if ($a_node[
"type"] ==
"sco" || (($a_node[
"type"] ==
"chap" || $a_node[
"type"] ==
"seqc") && count($a_childs) == 0))
92 if ($a_node[
"type"] ==
"chap" || $a_node[
"type"] ==
"seqc")
94 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_sco"),
"cmd" =>
"insertSco",
"multi" => 10,
95 "as_subitem" =>
true);
96 if ($ilUser->clipboardHasObjectsOfType(
"sco"))
98 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_sco_from_clip"),
99 "cmd" =>
"insertScoClip",
"as_subitem" =>
true);
104 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_sco"),
"cmd" =>
"insertSco",
"multi" => 10);
105 if ($ilUser->clipboardHasObjectsOfType(
"sco"))
107 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_sco_from_clip"),
108 "cmd" =>
"insertScoClip");
118 if ($a_node[
"type"] ==
"chap" || $a_node[
"type"] ==
"seqc")
120 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_chapter"),
"cmd" =>
"insertChapter",
"multi" => 10);
121 if ($ilUser->clipboardHasObjectsOfType(
"chap"))
123 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_chap_from_clip"),
124 "cmd" =>
"insertChapterClip");
134 if ($a_node[
"type"] ==
"" && $a_node[
"node_id"] == 1)
137 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_chapter"),
"cmd" =>
"insertChapter",
"multi" => 10);
138 if ($ilUser->clipboardHasObjectsOfType(
"chap"))
140 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_chap_from_clip"),
141 "cmd" =>
"insertChapterClip");
145 if ($a_node[
"type"] ==
"chap" || $a_node[
"type"] ==
"seqc")
147 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_sco"),
"cmd" =>
"insertSco",
"multi" => 10);
148 if ($ilUser->clipboardHasObjectsOfType(
"sco"))
150 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_sco_from_clip"),
151 "cmd" =>
"insertScoClip");
154 if ($a_node[
"type"] ==
"sco")
156 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_page"),
"cmd" =>
"insertPage",
"multi" => 10);
157 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_pagelayout"),
"cmd" =>
"insertTemplateGUI",
"multi" => 10);
158 if ($ilUser->clipboardHasObjectsOfType(
"page"))
160 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_page_from_clip"),
161 "cmd" =>
"insertPageClip");
179 if ($a_node[
"type"] ==
"pg")
191 function manageDragAndDrop($a_node, $a_depth, $a_first_child_drop_area =
false, $a_next_sibling = null, $a_childs = null)
197 if (!$a_first_child_drop_area)
200 if ($a_node[
"type"] ==
"page" || ($a_node[
"type"] ==
"sco" && count($a_childs) == 0))
202 if ($a_node[
"type"] ==
"sco")
204 $this->
makeDragTarget($a_node[
"node_id"],
"grp_page", $a_first_child_drop_area,
209 $this->
makeDragTarget($a_node[
"node_id"],
"grp_page", $a_first_child_drop_area,
215 if ($a_node[
"type"] ==
"sco" || ($a_node[
"type"] ==
"chap" && count($a_childs) == 0))
217 if ($a_node[
"type"] ==
"chap")
219 $this->
makeDragTarget($a_node[
"node_id"],
"grp_sco", $a_first_child_drop_area,
224 $this->
makeDragTarget($a_node[
"node_id"],
"grp_sco", $a_first_child_drop_area,
236 if ($a_node[
"type"] ==
"chap")
238 $this->
makeDragTarget($a_node[
"node_id"],
"grp_chap", $a_first_child_drop_area,
239 false, $lng->txt(
"sahs_insert_as_chapter"));
244 if ($a_node[
"type"] ==
"" && $a_node[
"node_id"] == 1)
246 $this->
makeDragTarget($a_node[
"node_id"],
"grp_chap", $a_first_child_drop_area,
249 if ($a_node[
"type"] ==
"chap")
251 $this->
makeDragTarget($a_node[
"node_id"],
"grp_sco", $a_first_child_drop_area,
254 if ($a_node[
"type"] ==
"sco")
256 $this->
makeDragTarget($a_node[
"node_id"],
"grp_page", $a_first_child_drop_area,
274 switch ($a_item[
"type"])
277 $ilCtrl->setParameterByClass(
"ilscorm2004scogui",
"obj_id",
279 $commands[] = array(
"text" => $lng->txt(
"edit"),
280 "link" => $ilCtrl->getLinkTargetByClass(array(
"ilobjscorm2004learningmodulegui",
281 "ilscorm2004scogui"),
"showOrganization"));
285 $ilCtrl->setParameterByClass(
"ilscorm2004chaptergui",
"obj_id",
287 $commands[] = array(
"text" => $lng->txt(
"edit"),
288 "link" => $ilCtrl->getLinkTargetByClass(array(
"ilobjscorm2004learningmodulegui",
289 "ilscorm2004chaptergui"),
"showOrganization"));
293 $ilCtrl->setParameterByClass(
"ilscorm2004seqchaptergui",
"obj_id",
295 $commands[] = array(
"text" => $lng->txt(
"edit"),
296 "link" => $ilCtrl->getLinkTargetByClass(array(
"ilobjscorm2004learningmodulegui",
297 "ilscorm2004seqchaptergui"),
"showOrganization"));
301 $ilCtrl->setParameterByClass(
"ilscorm2004pagenodegui",
"obj_id",
303 $commands[] = array(
"text" => $lng->txt(
"edit"),
304 "link" => $ilCtrl->getLinkTargetByClass(array(
"ilobjscorm2004learningmodulegui",
305 "ilscorm2004pagenodegui"),
"edit"));