5 include_once(
"./Services/Skill/classes/class.ilSkillTreeNodeGUI.php");
6 include_once(
"./Services/Skill/classes/class.ilBasicSkill.php");
28 $ilCtrl->saveParameter($this, array(
"obj_id",
"level_id"));
48 $tpl->getStandardTemplate();
50 $next_class = $ilCtrl->getNextClass($this);
51 $cmd = $ilCtrl->getCmd();
54 case "ilcertificategui":
56 $ilTabs->activateTab(
"level_certificate");
57 include_once
"./Services/Certificate/classes/class.ilCertificateGUI.php";
58 include_once(
"./Services/Skill/classes/class.ilSkillCertificateAdapter.php");
61 $ret = $ilCtrl->forwardCommand($output_gui);
80 $tpl->setContent(
"Properties");
102 $it->setTitle($this->form->getInput(
"title"));
103 $it->setOrderNr($this->form->getInput(
"order_nr"));
104 $it->setDraft($this->form->getInput(
"draft"));
105 $it->setSelfEvaluation(
$_POST[
"self_eval"]);
108 $this->node_object = $it;
118 $ilCtrl->setParameterByClass(
"ilbasicskillgui",
"obj_id",
119 $this->node_object->getId());
120 $ilCtrl->redirectByClass(
"ilbasicskillgui",
"edit");
128 $this->node_object->setTitle($this->form->getInput(
"title"));
129 $this->node_object->setOrderNr($this->form->getInput(
"order_nr"));
130 $this->node_object->setSelfEvaluation(
$_POST[
"self_eval"]);
131 $this->node_object->setDraft(
$_POST[
"draft"]);
132 $this->node_object->update();
147 $ilToolbar->addButton($lng->txt(
"skmg_add_level"),
148 $ilCtrl->getLinkTarget($this,
"addLevel"));
150 include_once(
"./Services/Skill/classes/class.ilSkillLevelTableGUI.php");
152 $tpl->setContent($table->getHTML());
164 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
171 $ti->setRequired(
true);
172 $this->form->addItem($ti);
178 $ni->setRequired(
true);
179 $this->form->addItem($ni);
183 $cb->
setInfo($lng->txt(
"skmg_draft_info"));
184 $this->form->addItem($cb);
188 $cb->
setInfo($lng->txt(
"skmg_selectable_info"));
189 $this->form->addItem($cb);
192 if ($a_mode ==
"create")
194 $this->form->addCommandButton(
"save", $lng->txt(
"save"));
195 $this->form->addCommandButton(
"cancelSave", $lng->txt(
"cancel"));
196 $this->form->setTitle($lng->txt(
"skmg_create_skll"));
200 $this->form->addCommandButton(
"update", $lng->txt(
"save"));
201 $this->form->setTitle($lng->txt(
"skmg_edit_skll"));
204 $ilCtrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
205 $this->form->setFormAction($ilCtrl->getFormAction($this));
235 $tpl->setContent($this->form->getHTML());
250 $tpl->setContent($this->form->getHTML());
261 if ($this->form->checkInput())
264 $this->node_object->addLevel(
265 $this->form->getInput(
"title"),
266 $this->form->getInput(
"description"));
269 $ilCtrl->redirect($this,
"edit");
272 $this->form->setValuesByPost();
273 $tpl->setContent($this->form->getHtml());
284 if ($this->form->checkInput())
286 $this->node_object->writeLevelTitle(
287 (
int)
$_GET[
"level_id"],
288 $this->form->getInput(
"title"));
289 $this->node_object->writeLevelDescription(
290 (
int) $_GET[
"level_id"],
291 $this->form->getInput(
"description"));
294 $ilCtrl->redirect($this,
"edit");
297 $this->form->setValuesByPost();
298 $tpl->setContent($this->form->getHtml());
310 $ilCtrl->saveParameter($this,
"level_id");
312 $ilTabs->activateTab(
"level_settings");
314 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
320 $ti->setRequired(
true);
321 $this->form->addItem($ti);
327 $this->form->addItem($ta);
330 if ($a_mode ==
"create")
332 $this->form->addCommandButton(
"saveLevel", $lng->txt(
"save"));
333 $this->form->addCommandButton(
"edit", $lng->txt(
"cancel"));
334 $this->form->setTitle($lng->txt(
"skmg_new_level"));
338 $this->form->addCommandButton(
"updateLevel", $lng->txt(
"save"));
339 $this->form->addCommandButton(
"edit", $lng->txt(
"cancel"));
340 $this->form->setTitle($lng->txt(
"skmg_edit_level"));
343 $this->form->setFormAction($ilCtrl->getFormAction($this));
353 $data = $this->node_object->getLevelData((
int)
$_GET[
"level_id"]);
354 $values[
"title"] =
$data[
"title"];
355 $values[
"description"] =
$data[
"description"];
356 $this->form->setValuesByArray($values);
370 $this->node_object->updateLevelOrder($order);
372 $ilCtrl->redirect($this,
"edit");
384 if (!is_array(
$_POST[
"id"]) || count(
$_POST[
"id"]) == 0)
387 $ilCtrl->redirect($this,
"edit");
391 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
393 $cgui->setFormAction($ilCtrl->getFormAction($this));
394 $cgui->setHeaderText($lng->txt(
"skmg_really_delete_levels"));
395 $cgui->setCancel($lng->txt(
"cancel"),
"edit");
396 $cgui->setConfirm($lng->txt(
"delete"),
"deleteLevel");
398 foreach (
$_POST[
"id"] as $i)
403 $tpl->setContent($cgui->getHTML());
417 if (is_array(
$_POST[
"id"]))
419 foreach (
$_POST[
"id"] as $id)
421 $this->node_object->deleteLevel((
int) $id);
423 $this->node_object->fixLevelNumbering();
426 $ilCtrl->redirect($this,
"edit");
440 $ilTabs->clearTargets();
441 $ilTabs->setBackTarget($lng->txt(
"skmg_skill_levels"),
442 $ilCtrl->getLinkTarget($this,
"edit"));
444 if (
$_GET[
"level_id"] > 0)
446 $ilTabs->addTab(
"level_settings",
447 $lng->txt(
"settings"),
448 $ilCtrl->getLinkTarget($this,
"editLevel"));
460 if (
$_GET[
"level_id"] > 0)
462 $tpl->setTitle($lng->txt(
"skmg_skill_level").
": ".
467 $tpl->setTitle($lng->txt(
"skmg_skill_level"));
470 include_once(
"./Services/Skill/classes/class.ilSkillTree.php");
472 $path = $tree->getPathFull($this->node_object->getId());
474 foreach (
$path as $p)
476 if (in_array($p[
"type"], array(
"scat",
"skll")))
478 $desc.= $sep.$p[
"title"];
482 $tpl->setDescription($desc);
495 $ilTabs->clearTargets();
499 if (is_object($this->node_object))
503 $ilTabs->addTab(
"levels", $lng->txt(
"skmg_skill_levels"),
504 $ilCtrl->getLinkTarget($this,
'edit'));
507 $ilTabs->addTab(
"properties", $lng->txt(
"settings"),
508 $ilCtrl->getLinkTarget($this,
'editProperties'));
510 $ilCtrl->setParameterByClass(
"ilskillrootgui",
"obj_id",
511 $this->node_object->skill_tree->getRootId());
512 $ilTabs->setBackTarget($lng->txt(
"obj_skmg"),
513 $ilCtrl->getLinkTargetByClass(
"ilskillrootgui",
"listSkills"));
514 $ilCtrl->setParameterByClass(
"ilskillrootgui",
"obj_id",
517 $ilTabs->activateTab($a_tab);
519 $tpl->setTitle($lng->txt(
"skmg_skill").
": ".
520 $this->node_object->getTitle());
526 $tpl->setTitle($lng->txt(
"skmg_skill"));
527 $tpl->setDescription(
"");
543 $ilTabs->activateTab(
"level_trigger");
552 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
557 if ($trigger[
"obj_id"] > 0)
563 $ne->setValue($lng->txt(
"skmg_no_trigger"));
565 $this->form->addItem($ne);
567 if ($trigger[
"obj_id"] > 0)
569 $this->form->addCommandButton(
"removeLevelTrigger", $lng->txt(
"skmg_remove_trigger"));
571 $this->form->addCommandButton(
"selectLevelTrigger", $lng->txt(
"skmg_select_trigger"));
573 $this->form->setTitle($lng->txt(
"skmg_skill_level_trigger"));
574 $this->form->setFormAction($ilCtrl->getFormAction($this));
576 $tpl->setContent($this->form->getHTML());
588 $ilTabs->activateTab(
"level_trigger");
590 include_once
'Services/Search/classes/class.ilSearchRootSelector.php';
592 $ilCtrl->getLinkTarget($this,
'showRepositorySelection'));
593 $exp->
setExpand(
$_GET[
"search_root_expand"] ?
$_GET[
"search_root_expand"] : $tree->readRootId());
594 $exp->setExpandTarget($ilCtrl->getLinkTarget($this,
'selectLevelTrigger'));
595 $exp->setTargetClass(get_class($this));
596 $exp->setCmd(
'saveLevelTrigger');
597 $exp->setClickableTypes(array(
"crs"));
601 $tpl->setContent($exp->getOutput());
616 $ilCtrl->redirect($this,
"editLevelTrigger");
630 $ilCtrl->redirect($this,
"editLevelTrigger");
648 $ilCtrl->setParameterByClass(
"ilskillrootgui",
"obj_id", (
int) $_GET[
"obj_id"]);
649 $ilCtrl->redirectByClass(
"ilskillrootgui",
"listSkills");