4 include_once(
"./Services/Form/classes/class.ilHierarchyFormGUI.php");
26 $lng->loadLanguageModule(
"sahs");
33 function getMenuItems($a_node, $a_depth, $a_first_child =
false, $a_next_sibling = null, $a_childs = null)
37 include_once(
"./Services/Style/classes/class.ilPageLayout.php");
46 if ($a_node[
"type"] ==
"page" || ($a_node[
"type"] ==
"sco" && count($a_childs) == 0) ||
47 ($a_node[
"type"] ==
"ass" && count($a_childs) == 0))
49 if ($a_node[
"type"] ==
"sco" || $a_node[
"type"] ==
"ass")
51 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_page"),
"cmd" =>
"insertPage",
"multi" => 10,
52 "as_subitem" =>
true);
53 if ($page_layouts > 0)
55 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_pagelayout"),
"cmd" =>
"insertTemplateGUI",
"multi" => 10,
56 "as_subitem" =>
true);
58 if ($special_pages > 0)
60 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_special_page"),
"cmd" =>
"insertSpecialPage",
"multi" => 10,
61 "as_subitem" =>
true);
63 if ($ilUser->clipboardHasObjectsOfType(
"page"))
65 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_page_from_clip"),
66 "cmd" =>
"insertPageClip",
"as_subitem" =>
true);
71 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_page"),
"cmd" =>
"insertPage",
"multi" => 10);
72 if ($page_layouts > 0)
74 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_pagelayout"),
"cmd" =>
"insertTemplateGUI",
"multi" => 10);
76 if ($special_pages > 0)
78 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_special_page"),
"cmd" =>
"insertSpecialPage",
"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"] ==
"chap" || $a_node[
"type"] ==
"seqc")
92 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_ass"),
"cmd" =>
"insertAsset",
"multi" => 10);
93 if (count($a_childs) == 0)
95 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_ass_inside_chap"),
"cmd" =>
"insertAsset",
"multi" => 10,
96 "as_subitem" =>
true);
98 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_sco"),
"cmd" =>
"insertSco",
"multi" => 10);
99 if (count($a_childs) == 0)
101 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_sco_inside_chap"),
"cmd" =>
"insertSco",
"multi" => 10,
102 "as_subitem" =>
true);
104 if ($ilUser->clipboardHasObjectsOfType(
"sco"))
106 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_sco_from_clip"),
107 "cmd" =>
"insertScoClip",
"as_subitem" =>
false);
108 if (count($a_childs) == 0)
110 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_sco_from_clip_inside_chap"),
111 "cmd" =>
"insertScoClip",
"as_subitem" =>
true);
114 if ($ilUser->clipboardHasObjectsOfType(
"ass"))
116 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_ass_from_clip"),
117 "cmd" =>
"insertAssetClip",
"as_subitem" =>
false);
118 if (count($a_childs) == 0)
120 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_ass_from_clip_inside_chap"),
121 "cmd" =>
"insertAssetClip",
"as_subitem" =>
true);
127 if ($a_node[
"type"] ==
"sco" || $a_node[
"type"] ==
"ass")
130 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_sco"),
"cmd" =>
"insertSco",
"multi" => 10);
131 if ($ilUser->clipboardHasObjectsOfType(
"sco"))
133 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_sco_from_clip"),
134 "cmd" =>
"insertScoClip");
138 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_ass"),
"cmd" =>
"insertAsset",
"multi" => 10);
139 if ($ilUser->clipboardHasObjectsOfType(
"ass"))
141 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_ass_from_clip"),
142 "cmd" =>
"insertAssetClip");
146 if ($a_node[
"depth"] == 2)
148 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_chapter"),
"cmd" =>
"insertChapter",
"multi" => 10);
149 if ($ilUser->clipboardHasObjectsOfType(
"chap"))
151 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_chap_from_clip"),
152 "cmd" =>
"insertChapterClip");
162 if ($a_node[
"type"] ==
"chap" || $a_node[
"type"] ==
"seqc")
164 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_chapter"),
"cmd" =>
"insertChapter",
"multi" => 10);
165 if ($ilUser->clipboardHasObjectsOfType(
"chap"))
167 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_chap_from_clip"),
168 "cmd" =>
"insertChapterClip");
178 if ($a_node[
"type"] ==
"" && $a_node[
"node_id"] == 1)
181 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_sco"),
"cmd" =>
"insertSco",
"multi" => 10);
182 if ($ilUser->clipboardHasObjectsOfType(
"sco"))
184 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_sco_from_clip"),
185 "cmd" =>
"insertScoClip");
189 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_ass"),
"cmd" =>
"insertAsset",
"multi" => 10);
190 if ($ilUser->clipboardHasObjectsOfType(
"ass"))
192 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_ass_from_clip"),
193 "cmd" =>
"insertAssetClip");
197 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_chapter"),
"cmd" =>
"insertChapter",
"multi" => 10);
198 if ($ilUser->clipboardHasObjectsOfType(
"chap"))
200 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_chap_from_clip"),
201 "cmd" =>
"insertChapterClip");
205 if ($a_node[
"type"] ==
"chap" || $a_node[
"type"] ==
"seqc")
207 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_sco"),
"cmd" =>
"insertSco",
"multi" => 10);
208 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_ass"),
"cmd" =>
"insertAsset",
"multi" => 10);
209 if ($ilUser->clipboardHasObjectsOfType(
"sco"))
211 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_sco_from_clip"),
212 "cmd" =>
"insertScoClip");
214 if ($ilUser->clipboardHasObjectsOfType(
"ass"))
216 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_ass_from_clip"),
217 "cmd" =>
"insertAssetClip");
220 if ($a_node[
"type"] ==
"sco" || $a_node[
"type"] ==
"ass")
222 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_page"),
"cmd" =>
"insertPage",
"multi" => 10);
223 if ($page_layouts > 0)
225 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_pagelayout"),
"cmd" =>
"insertTemplateGUI",
"multi" => 10);
227 if ($special_pages > 0)
229 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_special_page"),
"cmd" =>
"insertSpecialPage",
"multi" => 10);
232 if ($ilUser->clipboardHasObjectsOfType(
"page"))
234 $cmds[] = array(
"text" => $lng->txt(
"sahs_insert_page_from_clip"),
235 "cmd" =>
"insertPageClip");
253 if ($a_node[
"type"] ==
"pg")
265 function manageDragAndDrop($a_node, $a_depth, $a_first_child_drop_area =
false, $a_next_sibling = null, $a_childs = null)
269 if ($a_node[
"type"] ==
"ass")
278 if (!$a_first_child_drop_area)
281 if ($a_node[
"type"] ==
"page" || ($a_node[
"type"] ==
"sco" && count($a_childs) == 0)
282 || ($a_node[
"type"] ==
"ass" && count($a_childs) == 0))
284 if ($a_node[
"type"] ==
"sco" || $a_node[
"type"] ==
"ass")
286 $this->
makeDragTarget($a_node[
"node_id"],
"grp_page", $a_first_child_drop_area,
291 $this->
makeDragTarget($a_node[
"node_id"],
"grp_page", $a_first_child_drop_area,
296 if ($a_node[
"type"] ==
"chap" && count($a_childs) == 0)
298 $this->
makeDragTarget($a_node[
"node_id"],
"grp_sco", $a_first_child_drop_area,
299 true, $lng->txt(
"cont_insert_into_chap"));
303 if ($a_node[
"type"] ==
"sco" || $a_node[
"type"] ==
"ass" || $a_node[
"type"] ==
"chap")
305 $this->
makeDragTarget($a_node[
"node_id"],
"grp_sco", $a_first_child_drop_area,
306 false, $lng->txt(
"cont_insert_after_".$a_node[
"type"]));
316 if ($a_node[
"depth"] == 2)
318 $this->
makeDragTarget($a_node[
"node_id"],
"grp_chap", $a_first_child_drop_area,
319 false, $lng->txt(
"sahs_insert_as_chapter"));
326 if ($a_node[
"type"] ==
"" && $a_node[
"node_id"] == 1)
328 $this->
makeDragTarget($a_node[
"node_id"],
"grp_chap", $a_first_child_drop_area,
330 $this->
makeDragTarget($a_node[
"node_id"],
"grp_sco", $a_first_child_drop_area,
333 if ($a_node[
"type"] ==
"chap")
335 $this->
makeDragTarget($a_node[
"node_id"],
"grp_sco", $a_first_child_drop_area,
338 if ($a_node[
"type"] ==
"sco" || $a_node[
"type"] ==
"ass")
340 $this->
makeDragTarget($a_node[
"node_id"],
"grp_page", $a_first_child_drop_area,
358 switch ($a_item[
"type"])
361 $ilCtrl->setParameterByClass(
"ilscorm2004scogui",
"obj_id",
363 $commands[] = array(
"text" => $lng->txt(
"edit"),
364 "link" => $ilCtrl->getLinkTargetByClass(array(
"ilobjscorm2004learningmodulegui",
365 "ilscorm2004scogui"),
"showOrganization"));
369 $ilCtrl->setParameterByClass(
"ilscorm2004assetgui",
"obj_id",
371 $commands[] = array(
"text" => $lng->txt(
"edit"),
372 "link" => $ilCtrl->getLinkTargetByClass(array(
"ilobjscorm2004learningmodulegui",
373 "ilscorm2004assetgui"),
"showOrganization"));
377 $ilCtrl->setParameterByClass(
"ilscorm2004chaptergui",
"obj_id",
379 $commands[] = array(
"text" => $lng->txt(
"edit"),
380 "link" => $ilCtrl->getLinkTargetByClass(array(
"ilobjscorm2004learningmodulegui",
381 "ilscorm2004chaptergui"),
"showOrganization"));
385 $ilCtrl->setParameterByClass(
"ilscorm2004seqchaptergui",
"obj_id",
387 $commands[] = array(
"text" => $lng->txt(
"edit"),
388 "link" => $ilCtrl->getLinkTargetByClass(array(
"ilobjscorm2004learningmodulegui",
389 "ilscorm2004seqchaptergui"),
"showOrganization"));
393 $ilCtrl->setParameterByClass(
"ilscorm2004pagenodegui",
"obj_id",
395 $commands[] = array(
"text" => $lng->txt(
"edit"),
396 "link" => $ilCtrl->getLinkTargetByClass(array(
"ilobjscorm2004learningmodulegui",
397 "ilscorm2004pagenodegui"),
"edit"));