5 include_once(
"./Services/Form/classes/class.ilHierarchyFormGUI.php");
25 $lng->loadLanguageModule(
"skmg");
33 function getMenuItems($a_node, $a_depth, $a_first_child =
false, $a_next_sibling = null, $a_childs)
42 if ($a_node[
"type"] ==
"sktp" || $a_node[
"type"] ==
"sctp")
44 $cmds[] = array(
"text" => $lng->txt(
"skmg_insert_basic_skill_template"),
"cmd" =>
"insertBasicSkillTemplate",
"multi" => 10);
45 $cmds[] = array(
"text" => $lng->txt(
"skmg_insert_skill_template_category"),
"cmd" =>
"insertSkillTemplateCategory",
"multi" => 10);
46 if ($ilUser->clipboardHasObjectsOfType(
"sktp"))
48 $cmds[] = array(
"text" => $lng->txt(
"skmg_insert_basic_skill_template_from_clip"),
49 "cmd" =>
"insertBasicSkillTemplateClip",
"as_subitem" =>
false);
51 if ($ilUser->clipboardHasObjectsOfType(
"sctp"))
53 $cmds[] = array(
"text" => $lng->txt(
"skmg_insert_skill_template_category_from_clip"),
54 "cmd" =>
"insertSkillTemplateCategoryClip",
"as_subitem" =>
false);
58 if ($a_node[
"type"] ==
"sctp" || $a_node[
"type"] ==
"skrt")
60 $cmds[] = array(
"text" => $lng->txt(
"skmg_insert_basic_skill_template_child"),
"cmd" =>
"insertBasicSkillTemplate",
"multi" => 10,
61 "as_subitem" =>
true);
62 $cmds[] = array(
"text" => $lng->txt(
"skmg_insert_skill_template_category_child"),
"cmd" =>
"insertSkillTemplateCategory",
"multi" => 10,
63 "as_subitem" =>
true);
64 if ($ilUser->clipboardHasObjectsOfType(
"sktp"))
66 $cmds[] = array(
"text" => $lng->txt(
"skmg_insert_basic_skill_template_from_clip_child"),
67 "cmd" =>
"insertBasicSkillTemplateClip",
"as_subitem" =>
true);
69 if ($ilUser->clipboardHasObjectsOfType(
"sctp"))
71 $cmds[] = array(
"text" => $lng->txt(
"skmg_insert_skill_template_category_from_clip_child"),
72 "cmd" =>
"insertSkillTemplateCategoryClip",
"as_subitem" =>
true);
78 if (($a_node[
"type"] ==
"skrt" && $a_node[
"node_id"] == 1)
79 || $a_node[
"type"] ==
"sctp")
81 $cmds[] = array(
"text" => $lng->txt(
"skmg_insert_basic_skill_template"),
"cmd" =>
"insertBasicSkillTemplate",
"multi" => 10);
82 $cmds[] = array(
"text" => $lng->txt(
"skmg_insert_skill_template_category"),
"cmd" =>
"insertSkillTemplateCategory",
"multi" => 10);
83 if ($ilUser->clipboardHasObjectsOfType(
"sktp"))
85 $cmds[] = array(
"text" => $lng->txt(
"skmg_insert_basic_skill_template_from_clip"),
86 "cmd" =>
"insertBasicSkillTemplateClip",
"as_subitem" =>
false);
88 if ($ilUser->clipboardHasObjectsOfType(
"sctp"))
90 $cmds[] = array(
"text" => $lng->txt(
"skmg_insert_skill_template_category_from_clip"),
91 "cmd" =>
"insertSkillTemplateCategoryClip",
"as_subitem" =>
false);
104 if ($a_node[
"type"] ==
"skll" || $a_node[
"type"] ==
"sktp")
116 function manageDragAndDrop($a_node, $a_depth, $a_first_child_drop_area =
false, $a_next_sibling = null, $a_childs = null)
122 if (!$a_first_child_drop_area)
124 if ($a_node[
"type"] ==
"sktp" || $a_node[
"type"] ==
"sctp")
126 $this->
makeDragTarget($a_node[
"node_id"],
"grp_sktp", $a_first_child_drop_area,
127 false, $lng->txt(
"skmg_insert_on_same_level"));
128 $this->
makeDragTarget($a_node[
"node_id"],
"grp_sctp", $a_first_child_drop_area,
129 false, $lng->txt(
"skmg_insert_on_same_level"));
131 if ($a_node[
"type"] ==
"sctp" || $a_node[
"type"] ==
"skrt")
133 $this->
makeDragTarget($a_node[
"node_id"],
"grp_sktp", $a_first_child_drop_area,
134 true, $lng->txt(
"skmg_insert_as_subitem"));
135 $this->
makeDragTarget($a_node[
"node_id"],
"grp_sctp", $a_first_child_drop_area,
136 true, $lng->txt(
"skmg_insert_as_subitem"));
141 if (($a_node[
"type"] ==
"skrt" && $a_node[
"node_id"] == 1)
142 || $a_node[
"type"] ==
"sctp")
144 $this->
makeDragTarget($a_node[
"node_id"],
"grp_sktp", $a_first_child_drop_area,
146 $this->
makeDragTarget($a_node[
"node_id"],
"grp_sctp", $a_first_child_drop_area,
164 switch ($a_item[
"type"])
175 $ilCtrl->setParameterByClass(
"ilbasicskilltemplategui",
"obj_id",
177 $commands[] = array(
"text" => $lng->txt(
"edit"),
178 "link" => $ilCtrl->getLinkTargetByClass(array(
"ilobjskillmanagementgui",
179 "ilbasicskilltemplategui"),
"edit"));