4 include_once(
"./Services/Form/classes/class.ilHierarchyFormGUI.php");
24 parent::__construct();
26 $lng->loadLanguageModule(
"sahs");
33 function getMenuItems($a_node, $a_depth, $a_first_child =
false, $a_next_sibling = null, $a_childs = null)
38 include_once(
"./Modules/LearningModule/classes/class.ilEditClipboard.php");
40 include_once(
"./Services/COPage/Layout/classes/class.ilPageLayout.php");
49 if ($a_node[
"type"] ==
"page" || ($a_node[
"type"] ==
"sco" && count($a_childs) == 0) ||
50 ($a_node[
"type"] ==
"ass" && count($a_childs) == 0))
52 if ($a_node[
"type"] ==
"sco" || $a_node[
"type"] ==
"ass")
54 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_page"),
"cmd" =>
"insertPage",
"multi" => 10,
55 "as_subitem" =>
true);
56 if ($page_layouts > 0)
58 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_pagelayout"),
"cmd" =>
"insertTemplateGUI",
"multi" => 10,
59 "as_subitem" =>
true);
61 if ($special_pages > 0)
63 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_special_page"),
"cmd" =>
"insertSpecialPage",
"multi" => 10,
64 "as_subitem" =>
true);
66 if ($ilUser->clipboardHasObjectsOfType(
"page"))
68 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_page_from_clip"),
69 "cmd" =>
"insertPageClip",
"as_subitem" =>
true);
73 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_pg_from_clip"),
74 "cmd" =>
"insertPageClip",
"as_subitem" =>
true);
79 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_page"),
"cmd" =>
"insertPage",
"multi" => 10);
80 if ($page_layouts > 0)
82 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_pagelayout"),
"cmd" =>
"insertTemplateGUI",
"multi" => 10);
84 if ($special_pages > 0)
86 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_special_page"),
"cmd" =>
"insertSpecialPage",
"multi" => 10);
89 if ($ilUser->clipboardHasObjectsOfType(
"page"))
91 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_page_from_clip"),
92 "cmd" =>
"insertPageClip");
96 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_pg_from_clip"),
97 "cmd" =>
"insertPageClip");
103 if ($a_node[
"type"] ==
"chap" || $a_node[
"type"] ==
"seqc")
105 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_ass"),
"cmd" =>
"insertAsset",
"multi" => 10);
106 if (count($a_childs) == 0)
108 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_ass_inside_chap"),
"cmd" =>
"insertAsset",
"multi" => 10,
109 "as_subitem" =>
true);
111 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_sco"),
"cmd" =>
"insertSco",
"multi" => 10);
112 if (count($a_childs) == 0)
114 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_sco_inside_chap"),
"cmd" =>
"insertSco",
"multi" => 10,
115 "as_subitem" =>
true);
117 if ($ilUser->clipboardHasObjectsOfType(
"sco"))
119 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_sco_from_clip"),
120 "cmd" =>
"insertScoClip",
"as_subitem" =>
false);
121 if (count($a_childs) == 0)
123 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_sco_from_clip_inside_chap"),
124 "cmd" =>
"insertScoClip",
"as_subitem" =>
true);
127 if ($ilUser->clipboardHasObjectsOfType(
"ass"))
129 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_ass_from_clip"),
130 "cmd" =>
"insertAssetClip",
"as_subitem" =>
false);
131 if (count($a_childs) == 0)
133 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_ass_from_clip_inside_chap"),
134 "cmd" =>
"insertAssetClip",
"as_subitem" =>
true);
141 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_st_from_clip"),
142 "cmd" =>
"insertLMChapterClip",
"as_subitem" =>
false);
143 if (count($a_childs) == 0)
145 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_st_from_clip_inside_chap"),
146 "cmd" =>
"insertLMChapterClip",
"as_subitem" =>
true);
152 if ($a_node[
"type"] ==
"sco" || $a_node[
"type"] ==
"ass")
155 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_sco"),
"cmd" =>
"insertSco",
"multi" => 10);
156 if ($ilUser->clipboardHasObjectsOfType(
"sco"))
158 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_sco_from_clip"),
159 "cmd" =>
"insertScoClip");
163 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_ass"),
"cmd" =>
"insertAsset",
"multi" => 10);
164 if ($ilUser->clipboardHasObjectsOfType(
"ass"))
166 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_ass_from_clip"),
167 "cmd" =>
"insertAssetClip");
171 if ($a_node[
"depth"] == 2)
173 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_chapter"),
"cmd" =>
"insertChapter",
"multi" => 10);
174 if ($ilUser->clipboardHasObjectsOfType(
"chap"))
176 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_chap_from_clip"),
177 "cmd" =>
"insertChapterClip");
184 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_st_from_clip"),
185 "cmd" =>
"insertLMChapterClip");
194 if ($a_node[
"type"] ==
"chap" || $a_node[
"type"] ==
"seqc")
196 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_chapter"),
"cmd" =>
"insertChapter",
"multi" => 10);
197 if ($ilUser->clipboardHasObjectsOfType(
"chap"))
199 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_chap_from_clip"),
200 "cmd" =>
"insertChapterClip");
218 if ($a_node[
"type"] ==
"" && $a_node[
"node_id"] == 1)
221 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_sco"),
"cmd" =>
"insertSco",
"multi" => 10);
222 if ($ilUser->clipboardHasObjectsOfType(
"sco"))
224 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_sco_from_clip"),
225 "cmd" =>
"insertScoClip");
229 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_ass"),
"cmd" =>
"insertAsset",
"multi" => 10);
230 if ($ilUser->clipboardHasObjectsOfType(
"ass"))
232 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_ass_from_clip"),
233 "cmd" =>
"insertAssetClip");
237 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_chapter"),
"cmd" =>
"insertChapter",
"multi" => 10);
238 if ($ilUser->clipboardHasObjectsOfType(
"chap"))
240 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_chap_from_clip"),
241 "cmd" =>
"insertChapterClip");
247 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_st_from_clip"),
248 "cmd" =>
"insertLMChapterClip");
253 if ($a_node[
"type"] ==
"chap" || $a_node[
"type"] ==
"seqc")
255 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_sco"),
"cmd" =>
"insertSco",
"multi" => 10);
256 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_ass"),
"cmd" =>
"insertAsset",
"multi" => 10);
257 if ($ilUser->clipboardHasObjectsOfType(
"sco"))
259 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_sco_from_clip"),
260 "cmd" =>
"insertScoClip");
262 if ($ilUser->clipboardHasObjectsOfType(
"ass"))
264 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_ass_from_clip"),
265 "cmd" =>
"insertAssetClip");
270 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_st_from_clip"),
271 "cmd" =>
"insertLMChapterClip");
274 if ($a_node[
"type"] ==
"sco" || $a_node[
"type"] ==
"ass")
276 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_page"),
"cmd" =>
"insertPage",
"multi" => 10);
277 if ($page_layouts > 0)
279 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_pagelayout"),
"cmd" =>
"insertTemplateGUI",
"multi" => 10);
281 if ($special_pages > 0)
283 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_special_page"),
"cmd" =>
"insertSpecialPage",
"multi" => 10);
286 if ($ilUser->clipboardHasObjectsOfType(
"page"))
288 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_page_from_clip"),
289 "cmd" =>
"insertPageClip");
293 $cmds[] =
array(
"text" => $lng->txt(
"sahs_insert_pg_from_clip"),
294 "cmd" =>
"insertPageClip");
312 if ($a_node[
"type"] ==
"pg" || $a_node[
"type"] ==
"page")
324 function manageDragAndDrop($a_node, $a_depth, $a_first_child_drop_area =
false, $a_next_sibling = null, $a_childs = null)
328 if ($a_node[
"type"] ==
"ass")
337 if (!$a_first_child_drop_area)
340 if ($a_node[
"type"] ==
"page" || ($a_node[
"type"] ==
"sco" && count($a_childs) == 0)
341 || ($a_node[
"type"] ==
"ass" && count($a_childs) == 0))
343 if ($a_node[
"type"] ==
"sco" || $a_node[
"type"] ==
"ass")
345 $this->
makeDragTarget($a_node[
"node_id"],
"grp_page", $a_first_child_drop_area,
350 $this->
makeDragTarget($a_node[
"node_id"],
"grp_page", $a_first_child_drop_area,
355 if ($a_node[
"type"] ==
"chap" && count($a_childs) == 0)
357 $this->
makeDragTarget($a_node[
"node_id"],
"grp_sco", $a_first_child_drop_area,
358 true, $lng->txt(
"cont_insert_into_chap"));
362 if ($a_node[
"type"] ==
"sco" || $a_node[
"type"] ==
"ass" || $a_node[
"type"] ==
"chap")
364 $this->
makeDragTarget($a_node[
"node_id"],
"grp_sco", $a_first_child_drop_area,
365 false, $lng->txt(
"cont_insert_after_".$a_node[
"type"]));
375 if ($a_node[
"depth"] == 2)
377 $this->
makeDragTarget($a_node[
"node_id"],
"grp_chap", $a_first_child_drop_area,
378 false, $lng->txt(
"sahs_insert_as_chapter"));
385 if ($a_node[
"type"] ==
"" && $a_node[
"node_id"] == 1)
387 $this->
makeDragTarget($a_node[
"node_id"],
"grp_chap", $a_first_child_drop_area,
389 $this->
makeDragTarget($a_node[
"node_id"],
"grp_sco", $a_first_child_drop_area,
392 if ($a_node[
"type"] ==
"chap")
394 $this->
makeDragTarget($a_node[
"node_id"],
"grp_sco", $a_first_child_drop_area,
397 if ($a_node[
"type"] ==
"sco" || $a_node[
"type"] ==
"ass")
399 $this->
makeDragTarget($a_node[
"node_id"],
"grp_page", $a_first_child_drop_area,
417 switch ($a_item[
"type"])
420 $ilCtrl->setParameterByClass(
"ilscorm2004scogui",
"obj_id",
422 $commands[] =
array(
"text" => $lng->txt(
"edit"),
423 "link" => $ilCtrl->getLinkTargetByClass(
array(
"ilobjscorm2004learningmodulegui",
424 "ilscorm2004scogui"),
"showOrganization"));
428 $ilCtrl->setParameterByClass(
"ilscorm2004assetgui",
"obj_id",
430 $commands[] =
array(
"text" => $lng->txt(
"edit"),
431 "link" => $ilCtrl->getLinkTargetByClass(
array(
"ilobjscorm2004learningmodulegui",
432 "ilscorm2004assetgui"),
"showOrganization"));
436 $ilCtrl->setParameterByClass(
"ilscorm2004chaptergui",
"obj_id",
438 $commands[] =
array(
"text" => $lng->txt(
"edit"),
439 "link" => $ilCtrl->getLinkTargetByClass(
array(
"ilobjscorm2004learningmodulegui",
440 "ilscorm2004chaptergui"),
"showOrganization"));
444 $ilCtrl->setParameterByClass(
"ilscorm2004seqchaptergui",
"obj_id",
446 $commands[] =
array(
"text" => $lng->txt(
"edit"),
447 "link" => $ilCtrl->getLinkTargetByClass(
array(
"ilobjscorm2004learningmodulegui",
448 "ilscorm2004seqchaptergui"),
"showOrganization"));
452 $ilCtrl->setParameterByClass(
"ilscorm2004pagenodegui",
"obj_id",
454 $commands[] =
array(
"text" => $lng->txt(
"edit"),
455 "link" => $ilCtrl->getLinkTargetByClass(
array(
"ilobjscorm2004learningmodulegui",
456 "ilscorm2004pagenodegui"),
"edit"));
473 return $lng->txt(
"icon").
" ".$lng->txt(
"obj_".$a_item[
"type"]);
Create styles array
The data for the language used.
static activeLayouts($a_special_page=false, $a_module=null)
Get active layouts.