4 include_once(
"./Services/Form/classes/class.ilHierarchyFormGUI.php");
29 $this->lng = $DIC->language();
30 $this->
user = $DIC->user();
31 $this->ctrl = $DIC->ctrl();
32 $lng = $DIC->language();
34 parent::__construct();
36 $lng->loadLanguageModule(
"sahs");
43 public function getMenuItems($a_node, $a_depth, $a_first_child =
false, $a_next_sibling = null, $a_childs = null)
49 include_once(
"./Modules/LearningModule/classes/class.ilEditClipboard.php");
51 include_once(
"./Services/COPage/Layout/classes/class.ilPageLayout.php");
57 if (!$a_first_child) {
59 if ($a_node[
"type"] ==
"page" || ($a_node[
"type"] ==
"sco" && count($a_childs) == 0) ||
60 ($a_node[
"type"] ==
"ass" && count($a_childs) == 0)) {
61 if ($a_node[
"type"] ==
"sco" || $a_node[
"type"] ==
"ass") {
62 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_page"),
"cmd" =>
"insertPage",
"multi" => 10,
63 "as_subitem" =>
true);
64 if ($page_layouts > 0) {
65 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_pagelayout"),
"cmd" =>
"insertTemplateGUI",
"multi" => 10,
66 "as_subitem" =>
true);
68 if ($special_pages > 0) {
69 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_special_page"),
"cmd" =>
"insertSpecialPage",
"multi" => 10,
70 "as_subitem" =>
true);
72 if (
$ilUser->clipboardHasObjectsOfType(
"page")) {
73 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_page_from_clip"),
74 "cmd" =>
"insertPageClip",
"as_subitem" =>
true);
77 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_pg_from_clip"),
78 "cmd" =>
"insertPageClip",
"as_subitem" =>
true);
81 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_page"),
"cmd" =>
"insertPage",
"multi" => 10);
82 if ($page_layouts > 0) {
83 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_pagelayout"),
"cmd" =>
"insertTemplateGUI",
"multi" => 10);
85 if ($special_pages > 0) {
86 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_special_page"),
"cmd" =>
"insertSpecialPage",
"multi" => 10);
89 if (
$ilUser->clipboardHasObjectsOfType(
"page")) {
90 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_page_from_clip"),
91 "cmd" =>
"insertPageClip");
94 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_pg_from_clip"),
95 "cmd" =>
"insertPageClip");
101 if ($a_node[
"type"] ==
"chap" || $a_node[
"type"] ==
"seqc") {
102 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_ass"),
"cmd" =>
"insertAsset",
"multi" => 10);
103 if (count($a_childs) == 0) {
104 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_ass_inside_chap"),
"cmd" =>
"insertAsset",
"multi" => 10,
105 "as_subitem" =>
true);
107 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_sco"),
"cmd" =>
"insertSco",
"multi" => 10);
108 if (count($a_childs) == 0) {
109 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_sco_inside_chap"),
"cmd" =>
"insertSco",
"multi" => 10,
110 "as_subitem" =>
true);
112 if (
$ilUser->clipboardHasObjectsOfType(
"sco")) {
113 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_sco_from_clip"),
114 "cmd" =>
"insertScoClip",
"as_subitem" =>
false);
115 if (count($a_childs) == 0) {
116 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_sco_from_clip_inside_chap"),
117 "cmd" =>
"insertScoClip",
"as_subitem" =>
true);
120 if (
$ilUser->clipboardHasObjectsOfType(
"ass")) {
121 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_ass_from_clip"),
122 "cmd" =>
"insertAssetClip",
"as_subitem" =>
false);
123 if (count($a_childs) == 0) {
124 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_ass_from_clip_inside_chap"),
125 "cmd" =>
"insertAssetClip",
"as_subitem" =>
true);
131 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_st_from_clip"),
132 "cmd" =>
"insertLMChapterClip",
"as_subitem" =>
false);
133 if (count($a_childs) == 0) {
134 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_st_from_clip_inside_chap"),
135 "cmd" =>
"insertLMChapterClip",
"as_subitem" =>
true);
141 if ($a_node[
"type"] ==
"sco" || $a_node[
"type"] ==
"ass") {
143 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_sco"),
"cmd" =>
"insertSco",
"multi" => 10);
144 if (
$ilUser->clipboardHasObjectsOfType(
"sco")) {
145 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_sco_from_clip"),
146 "cmd" =>
"insertScoClip");
150 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_ass"),
"cmd" =>
"insertAsset",
"multi" => 10);
151 if (
$ilUser->clipboardHasObjectsOfType(
"ass")) {
152 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_ass_from_clip"),
153 "cmd" =>
"insertAssetClip");
157 if ($a_node[
"depth"] == 2) {
158 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_chapter"),
"cmd" =>
"insertChapter",
"multi" => 10);
159 if (
$ilUser->clipboardHasObjectsOfType(
"chap")) {
160 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_chap_from_clip"),
161 "cmd" =>
"insertChapterClip");
167 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_st_from_clip"),
168 "cmd" =>
"insertLMChapterClip");
177 if ($a_node[
"type"] ==
"chap" || $a_node[
"type"] ==
"seqc") {
178 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_chapter"),
"cmd" =>
"insertChapter",
"multi" => 10);
179 if (
$ilUser->clipboardHasObjectsOfType(
"chap")) {
180 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_chap_from_clip"),
181 "cmd" =>
"insertChapterClip");
196 if ($a_node[
"type"] ==
"" && $a_node[
"node_id"] == 1) {
198 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_sco"),
"cmd" =>
"insertSco",
"multi" => 10);
199 if (
$ilUser->clipboardHasObjectsOfType(
"sco")) {
200 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_sco_from_clip"),
201 "cmd" =>
"insertScoClip");
205 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_ass"),
"cmd" =>
"insertAsset",
"multi" => 10);
206 if (
$ilUser->clipboardHasObjectsOfType(
"ass")) {
207 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_ass_from_clip"),
208 "cmd" =>
"insertAssetClip");
212 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_chapter"),
"cmd" =>
"insertChapter",
"multi" => 10);
213 if (
$ilUser->clipboardHasObjectsOfType(
"chap")) {
214 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_chap_from_clip"),
215 "cmd" =>
"insertChapterClip");
220 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_st_from_clip"),
221 "cmd" =>
"insertLMChapterClip");
226 if ($a_node[
"type"] ==
"chap" || $a_node[
"type"] ==
"seqc") {
227 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_sco"),
"cmd" =>
"insertSco",
"multi" => 10);
228 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_ass"),
"cmd" =>
"insertAsset",
"multi" => 10);
229 if (
$ilUser->clipboardHasObjectsOfType(
"sco")) {
230 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_sco_from_clip"),
231 "cmd" =>
"insertScoClip");
233 if (
$ilUser->clipboardHasObjectsOfType(
"ass")) {
234 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_ass_from_clip"),
235 "cmd" =>
"insertAssetClip");
239 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_st_from_clip"),
240 "cmd" =>
"insertLMChapterClip");
243 if ($a_node[
"type"] ==
"sco" || $a_node[
"type"] ==
"ass") {
244 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_page"),
"cmd" =>
"insertPage",
"multi" => 10);
245 if ($page_layouts > 0) {
246 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_pagelayout"),
"cmd" =>
"insertTemplateGUI",
"multi" => 10);
248 if ($special_pages > 0) {
249 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_special_page"),
"cmd" =>
"insertSpecialPage",
"multi" => 10);
252 if (
$ilUser->clipboardHasObjectsOfType(
"page")) {
253 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_page_from_clip"),
254 "cmd" =>
"insertPageClip");
257 $cmds[] =
array(
"text" =>
$lng->txt(
"sahs_insert_pg_from_clip"),
258 "cmd" =>
"insertPageClip");
276 if ($a_node[
"type"] ==
"pg" || $a_node[
"type"] ==
"page") {
287 public function manageDragAndDrop($a_node, $a_depth, $a_first_child_drop_area =
false, $a_next_sibling = null, $a_childs = null)
291 if ($a_node[
"type"] ==
"ass") {
297 if (!$a_first_child_drop_area) {
299 if ($a_node[
"type"] ==
"page" || ($a_node[
"type"] ==
"sco" && count($a_childs) == 0)
300 || ($a_node[
"type"] ==
"ass" && count($a_childs) == 0)) {
301 if ($a_node[
"type"] ==
"sco" || $a_node[
"type"] ==
"ass") {
305 $a_first_child_drop_area,
313 $a_first_child_drop_area,
320 if ($a_node[
"type"] ==
"chap" && count($a_childs) == 0) {
324 $a_first_child_drop_area,
326 $lng->txt(
"cont_insert_into_chap")
331 if ($a_node[
"type"] ==
"sco" || $a_node[
"type"] ==
"ass" || $a_node[
"type"] ==
"chap") {
335 $a_first_child_drop_area,
337 $lng->txt(
"cont_insert_after_" . $a_node[
"type"])
348 if ($a_node[
"depth"] == 2) {
352 $a_first_child_drop_area,
354 $lng->txt(
"sahs_insert_as_chapter")
360 if ($a_node[
"type"] ==
"" && $a_node[
"node_id"] == 1) {
364 $a_first_child_drop_area,
370 $a_first_child_drop_area,
374 if ($a_node[
"type"] ==
"chap") {
378 $a_first_child_drop_area,
382 if ($a_node[
"type"] ==
"sco" || $a_node[
"type"] ==
"ass") {
386 $a_first_child_drop_area,
406 switch ($a_item[
"type"]) {
413 $commands[] =
array(
"text" =>
$lng->txt(
"edit"),
414 "link" =>
$ilCtrl->getLinkTargetByClass(
array(
"ilobjscorm2004learningmodulegui",
415 "ilscorm2004scogui"),
"showOrganization"));
420 "ilscorm2004assetgui",
424 $commands[] =
array(
"text" =>
$lng->txt(
"edit"),
425 "link" =>
$ilCtrl->getLinkTargetByClass(
array(
"ilobjscorm2004learningmodulegui",
426 "ilscorm2004assetgui"),
"showOrganization"));
431 "ilscorm2004chaptergui",
435 $commands[] =
array(
"text" =>
$lng->txt(
"edit"),
436 "link" =>
$ilCtrl->getLinkTargetByClass(
array(
"ilobjscorm2004learningmodulegui",
437 "ilscorm2004chaptergui"),
"showOrganization"));
442 "ilscorm2004seqchaptergui",
446 $commands[] =
array(
"text" =>
$lng->txt(
"edit"),
447 "link" =>
$ilCtrl->getLinkTargetByClass(
array(
"ilobjscorm2004learningmodulegui",
448 "ilscorm2004seqchaptergui"),
"showOrganization"));
453 "ilscorm2004pagenodegui",
457 $commands[] =
array(
"text" =>
$lng->txt(
"edit"),
458 "link" =>
$ilCtrl->getLinkTargetByClass(
array(
"ilobjscorm2004learningmodulegui",
459 "ilscorm2004pagenodegui"),
"edit"));
476 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.