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"] ==
"skll" || $a_node[
"type"] ==
"scat")
44 $cmds[] = array(
"text" => $lng->txt(
"skmg_insert_basic_skill"),
"cmd" =>
"insertBasicSkill",
"multi" => 10);
45 $cmds[] = array(
"text" => $lng->txt(
"skmg_insert_skill_template_reference"),
"cmd" =>
"insertSkillTemplateReference");
46 $cmds[] = array(
"text" => $lng->txt(
"skmg_insert_skill_category"),
"cmd" =>
"insertSkillCategory",
"multi" => 10);
47 if ($ilUser->clipboardHasObjectsOfType(
"skll"))
49 $cmds[] = array(
"text" => $lng->txt(
"skmg_insert_basic_skill_from_clip"),
50 "cmd" =>
"insertBasicSkillClip",
"as_subitem" =>
false);
52 if ($ilUser->clipboardHasObjectsOfType(
"sktr"))
54 $cmds[] = array(
"text" => $lng->txt(
"skmg_insert_skill_template_reference_from_clip"),
55 "cmd" =>
"insertSkillTemplateReferenceClip",
"as_subitem" =>
false);
57 if ($ilUser->clipboardHasObjectsOfType(
"scat"))
59 $cmds[] = array(
"text" => $lng->txt(
"skmg_insert_skill_category_from_clip"),
60 "cmd" =>
"insertSkillCategoryClip",
"as_subitem" =>
false);
64 if ($a_node[
"type"] ==
"scat" || $a_node[
"type"] ==
"skrt")
66 $cmds[] = array(
"text" => $lng->txt(
"skmg_insert_basic_skill_child"),
"cmd" =>
"insertBasicSkill",
"multi" => 10,
67 "as_subitem" =>
true);
68 $cmds[] = array(
"text" => $lng->txt(
"skmg_insert_skill_template_reference_child"),
"cmd" =>
"insertSkillTemplateReference",
69 "as_subitem" =>
true);
70 $cmds[] = array(
"text" => $lng->txt(
"skmg_insert_skill_category_child"),
"cmd" =>
"insertSkillCategory",
"multi" => 10,
71 "as_subitem" =>
true);
72 if ($ilUser->clipboardHasObjectsOfType(
"skll"))
74 $cmds[] = array(
"text" => $lng->txt(
"skmg_insert_basic_skill_from_clip_child"),
75 "cmd" =>
"insertBasicSkillClip",
"as_subitem" =>
true);
77 if ($ilUser->clipboardHasObjectsOfType(
"sktr"))
79 $cmds[] = array(
"text" => $lng->txt(
"skmg_insert_skill_template_reference_from_clip_child"),
80 "cmd" =>
"insertSkillTemplateReferenceClip",
"as_subitem" =>
true);
82 if ($ilUser->clipboardHasObjectsOfType(
"scat"))
84 $cmds[] = array(
"text" => $lng->txt(
"skmg_insert_skill_category_from_clip_child"),
85 "cmd" =>
"insertSkillCategoryClip",
"as_subitem" =>
true);
91 if (($a_node[
"type"] ==
"skrt" && $a_node[
"node_id"] == 1)
92 || $a_node[
"type"] ==
"scat")
94 $cmds[] = array(
"text" => $lng->txt(
"skmg_insert_basic_skill"),
"cmd" =>
"insertBasicSkill",
"multi" => 10);
95 $cmds[] = array(
"text" => $lng->txt(
"skmg_insert_skill_template_reference"),
"cmd" =>
"insertSkillTemplateReference");
96 $cmds[] = array(
"text" => $lng->txt(
"skmg_insert_skill_category"),
"cmd" =>
"insertSkillCategory",
"multi" => 10);
97 if ($ilUser->clipboardHasObjectsOfType(
"skll"))
99 $cmds[] = array(
"text" => $lng->txt(
"skmg_insert_basic_skill_from_clip"),
100 "cmd" =>
"insertBasicSkillClip",
"as_subitem" =>
false);
102 if ($ilUser->clipboardHasObjectsOfType(
"sktr"))
104 $cmds[] = array(
"text" => $lng->txt(
"skmg_insert_skill_template_reference_from_clip"),
105 "cmd" =>
"insertSkillTemplateReferenceClip",
"as_subitem" =>
false);
107 if ($ilUser->clipboardHasObjectsOfType(
"scat"))
109 $cmds[] = array(
"text" => $lng->txt(
"skmg_insert_skill_category_from_clip"),
110 "cmd" =>
"insertSkillCategoryClip",
"as_subitem" =>
false);
123 if ($a_node[
"type"] ==
"skll")
135 function manageDragAndDrop($a_node, $a_depth, $a_first_child_drop_area =
false, $a_next_sibling = null, $a_childs = null)
141 if (!$a_first_child_drop_area)
143 if ($a_node[
"type"] ==
"skll" || $a_node[
"type"] ==
"scat")
145 $this->
makeDragTarget($a_node[
"node_id"],
"grp_skll", $a_first_child_drop_area,
146 false, $lng->txt(
"skmg_insert_on_same_level"));
147 $this->
makeDragTarget($a_node[
"node_id"],
"grp_scat", $a_first_child_drop_area,
148 false, $lng->txt(
"skmg_insert_on_same_level"));
150 if ($a_node[
"type"] ==
"scat" || $a_node[
"type"] ==
"skrt")
152 $this->
makeDragTarget($a_node[
"node_id"],
"grp_skll", $a_first_child_drop_area,
153 true, $lng->txt(
"skmg_insert_as_subitem"));
154 $this->
makeDragTarget($a_node[
"node_id"],
"grp_scat", $a_first_child_drop_area,
155 true, $lng->txt(
"skmg_insert_as_subitem"));
160 if (($a_node[
"type"] ==
"skrt" && $a_node[
"node_id"] == 1)
161 || $a_node[
"type"] ==
"scat")
163 $this->
makeDragTarget($a_node[
"node_id"],
"grp_skll", $a_first_child_drop_area,
165 $this->
makeDragTarget($a_node[
"node_id"],
"grp_scat", $a_first_child_drop_area,
183 switch ($a_item[
"type"])
186 $ilCtrl->setParameterByClass(
"ilskillcategorygui",
"obj_id",
188 $commands[] = array(
"text" => $lng->txt(
"edit"),
189 "link" => $ilCtrl->getLinkTargetByClass(array(
"ilobjskillmanagementgui",
190 "ilskillcategorygui"),
"edit"));
194 $ilCtrl->setParameterByClass(
"ilbasicskillgui",
"obj_id",
196 $commands[] = array(
"text" => $lng->txt(
"edit"),
197 "link" => $ilCtrl->getLinkTargetByClass(array(
"ilobjskillmanagementgui",
198 "ilbasicskillgui"),
"edit"));
202 $ilCtrl->setParameterByClass(
"ilskilltemplatereferencegui",
"obj_id",
204 $commands[] = array(
"text" => $lng->txt(
"edit"),
205 "link" => $ilCtrl->getLinkTargetByClass(array(
"ilobjskillmanagementgui",
206 "ilskilltemplatereferencegui"),
"edit"));