ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilBasicSkillGUI Class Reference

Basic skill GUI class. More...

+ Inheritance diagram for ilBasicSkillGUI:
+ Collaboration diagram for ilBasicSkillGUI:

Public Member Functions

 __construct ($a_node_id=0)
 Constructor. More...
 
 getType ()
 Get Node Type. More...
 
 executeCommand ()
 Execute command. More...
 
 showProperties ()
 Show properties. More...
 
 proceedDragDrop ()
 Perform drag and drop action. More...
 
 saveItem ()
 Save item. More...
 
 afterSave ()
 After saving. More...
 
 updateItem ()
 Update item. More...
 
 edit ()
 Edit skill. More...
 
 initForm ($a_mode="edit")
 Init form. More...
 
 editProperties ()
 Edit properties. More...
 
 addLevel ()
 Add new level. More...
 
 editLevel ()
 Edit level. More...
 
 saveLevel ()
 Save level form. More...
 
 updateLevel ()
 Update level form. More...
 
 initLevelForm ($a_mode="edit")
 Init level form. More...
 
 getLevelValues ()
 Get current values for level from. More...
 
 updateLevelOrder ()
 Update level order. More...
 
 confirmLevelDeletion ()
 Confirm level deletion. More...
 
 deleteLevel ()
 Delete levels. More...
 
 setLevelHead ()
 Set header for level. More...
 
 setTabs ($a_tab="levels")
 Set header for skill. More...
 
 editLevelTrigger ()
 Edit level trigger. More...
 
 selectLevelTrigger ()
 Select skill level trigger. More...
 
 saveLevelTrigger ()
 Save level trigger. More...
 
 removeLevelTrigger ()
 Remove trigger. More...
 
 redirectToParent ()
 Redirect to parent (identified by current obj_id) More...
 
 showLevelResources ()
 Show level resources. More...
 
 addLevelResource ()
 Add level resource. More...
 
 saveLevelResource ()
 Save level resource. More...
 
 confirmLevelResourcesRemoval ()
 Confirm level resources removal. More...
 
 removeLevelResources ()
 Remove level resource. More...
 
- Public Member Functions inherited from ilSkillTreeNodeGUI
 ilSkillTreeNodeGUI ($a_node_id=0)
 constructor More...
 
 checkPermissionBool ($a_perm)
 Check permission pool. More...
 
 setParentGUI ($a_parentgui)
 Set Parent GUI class. More...
 
 getParentGUI ()
 Get Parent GUI class (ilObjSCORM2004LearningModuleGUI). More...
 
 readNodeObject ($a_node_id)
 Get node object instance. More...
 
 saveAllTitles ()
 Save Titles. More...
 
 deleteNodes ()
 Delete nodes in the hierarchy. More...
 
 cutItems ()
 Copy items to clipboard, then cut them from the current tree. More...
 
 copyItems ()
 Copy items to clipboard. More...
 
 cancelDelete ()
 cancel delete More...
 
 confirmedDelete ()
 confirmed delete More...
 
 setLocator ()
 Set Locator Items. More...
 
 setSkillNodeDescription ()
 Set skill node description. More...
 
 create ()
 Create skill tree node. More...
 
 addStatusInput (ilPropertyFormGUI $a_form)
 Add status input. More...
 
 editProperties ()
 Edit properties form. More...
 
 getPropertyValues ()
 Get property values for edit form. More...
 
 save ()
 Save skill tree node. More...
 
 afterSave ()
 After saving. More...
 
 update ()
 Update skill tree node. More...
 
 afterUpdate ()
 After update. More...
 
 initForm ($a_mode="edit")
 Init form. More...
 
 cancelSave ()
 Cancel saving. More...
 
 redirectToParent ($a_tmp_mode=false)
 Redirect to parent (identified by current obj_id) More...
 
 saveOrder ()
 Save order. More...
 
 insertBasicSkillClip ()
 Insert basic skills from clipboard. More...
 
 insertSkillCategoryClip ()
 Insert skill categories from clipboard. More...
 
 insertTemplateReferenceClip ()
 Insert skill template references from clipboard. More...
 
 insertSkillTemplateClip ()
 Insert skill template from clipboard. More...
 
 insertTemplateCategoryClip ()
 Insert skill template category from clipboard. More...
 
 setTitleIcon ()
 Set title icon. More...
 
 addUsageTab ($a_tabs)
 Add usage tab. More...
 
 showUsage ()
 Show skill usage. More...
 

Protected Attributes

 $tref_id = 0
 
 $base_skill_id
 

Additional Inherited Members

- Data Fields inherited from ilSkillTreeNodeGUI
 $node_object
 
 $access
 
 $ref_id
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilBasicSkillGUI::__construct (   $a_node_id = 0)

Constructor.

Definition at line 26 of file class.ilBasicSkillGUI.php.

References $ilCtrl.

27  {
28  global $ilCtrl;
29 
30  $ilCtrl->saveParameter($this, array("obj_id", "level_id"));
31  $this->base_skill_id = $a_node_id;
32 
33  parent::ilSkillTreeNodeGUI($a_node_id);
34  }
global $ilCtrl
Definition: ilias.php:18

Member Function Documentation

◆ addLevel()

ilBasicSkillGUI::addLevel ( )

Add new level.

Definition at line 240 of file class.ilBasicSkillGUI.php.

References $tpl, and initLevelForm().

241  {
242  global $tpl;
243 
244  $this->initLevelForm("create");
245  $tpl->setContent($this->form->getHTML());
246  }
global $tpl
Definition: ilias.php:8
initLevelForm($a_mode="edit")
Init level form.
+ Here is the call graph for this function:

◆ addLevelResource()

ilBasicSkillGUI::addLevelResource ( )

Add level resource.

Definition at line 720 of file class.ilBasicSkillGUI.php.

References $ilCtrl, $lng, $tpl, and setLevelHead().

721  {
722  global $ilCtrl, $ilTabs, $lng, $tree, $tpl;
723 
724  $this->setLevelHead();
725  $ilTabs->activateTab("level_resources");
726 
727  include_once("./Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php");
728  $exp = new ilRepositorySelectorExplorerGUI($this, "addLevelResource",
729  $this, "saveLevelResource", "root_id");
730  if (!$exp->handleCommand())
731  {
732  $tpl->setContent($exp->getHTML());
733  }
734  }
Explorer for selecting repository items.
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
setLevelHead()
Set header for level.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ afterSave()

ilBasicSkillGUI::afterSave ( )

After saving.

Definition at line 122 of file class.ilBasicSkillGUI.php.

References $ilCtrl.

123  {
124  global $ilCtrl;
125 
126  $ilCtrl->setParameterByClass("ilbasicskillgui", "obj_id",
127  $this->node_object->getId());
128  $ilCtrl->redirectByClass("ilbasicskillgui", "edit");
129  }
global $ilCtrl
Definition: ilias.php:18

◆ confirmLevelDeletion()

ilBasicSkillGUI::confirmLevelDeletion ( )

Confirm level deletion.

Definition at line 399 of file class.ilBasicSkillGUI.php.

References $_POST, $ilCtrl, $lng, $tpl, ilSkillTreeNodeGUI\checkPermissionBool(), ilBasicSkill\lookupLevelTitle(), ilUtil\sendInfo(), and setTabs().

400  {
401  global $ilCtrl, $tpl, $lng;
402 
403  if (!$this->checkPermissionBool("write"))
404  {
405  return;
406  }
407 
408  $this->setTabs("levels");
409 
410  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0)
411  {
412  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
413  $ilCtrl->redirect($this, "edit");
414  }
415  else
416  {
417  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
418  $cgui = new ilConfirmationGUI();
419  $cgui->setFormAction($ilCtrl->getFormAction($this));
420  $cgui->setHeaderText($lng->txt("skmg_really_delete_levels"));
421  $cgui->setCancel($lng->txt("cancel"), "edit");
422  $cgui->setConfirm($lng->txt("delete"), "deleteLevel");
423 
424  foreach ($_POST["id"] as $i)
425  {
426  $cgui->addItem("id[]", $i, ilBasicSkill::lookupLevelTitle($i));
427  }
428 
429  $tpl->setContent($cgui->getHTML());
430  }
431  }
$_POST['username']
Definition: cron.php:12
static lookupLevelTitle($a_id)
Lookup level title.
setTabs($a_tab="levels")
Set header for skill.
global $tpl
Definition: ilias.php:8
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
global $lng
Definition: privfeed.php:40
Confirmation screen class.
+ Here is the call graph for this function:

◆ confirmLevelResourcesRemoval()

ilBasicSkillGUI::confirmLevelResourcesRemoval ( )

Confirm level resources removal.

Definition at line 766 of file class.ilBasicSkillGUI.php.

References $_POST, $ilCtrl, $lng, $tpl, ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilSkillTreeNodeGUI\checkPermissionBool(), ilUtil\sendInfo(), and setLevelHead().

767  {
768  global $ilCtrl, $tpl, $lng, $ilTabs;
769 
770  if (!$this->checkPermissionBool("write"))
771  {
772  return;
773  }
774 
775  $this->setLevelHead();
776  $ilTabs->activateTab("level_resources");
777 
778  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0)
779  {
780  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
781  $ilCtrl->redirect($this, "showLevelResources");
782  }
783  else
784  {
785  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
786  $cgui = new ilConfirmationGUI();
787  $cgui->setFormAction($ilCtrl->getFormAction($this));
788  $cgui->setHeaderText($lng->txt("skmg_confirm_level_resources_removal"));
789  $cgui->setCancel($lng->txt("cancel"), "showLevelResources");
790  $cgui->setConfirm($lng->txt("remove"), "removeLevelResources");
791 
792  foreach ($_POST["id"] as $i)
793  {
795  $cgui->addItem("id[]", $i, $title);
796  }
797 
798  $tpl->setContent($cgui->getHTML());
799  }
800  }
$_POST['username']
Definition: cron.php:12
static _lookupTitle($a_id)
lookup object title
global $tpl
Definition: ilias.php:8
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static _lookupObjId($a_id)
setLevelHead()
Set header for level.
global $lng
Definition: privfeed.php:40
Confirmation screen class.
+ Here is the call graph for this function:

◆ deleteLevel()

ilBasicSkillGUI::deleteLevel ( )

Delete levels.

Definition at line 436 of file class.ilBasicSkillGUI.php.

References $_POST, $ilCtrl, $lng, ilSkillTreeNodeGUI\checkPermissionBool(), and ilUtil\sendSuccess().

437  {
438  global $lng, $ilCtrl;
439 
440  if (!$this->checkPermissionBool("write"))
441  {
442  return;
443  }
444 
445  if (is_array($_POST["id"]))
446  {
447  foreach ($_POST["id"] as $id)
448  {
449  $this->node_object->deleteLevel((int) $id);
450  }
451  $this->node_object->fixLevelNumbering();
452  }
453  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
454  $ilCtrl->redirect($this, "edit");
455  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ edit()

ilBasicSkillGUI::edit ( )

Edit skill.

Definition at line 151 of file class.ilBasicSkillGUI.php.

References $ilCtrl, $lng, $tpl, ilSkillTreeNodeGUI\checkPermissionBool(), and setTabs().

152  {
153  global $tpl, $ilToolbar, $lng, $ilCtrl;
154 
155  $this->setTabs("levels");
156 
157  if ($this->checkPermissionBool("write"))
158  {
159  $ilToolbar->addButton($lng->txt("skmg_add_level"),
160  $ilCtrl->getLinkTarget($this, "addLevel"));
161  }
162 
163  include_once("./Services/Skill/classes/class.ilSkillLevelTableGUI.php");
164  $table = new ilSkillLevelTableGUI($this->base_skill_id, $this, "edit");
165  $tpl->setContent($table->getHTML());
166  }
setTabs($a_tab="levels")
Set header for skill.
global $tpl
Definition: ilias.php:8
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ editLevel()

ilBasicSkillGUI::editLevel ( )

Edit level.

Definition at line 251 of file class.ilBasicSkillGUI.php.

References $tpl, getLevelValues(), and initLevelForm().

252  {
253  global $tpl;
254 
255  $this->initLevelForm();
256  $this->getLevelValues();
257  $tpl->setContent($this->form->getHTML());
258  }
global $tpl
Definition: ilias.php:8
getLevelValues()
Get current values for level from.
initLevelForm($a_mode="edit")
Init level form.
+ Here is the call graph for this function:

◆ editLevelTrigger()

ilBasicSkillGUI::editLevelTrigger ( )

Edit level trigger.

Definition at line 570 of file class.ilBasicSkillGUI.php.

References $_GET, $ilCtrl, $lng, $tpl, ilObject\_isInTrash(), ilObject\_lookupTitle(), ilObject\_lookupType(), ilBasicSkill\lookupLevelTrigger(), setLevelHead(), and ilNonEditableValueGUI\setValue().

571  {
572  global $lng, $ilCtrl, $tpl, $ilTabs;
573 
574  $this->setLevelHead();
575  $ilTabs->activateTab("level_trigger");
576 
577  $trigger = ilBasicSkill::lookupLevelTrigger((int) $_GET["level_id"]);
578  if (ilObject::_lookupType($trigger["obj_id"]) != "crs" ||
579  ilObject::_isInTrash($trigger["ref_id"]))
580  {
581  $trigger = array();
582  }
583 
584  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
585  $this->form = new ilPropertyFormGUI();
586 
587  // trigger
588  $ne = new ilNonEditableValueGUI($lng->txt("skmg_trigger"), "trigger");
589  if ($trigger["obj_id"] > 0)
590  {
591  $ne->setValue(ilObject::_lookupTitle($trigger["obj_id"]));
592  }
593  else
594  {
595  $ne->setValue($lng->txt("skmg_no_trigger"));
596  }
597  $this->form->addItem($ne);
598 
599  if ($trigger["obj_id"] > 0)
600  {
601  $this->form->addCommandButton("removeLevelTrigger", $lng->txt("skmg_remove_trigger"));
602  }
603  $this->form->addCommandButton("selectLevelTrigger", $lng->txt("skmg_select_trigger"));
604 
605  $this->form->setTitle($lng->txt("skmg_skill_level_trigger"));
606  $this->form->setFormAction($ilCtrl->getFormAction($this));
607 
608  $tpl->setContent($this->form->getHTML());
609  }
This class represents a property form user interface.
$_GET["client_id"]
static lookupLevelTrigger($a_id)
Lookup level trigger.
static _lookupTitle($a_id)
lookup object title
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
_isInTrash($a_ref_id)
checks wether object is in trash
static _lookupType($a_id, $a_reference=false)
lookup object type
setLevelHead()
Set header for level.
This class represents a non editable value in a property form.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ editProperties()

ilBasicSkillGUI::editProperties ( )

Edit properties.

Definition at line 224 of file class.ilBasicSkillGUI.php.

References setTabs().

225  {
226  $this->setTabs("properties");
227  parent::editProperties();
228  }
setTabs($a_tab="levels")
Set header for skill.
+ Here is the call graph for this function:

◆ executeCommand()

ilBasicSkillGUI::executeCommand ( )

Execute command.

Definition at line 47 of file class.ilBasicSkillGUI.php.

References $_GET, $cmd, $ilCtrl, $ret, $tpl, and setLevelHead().

48  {
49  global $ilCtrl, $tpl, $ilTabs, $ilHelp;
50 
51  $tpl->getStandardTemplate();
52 
53  $next_class = $ilCtrl->getNextClass($this);
54  $cmd = $ilCtrl->getCmd();
55  switch($next_class)
56  {
57  case "ilcertificategui":
58  $this->setLevelHead();
59  $ilTabs->activateTab("level_certificate");
60  include_once "./Services/Certificate/classes/class.ilCertificateGUI.php";
61  include_once("./Services/Skill/classes/class.ilSkillCertificateAdapter.php");
62  $output_gui = new ilCertificateGUI(
63  new ilSkillCertificateAdapter($this->node_object, (int) $_GET["level_id"]));
64  $ret = $ilCtrl->forwardCommand($output_gui);
65  break;
66 
67  default:
68  $ret = $this->$cmd();
69  break;
70  }
71  }
$_GET["client_id"]
$cmd
Definition: sahs_server.php:35
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
GUI class to create PDF certificates.
setLevelHead()
Set header for level.
+ Here is the call graph for this function:

◆ getLevelValues()

ilBasicSkillGUI::getLevelValues ( )

Get current values for level from.

Definition at line 368 of file class.ilBasicSkillGUI.php.

References $_GET, and $data.

Referenced by editLevel().

369  {
370  $values = array();
371 
372  $data = $this->node_object->getLevelData((int) $_GET["level_id"]);
373  $values["title"] = $data["title"];
374  $values["description"] = $data["description"];
375  $this->form->setValuesByArray($values);
376  }
$_GET["client_id"]
$data
+ Here is the caller graph for this function:

◆ getType()

ilBasicSkillGUI::getType ( )

Get Node Type.

Definition at line 39 of file class.ilBasicSkillGUI.php.

40  {
41  return "skll";
42  }

◆ initForm()

ilBasicSkillGUI::initForm (   $a_mode = "edit")

Init form.

Parameters
int$a_modeEdit Mode

Definition at line 173 of file class.ilBasicSkillGUI.php.

References $_GET, $ilCtrl, $lng, ilSkillTreeNodeGUI\addStatusInput(), ilSkillTreeNodeGUI\checkPermissionBool(), ilFormPropertyGUI\setInfo(), ilNumberInputGUI\setMaxLength(), and ilTextInputGUI\setMaxLength().

174  {
175  global $lng, $ilCtrl;
176 
177  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
178  $this->form = new ilPropertyFormGUI();
179 
180  // title
181  $ti = new ilTextInputGUI($lng->txt("title"), "title");
182  $ti->setMaxLength(200);
183  $ti->setSize(50);
184  $ti->setRequired(true);
185  $this->form->addItem($ti);
186 
187  // order nr
188  $ni = new ilNumberInputGUI($lng->txt("skmg_order_nr"), "order_nr");
189  $ni->setMaxLength(6);
190  $ni->setSize(6);
191  $ni->setRequired(true);
192  $this->form->addItem($ni);
193 
194  // status
195  $this->addStatusInput($this->form);
196 
197  // selectable
198  $cb = new ilCheckboxInputGUI($lng->txt("skmg_selectable"), "self_eval");
199  $cb->setInfo($lng->txt("skmg_selectable_info"));
200  $this->form->addItem($cb);
201 
202  // save and cancel commands
203  if ($this->checkPermissionBool("write"))
204  {
205  if ($a_mode == "create")
206  {
207  $this->form->addCommandButton("save", $lng->txt("save"));
208  $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
209  $this->form->setTitle($lng->txt("skmg_create_skll"));
210  } else
211  {
212  $this->form->addCommandButton("update", $lng->txt("save"));
213  $this->form->setTitle($lng->txt("skmg_edit_skll"));
214  }
215  }
216 
217  $ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
218  $this->form->setFormAction($ilCtrl->getFormAction($this));
219  }
This class represents a property form user interface.
$_GET["client_id"]
This class represents a checkbox property in a property form.
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
setInfo($a_info)
Set Information Text.
This class represents a number property in a property form.
This class represents a text property in a property form.
setMaxLength($a_maxlength)
Set Max Length.
setMaxLength($a_maxlength)
Set Max Length.
global $lng
Definition: privfeed.php:40
addStatusInput(ilPropertyFormGUI $a_form)
Add status input.
+ Here is the call graph for this function:

◆ initLevelForm()

ilBasicSkillGUI::initLevelForm (   $a_mode = "edit")

Init level form.

Parameters
string$a_modeform mode

Definition at line 323 of file class.ilBasicSkillGUI.php.

References $ilCtrl, $lng, ilSkillTreeNodeGUI\checkPermissionBool(), ilTextAreaInputGUI\setCols(), setLevelHead(), and ilTextInputGUI\setMaxLength().

Referenced by addLevel(), editLevel(), saveLevel(), and updateLevel().

324  {
325  global $lng, $ilCtrl, $ilTabs;
326 
327  $ilCtrl->saveParameter($this, "level_id");
328  $this->setLevelHead();
329  $ilTabs->activateTab("level_settings");
330 
331  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
332  $this->form = new ilPropertyFormGUI();
333 
334  // title
335  $ti = new ilTextInputGUI($lng->txt("title"), "title");
336  $ti->setMaxLength(200);
337  $ti->setRequired(true);
338  $this->form->addItem($ti);
339 
340  // description
341  $ta = new ilTextAreaInputGUI($lng->txt("description"), "description");
342  $ta->setCols(50);
343  $ta->setRows(5);
344  $this->form->addItem($ta);
345 
346  // save and cancel commands
347  if ($this->checkPermissionBool("write"))
348  {
349  if ($a_mode == "create")
350  {
351  $this->form->addCommandButton("saveLevel", $lng->txt("save"));
352  $this->form->addCommandButton("edit", $lng->txt("cancel"));
353  $this->form->setTitle($lng->txt("skmg_new_level"));
354  } else
355  {
356  $this->form->addCommandButton("updateLevel", $lng->txt("save"));
357  $this->form->addCommandButton("edit", $lng->txt("cancel"));
358  $this->form->setTitle($lng->txt("skmg_edit_level"));
359  }
360  }
361 
362  $this->form->setFormAction($ilCtrl->getFormAction($this));
363  }
This class represents a property form user interface.
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
This class represents a text property in a property form.
setMaxLength($a_maxlength)
Set Max Length.
setLevelHead()
Set header for level.
global $lng
Definition: privfeed.php:40
This class represents a text area property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ proceedDragDrop()

ilBasicSkillGUI::proceedDragDrop ( )

Perform drag and drop action.

Definition at line 90 of file class.ilBasicSkillGUI.php.

References $ilCtrl.

91  {
92  global $ilCtrl;
93 
94 // $this->slm_object->executeDragDrop($_POST["il_hform_source_id"], $_POST["il_hform_target_id"],
95 // $_POST["il_hform_fc"], $_POST["il_hform_as_subitem"]);
96 // $ilCtrl->redirect($this, "showOrganization");
97  }
global $ilCtrl
Definition: ilias.php:18

◆ redirectToParent()

ilBasicSkillGUI::redirectToParent ( )

Redirect to parent (identified by current obj_id)

Definition at line 671 of file class.ilBasicSkillGUI.php.

References $_GET, $ilCtrl, $t, and ilSkillTreeNode\_lookupType().

672  {
673  global $ilCtrl;
674 
675  $t = ilSkillTreeNode::_lookupType((int) $_GET["obj_id"]);
676 
677  switch ($t)
678  {
679  case "skrt":
680  $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id", (int) $_GET["obj_id"]);
681  $ilCtrl->redirectByClass("ilskillrootgui", "listSkills");
682  break;
683  }
684 
685  parent::redirectToParent();
686  }
$_GET["client_id"]
static _lookupType($a_obj_id)
Lookup Type.
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ removeLevelResources()

ilBasicSkillGUI::removeLevelResources ( )

Remove level resource.

Definition at line 805 of file class.ilBasicSkillGUI.php.

References $_GET, $_POST, $ilCtrl, $lng, ilSkillTreeNodeGUI\checkPermissionBool(), and ilUtil\sendSuccess().

806  {
807  global $ilCtrl, $lng;
808 
809  if (!$this->checkPermissionBool("write"))
810  {
811  return;
812  }
813 
814  if (is_array($_POST["id"]))
815  {
816  include_once("./Services/Skill/classes/class.ilSkillResources.php");
817  $sres = new ilSkillResources($this->base_skill_id, $this->tref_id);
818  foreach ($_POST["id"] as $i)
819  {
820  $sres->setResourceAsImparting((int) $_GET["level_id"], $i, false);
821  }
822  $sres->save();
823  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
824  }
825 
826  $ilCtrl->redirect($this, "showLevelResources");
827  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
Manages resources for skills.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ removeLevelTrigger()

ilBasicSkillGUI::removeLevelTrigger ( )

Remove trigger.

Definition at line 660 of file class.ilBasicSkillGUI.php.

References $_GET, $ilCtrl, and ilBasicSkill\writeLevelTrigger().

661  {
662  global $ilCtrl;
663 
664  ilBasicSkill::writeLevelTrigger((int) $_GET["level_id"], 0);
665  $ilCtrl->redirect($this, "editLevelTrigger");
666  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static writeLevelTrigger($a_id, $a_trigger_ref_id)
Write trigger.
+ Here is the call graph for this function:

◆ saveItem()

ilBasicSkillGUI::saveItem ( )

Save item.

Definition at line 102 of file class.ilBasicSkillGUI.php.

References $_GET, $_POST, ilSkillTreeNodeGUI\checkPermissionBool(), IL_LAST_NODE, and ilSkillTreeNode\putInTree().

103  {
104  if (!$this->checkPermissionBool("write"))
105  {
106  return;
107  }
108 
109  $it = new ilBasicSkill();
110  $it->setTitle($this->form->getInput("title"));
111  $it->setOrderNr($this->form->getInput("order_nr"));
112  $it->setStatus($this->form->getInput("status"));
113  $it->setSelfEvaluation($_POST["self_eval"]);
114  $it->create();
115  ilSkillTreeNode::putInTree($it, (int) $_GET["obj_id"], IL_LAST_NODE);
116  $this->node_object = $it;
117  }
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
static putInTree($a_obj, $a_parent_id="", $a_target_node_id="")
Put this object into the skill tree.
checkPermissionBool($a_perm)
Check permission pool.
const IL_LAST_NODE
Definition: class.ilTree.php:4
Basic Skill.
+ Here is the call graph for this function:

◆ saveLevel()

ilBasicSkillGUI::saveLevel ( )

Save level form.

Definition at line 263 of file class.ilBasicSkillGUI.php.

References $ilCtrl, $lng, $tpl, ilSkillTreeNodeGUI\checkPermissionBool(), initLevelForm(), and ilUtil\sendSuccess().

264  {
265  global $tpl, $lng, $ilCtrl;
266 
267  if (!$this->checkPermissionBool("write"))
268  {
269  return;
270  }
271 
272  $this->initLevelForm("create");
273  if ($this->form->checkInput())
274  {
275  // perform save
276  $this->node_object->addLevel(
277  $this->form->getInput("title"),
278  $this->form->getInput("description"));
279 
280  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
281  $ilCtrl->redirect($this, "edit");
282  }
283 
284  $this->form->setValuesByPost();
285  $tpl->setContent($this->form->getHtml());
286  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $tpl
Definition: ilias.php:8
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40
initLevelForm($a_mode="edit")
Init level form.
+ Here is the call graph for this function:

◆ saveLevelResource()

ilBasicSkillGUI::saveLevelResource ( )

Save level resource.

Definition at line 739 of file class.ilBasicSkillGUI.php.

References $_GET, $ilCtrl, $lng, ilSkillTreeNodeGUI\$ref_id, ilSkillTreeNodeGUI\checkPermissionBool(), and ilUtil\sendSuccess().

740  {
741  global $ilCtrl, $lng;
742 
743  $ref_id = (int) $_GET["root_id"];
744 
745  if (!$this->checkPermissionBool("write"))
746  {
747  return;
748  }
749 
750  if ($ref_id > 0)
751  {
752  include_once("./Services/Skill/classes/class.ilSkillResources.php");
753  $sres = new ilSkillResources($this->base_skill_id, $this->tref_id);
754  $sres->setResourceAsImparting((int) $_GET["level_id"], $ref_id);
755  $sres->save();
756 
757  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
758  }
759 
760  $ilCtrl->redirect($this, "showLevelResources");
761  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_GET["client_id"]
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
Manages resources for skills.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ saveLevelTrigger()

ilBasicSkillGUI::saveLevelTrigger ( )

Save level trigger.

Definition at line 644 of file class.ilBasicSkillGUI.php.

References $_GET, $ilCtrl, ilSkillTreeNodeGUI\checkPermissionBool(), and ilBasicSkill\writeLevelTrigger().

645  {
646  global $ilCtrl;
647 
648  if (!$this->checkPermissionBool("write"))
649  {
650  return;
651  }
652 
653  ilBasicSkill::writeLevelTrigger((int) $_GET["level_id"], (int) $_GET["root_id"]);
654  $ilCtrl->redirect($this, "editLevelTrigger");
655  }
$_GET["client_id"]
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
static writeLevelTrigger($a_id, $a_trigger_ref_id)
Write trigger.
+ Here is the call graph for this function:

◆ selectLevelTrigger()

ilBasicSkillGUI::selectLevelTrigger ( )

Select skill level trigger.

Definition at line 614 of file class.ilBasicSkillGUI.php.

References $_GET, $ilCtrl, $lng, $tpl, ilSkillTreeNodeGUI\checkPermissionBool(), ilExplorer\setExpand(), and setLevelHead().

615  {
616  global $ilCtrl, $ilTabs, $lng, $tree, $tpl;
617 
618  if (!$this->checkPermissionBool("write"))
619  {
620  return;
621  }
622 
623  $this->setLevelHead();
624  $ilTabs->activateTab("level_trigger");
625 
626  include_once 'Services/Search/classes/class.ilSearchRootSelector.php';
627  $exp = new ilSearchRootSelector(
628  $ilCtrl->getLinkTarget($this,'showRepositorySelection'));
629  $exp->setExpand($_GET["search_root_expand"] ? $_GET["search_root_expand"] : $tree->readRootId());
630  $exp->setExpandTarget($ilCtrl->getLinkTarget($this,'selectLevelTrigger'));
631  $exp->setTargetClass(get_class($this));
632  $exp->setCmd('saveLevelTrigger');
633  $exp->setClickableTypes(array("crs"));
634 
635  // build html-output
636  $exp->setOutput(0);
637  $tpl->setContent($exp->getOutput());
638 
639  }
$_GET["client_id"]
global $tpl
Definition: ilias.php:8
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
setLevelHead()
Set header for level.
global $lng
Definition: privfeed.php:40
setExpand($a_node_id)
set the expand option this value is stored in a SESSION variable to save it different view (lo view...
+ Here is the call graph for this function:

◆ setLevelHead()

ilBasicSkillGUI::setLevelHead ( )

Set header for level.

Definition at line 460 of file class.ilBasicSkillGUI.php.

References $_GET, $ilCtrl, $lng, $path, $tpl, and ilBasicSkill\lookupLevelTitle().

Referenced by addLevelResource(), confirmLevelResourcesRemoval(), editLevelTrigger(), executeCommand(), initLevelForm(), selectLevelTrigger(), and showLevelResources().

461  {
462  global $ilTabs, $ilCtrl, $tpl, $lng, $ilHelp;
463 
464  // tabs
465  $ilTabs->clearTargets();
466  $ilHelp->setScreenIdComponent("skmg_lev");
467 
468  $ilTabs->setBackTarget($lng->txt("back"),
469  $ilCtrl->getLinkTarget($this, "edit"));
470 
471  if ($_GET["level_id"] > 0)
472  {
473  $ilTabs->addTab("level_settings",
474  $lng->txt("settings"),
475  $ilCtrl->getLinkTarget($this, "editLevel"));
476 
477 /* $ilTabs->addTab("level_trigger",
478  $lng->txt("skmg_trigger"),
479  $ilCtrl->getLinkTarget($this, "editLevelTrigger"));*/
480 
481  $ilTabs->addTab("level_resources",
482  $lng->txt("skmg_resources"),
483  $ilCtrl->getLinkTarget($this, "showLevelResources"));
484 /*
485  $ilTabs->addTab("level_certificate",
486  $lng->txt("certificate"),
487  $ilCtrl->getLinkTargetByClass("ilcertificategui", "certificateEditor"));*/
488 
489  }
490 
491  // title
492  if ($_GET["level_id"] > 0)
493  {
494  $tpl->setTitle($lng->txt("skmg_skill_level").": ".
495  ilBasicSkill::lookupLevelTitle((int) $_GET["level_id"]));
496  }
497  else
498  {
499  $tpl->setTitle($lng->txt("skmg_skill_level"));
500  }
501 
502  include_once("./Services/Skill/classes/class.ilSkillTree.php");
503  $tree = new ilSkillTree();
504  $path = $tree->getPathFull($this->node_object->getId());
505  $desc = "";
506  foreach ($path as $p)
507  {
508  if (in_array($p["type"], array("scat", "skll")))
509  {
510  $desc.= $sep.$p["title"];
511  $sep = " > ";
512  }
513  }
514  $tpl->setDescription($desc);
515  }
static lookupLevelTitle($a_id)
Lookup level title.
Skill tree.
$_GET["client_id"]
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40
$path
Definition: index.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTabs()

ilBasicSkillGUI::setTabs (   $a_tab = "levels")

Set header for skill.

Parameters
string$a_tabactive tab

Definition at line 522 of file class.ilBasicSkillGUI.php.

References $_GET, $ilCtrl, $lng, $tpl, ilSkillTreeNodeGUI\addUsageTab(), and ilSkillTreeNodeGUI\setSkillNodeDescription().

Referenced by confirmLevelDeletion(), edit(), editProperties(), and showProperties().

523  {
524  global $ilTabs, $ilCtrl, $tpl, $lng, $ilHelp;
525 
526  $ilTabs->clearTargets();
527  $ilHelp->setScreenIdComponent("skmg_skll");
528 // $ilTabs->setBackTarget($lng->txt("skmg_skill_hierarchie"),
529 // $ilCtrl->getLinkTargetByClass("ilobjskillmanagementgui", "editSkills"));
530 
531  if (is_object($this->node_object))
532  {
533 
534  // levels
535  $ilTabs->addTab("levels", $lng->txt("skmg_skill_levels"),
536  $ilCtrl->getLinkTarget($this, 'edit'));
537 
538  // properties
539  $ilTabs->addTab("properties", $lng->txt("settings"),
540  $ilCtrl->getLinkTarget($this, 'editProperties'));
541 
542  // usage
543  $this->addUsageTab($ilTabs);
544 
545  $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id",
546  $this->node_object->skill_tree->getRootId());
547  $ilTabs->setBackTarget($lng->txt("obj_skmg"),
548  $ilCtrl->getLinkTargetByClass("ilskillrootgui", "listSkills"));
549  $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id",
550  $_GET["obj_id"]);
551 
552  $ilTabs->activateTab($a_tab);
553 
554  $tpl->setTitle($lng->txt("skmg_skill").": ".
555  $this->node_object->getTitle());
556 
557  $this->setSkillNodeDescription();
558  }
559  else
560  {
561  $tpl->setTitle($lng->txt("skmg_skill"));
562  $tpl->setDescription("");
563  }
564  parent::setTitleIcon();
565  }
addUsageTab($a_tabs)
Add usage tab.
setSkillNodeDescription()
Set skill node description.
$_GET["client_id"]
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showLevelResources()

ilBasicSkillGUI::showLevelResources ( )

Show level resources.

Definition at line 696 of file class.ilBasicSkillGUI.php.

References $_GET, $ilCtrl, $lng, $tab, $tpl, ilSkillTreeNodeGUI\checkPermissionBool(), and setLevelHead().

697  {
698  global $tpl, $ilTabs, $ilToolbar, $lng, $ilCtrl;
699 
700  if ($this->checkPermissionBool("write"))
701  {
702  $ilToolbar->addButton(
703  $lng->txt("skmg_add_resource"),
704  $ilCtrl->getLinkTarget($this, "addLevelResource"));
705  }
706 
707  $this->setLevelHead();
708  $ilTabs->activateTab("level_resources");
709 
710  include_once("./Services/Skill/classes/class.ilSkillLevelResourcesTableGUI.php");
711  $tab = new ilSkillLevelResourcesTableGUI($this, "showLevelResources",
712  $this->base_skill_id, $this->tref_id, (int) $_GET["level_id"]);
713 
714  $tpl->setContent($tab->getHTML());
715  }
$_GET["client_id"]
global $tpl
Definition: ilias.php:8
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
TableGUI class for skill level resources.
setLevelHead()
Set header for level.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ showProperties()

ilBasicSkillGUI::showProperties ( )

Show properties.

Definition at line 76 of file class.ilBasicSkillGUI.php.

References $tpl, ilSkillTreeNodeGUI\setLocator(), and setTabs().

77  {
78  global $tpl;
79 
80  $this->setTabs();
81  $this->setLocator();
82 
83  $tpl->setContent("Properties");
84  }
setLocator()
Set Locator Items.
setTabs($a_tab="levels")
Set header for skill.
global $tpl
Definition: ilias.php:8
+ Here is the call graph for this function:

◆ updateItem()

ilBasicSkillGUI::updateItem ( )

Update item.

Definition at line 134 of file class.ilBasicSkillGUI.php.

References $_POST, and ilSkillTreeNodeGUI\checkPermissionBool().

135  {
136  if (!$this->checkPermissionBool("write"))
137  {
138  return;
139  }
140 
141  $this->node_object->setTitle($this->form->getInput("title"));
142  $this->node_object->setOrderNr($this->form->getInput("order_nr"));
143  $this->node_object->setSelfEvaluation($_POST["self_eval"]);
144  $this->node_object->setStatus($_POST["status"]);
145  $this->node_object->update();
146  }
$_POST['username']
Definition: cron.php:12
checkPermissionBool($a_perm)
Check permission pool.
+ Here is the call graph for this function:

◆ updateLevel()

ilBasicSkillGUI::updateLevel ( )

Update level form.

Definition at line 291 of file class.ilBasicSkillGUI.php.

References $_GET, $ilCtrl, $lng, $tpl, ilSkillTreeNodeGUI\checkPermissionBool(), initLevelForm(), and ilUtil\sendSuccess().

292  {
293  global $lng, $ilCtrl, $tpl;
294 
295  if (!$this->checkPermissionBool("write"))
296  {
297  return;
298  }
299 
300  $this->initLevelForm("edit");
301  if ($this->form->checkInput())
302  {
303  $this->node_object->writeLevelTitle(
304  (int) $_GET["level_id"],
305  $this->form->getInput("title"));
306  $this->node_object->writeLevelDescription(
307  (int) $_GET["level_id"],
308  $this->form->getInput("description"));
309 
310  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
311  $ilCtrl->redirect($this, "edit");
312  }
313 
314  $this->form->setValuesByPost();
315  $tpl->setContent($this->form->getHtml());
316  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_GET["client_id"]
global $tpl
Definition: ilias.php:8
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40
initLevelForm($a_mode="edit")
Init level form.
+ Here is the call graph for this function:

◆ updateLevelOrder()

ilBasicSkillGUI::updateLevelOrder ( )

Update level order.

Definition at line 381 of file class.ilBasicSkillGUI.php.

References $_POST, $ilCtrl, $lng, ilSkillTreeNodeGUI\checkPermissionBool(), ilUtil\sendSuccess(), and ilUtil\stripSlashesArray().

382  {
383  global $lng, $ilCtrl;
384 
385  if (!$this->checkPermissionBool("write"))
386  {
387  return;
388  }
389 
390  $order = ilUtil::stripSlashesArray($_POST["order"]);
391  $this->node_object->updateLevelOrder($order);
392  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
393  $ilCtrl->redirect($this, "edit");
394  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
static stripSlashesArray($a_arr, $a_strip_html=true, $a_allow="")
Strip slashes from array.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

Field Documentation

◆ $base_skill_id

ilBasicSkillGUI::$base_skill_id
protected

Definition at line 21 of file class.ilBasicSkillGUI.php.

◆ $tref_id

ilBasicSkillGUI::$tref_id = 0
protected

Definition at line 20 of file class.ilBasicSkillGUI.php.


The documentation for this class was generated from the following file: