/**
  * Copy skill category
  */
 function copy()
 {
     $scat = new ilSkillCategory();
     $scat->setTitle($this->getTitle());
     $scat->setType($this->getType());
     $scat->setSelfEvaluation($this->getSelfEvaluation());
     $scat->setOrderNr($this->getOrderNr());
     $scat->create();
     return $scat;
 }
 /**
  * Insert one or multiple skill categories
  *
  * @param
  * @return
  */
 function insertSkillCategory()
 {
     global $ilCtrl, $lng;
     include_once "./Services/Skill/classes/class.ilSkillHFormGUI.php";
     include_once "./Services/Skill/classes/class.ilSkillTreeNode.php";
     $num = ilSkillHFormGUI::getPostMulti();
     $node_id = ilSkillHFormGUI::getPostNodeId();
     if (!ilSkillHFormGUI::getPostFirstChild()) {
         $parent_id = $this->skill_tree->getParentId($node_id);
         $target = $node_id;
     } else {
         $parent_id = $node_id;
         $target = IL_FIRST_NODE;
     }
     include_once "./Services/Skill/classes/class.ilSkillCategory.php";
     $skill_ids = array();
     for ($i = 1; $i <= $num; $i++) {
         $skill = new ilSkillCategory();
         $skill->setTitle($lng->txt("skmg_new_skill_category"));
         $skill->create();
         ilSkillTreeNode::putInTree($skill, $parent_id, $target);
         $skill_ids[] = $skill->getId();
     }
     $skill_ids = array_reverse($skill_ids);
     $skill_ids = implode($skill_ids, ":");
     $ilCtrl->setParameter($this, "highlight", $skill_ids);
     $ilCtrl->redirect($this, "editSkills", "node_" . $node_id);
 }
 /**
  * Save item
  */
 function saveItem()
 {
     include_once "Services/Skill/classes/class.ilSkillCategory.php";
     $it = new ilSkillCategory();
     $it->setTitle($this->form->getInput("title"));
     $it->setOrderNr($this->form->getInput("order_nr"));
     $it->setSelfEvaluation($_POST["self_eval"]);
     $it->setDraft($_POST["draft"]);
     $it->create();
     ilSkillTreeNode::putInTree($it, (int) $_GET["obj_id"], IL_LAST_NODE);
 }