ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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...
 
 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 ($a_tmp_mode=false)
 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...
 
 saveResourceSettings ()
 Save resource settings. More...
 
- Public Member Functions inherited from ilSkillTreeNodeGUI
 __construct ($a_node_id=0)
 constructor More...
 
 isInUse ()
 Is in use? 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...
 
 exportSelectedNodes ()
 Export seleced nodes. More...
 

Protected Attributes

 $ctrl
 
 $tpl
 
 $tabs
 
 $help
 
 $toolbar
 
 $lng
 
 $tree
 
 $tref_id = 0
 
 $base_skill_id
 
- Protected Attributes inherited from ilSkillTreeNodeGUI
 $ctrl
 
 $lng
 
 $locator
 
 $tpl
 
 $user
 

Additional Inherited Members

- Data Fields inherited from ilSkillTreeNodeGUI
 $node_object
 
 $in_use = false
 
 $use_checked = false
 
 $access
 
 $ref_id
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilBasicSkillGUI::__construct (   $a_node_id = 0)

Constructor.

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

References $DIC, $ilCtrl, and array.

62  {
63  global $DIC;
64 
65  $this->ctrl = $DIC->ctrl();
66  $this->tpl = $DIC["tpl"];
67  $this->tabs = $DIC->tabs();
68  $this->help = $DIC["ilHelp"];
69  $this->toolbar = $DIC->toolbar();
70  $this->lng = $DIC->language();
71  $this->tree = $DIC->repositoryTree();
72  $ilCtrl = $DIC->ctrl();
73 
74  $ilCtrl->saveParameter($this, array("obj_id", "level_id"));
75  $this->base_skill_id = $a_node_id;
76 
77  parent::__construct($a_node_id);
78  }
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.

Member Function Documentation

◆ addLevel()

ilBasicSkillGUI::addLevel ( )

Add new level.

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

References $tpl, and initLevelForm().

287  {
288  $tpl = $this->tpl;
289 
290  $this->initLevelForm("create");
291  $tpl->setContent($this->form->getHTML());
292  }
initLevelForm($a_mode="edit")
Init level form.
+ Here is the call graph for this function:

◆ addLevelResource()

ilBasicSkillGUI::addLevelResource ( )

Add level resource.

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

References $ctrl, $ilCtrl, $lng, $tabs, $tpl, $tree, and setLevelHead().

796  {
798  $ilTabs = $this->tabs;
799  $lng = $this->lng;
800  $tree = $this->tree;
801  $tpl = $this->tpl;
802 
803  $this->setLevelHead();
804  $ilTabs->activateTab("level_resources");
805 
806  include_once("./Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php");
808  $this,
809  "addLevelResource",
810  $this,
811  "saveLevelResource",
812  "root_id"
813  );
814  if (!$exp->handleCommand()) {
815  $tpl->setContent($exp->getHTML());
816  }
817  }
Explorer for selecting repository items.
global $ilCtrl
Definition: ilias.php:18
setLevelHead()
Set header for level.
+ Here is the call graph for this function:

◆ afterSave()

ilBasicSkillGUI::afterSave ( )

After saving.

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

References $ctrl, and $ilCtrl.

154  {
156 
157  $ilCtrl->setParameterByClass(
158  "ilbasicskillgui",
159  "obj_id",
160  $this->node_object->getId()
161  );
162  $ilCtrl->redirectByClass("ilbasicskillgui", "edit");
163  }
global $ilCtrl
Definition: ilias.php:18

◆ confirmLevelDeletion()

ilBasicSkillGUI::confirmLevelDeletion ( )

Confirm level deletion.

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

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

453  {
455  $tpl = $this->tpl;
456  $lng = $this->lng;
457 
458  if (!$this->checkPermissionBool("write")) {
459  return;
460  }
461 
462  $this->setTabs("levels");
463 
464  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0) {
465  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
466  $ilCtrl->redirect($this, "edit");
467  } else {
468  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
469  $cgui = new ilConfirmationGUI();
470  $cgui->setFormAction($ilCtrl->getFormAction($this));
471  $cgui->setHeaderText($lng->txt("skmg_really_delete_levels"));
472  $cgui->setCancel($lng->txt("cancel"), "edit");
473  $cgui->setConfirm($lng->txt("delete"), "deleteLevel");
474 
475  foreach ($_POST["id"] as $i) {
476  $cgui->addItem("id[]", $i, ilBasicSkill::lookupLevelTitle($i));
477  }
478 
479  $tpl->setContent($cgui->getHTML());
480  }
481  }
static lookupLevelTitle($a_id)
Lookup level title.
setTabs($a_tab="levels")
Set header for skill.
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$i
Definition: disco.tpl.php:19
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ confirmLevelResourcesRemoval()

ilBasicSkillGUI::confirmLevelResourcesRemoval ( )

Confirm level resources removal.

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

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

849  {
851  $tpl = $this->tpl;
852  $lng = $this->lng;
853  $ilTabs = $this->tabs;
854 
855  if (!$this->checkPermissionBool("write")) {
856  return;
857  }
858 
859  $this->setLevelHead();
860  $ilTabs->activateTab("level_resources");
861 
862  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0) {
863  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
864  $ilCtrl->redirect($this, "showLevelResources");
865  } else {
866  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
867  $cgui = new ilConfirmationGUI();
868  $cgui->setFormAction($ilCtrl->getFormAction($this));
869  $cgui->setHeaderText($lng->txt("skmg_confirm_level_resources_removal"));
870  $cgui->setCancel($lng->txt("cancel"), "showLevelResources");
871  $cgui->setConfirm($lng->txt("remove"), "removeLevelResources");
872 
873  foreach ($_POST["id"] as $i) {
875  $cgui->addItem("id[]", $i, $title);
876  }
877 
878  $tpl->setContent($cgui->getHTML());
879  }
880  }
static _lookupTitle($a_id)
lookup object title
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.
$i
Definition: disco.tpl.php:19
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ deleteLevel()

ilBasicSkillGUI::deleteLevel ( )

Delete levels.

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

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

487  {
488  $lng = $this->lng;
490 
491  if (!$this->checkPermissionBool("write")) {
492  return;
493  }
494 
495  if (is_array($_POST["id"])) {
496  foreach ($_POST["id"] as $id) {
497  $this->node_object->deleteLevel((int) $id);
498  }
499  $this->node_object->fixLevelNumbering();
500  }
501  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
502  $ilCtrl->redirect($this, "edit");
503  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
if(!array_key_exists('StateId', $_REQUEST)) $id
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
$_POST["username"]
+ Here is the call graph for this function:

◆ edit()

ilBasicSkillGUI::edit ( )

Edit skill.

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

References $ctrl, $ilCtrl, $lng, $table, $toolbar, $tpl, ilSkillTreeNodeGUI\checkPermissionBool(), ilSkillTreeNodeGUI\isInUse(), ilUtil\sendInfo(), and setTabs().

185  {
186  $tpl = $this->tpl;
187  $ilToolbar = $this->toolbar;
188  $lng = $this->lng;
190 
191  $this->setTabs("levels");
192 
193  if ($this->isInUse()) {
194  ilUtil::sendInfo($lng->txt("skmg_skill_in_use"));
195  } else {
196  if ($this->checkPermissionBool("write")) {
197  $ilToolbar->addButton(
198  $lng->txt("skmg_add_level"),
199  $ilCtrl->getLinkTarget($this, "addLevel")
200  );
201  }
202  }
203 
204  include_once("./Services/Skill/classes/class.ilSkillLevelTableGUI.php");
205  $table = new ilSkillLevelTableGUI($this->base_skill_id, $this, "edit", 0, $this->isInUse());
206  $tpl->setContent($table->getHTML());
207  }
setTabs($a_tab="levels")
Set header for skill.
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if(empty($password)) $table
Definition: pwgen.php:24
+ Here is the call graph for this function:

◆ editLevel()

ilBasicSkillGUI::editLevel ( )

Edit level.

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

References $lng, $tpl, getLevelValues(), initLevelForm(), ilSkillTreeNodeGUI\isInUse(), and ilUtil\sendInfo().

298  {
299  $tpl = $this->tpl;
300  $lng = $this->lng;
301 
302  if ($this->isInUse()) {
303  ilUtil::sendInfo($lng->txt("skmg_skill_in_use"));
304  }
305 
306  $this->initLevelForm();
307  $this->getLevelValues();
308  $tpl->setContent($this->form->getHTML());
309  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
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 636 of file class.ilBasicSkillGUI.php.

References $_GET, $ctrl, $ilCtrl, $lng, $tabs, $tpl, ilObject\_isInTrash(), ilObject\_lookupTitle(), ilObject\_lookupType(), array, setLevelHead(), and ilNonEditableValueGUI\setValue().

637  {
638  $lng = $this->lng;
640  $tpl = $this->tpl;
641  $ilTabs = $this->tabs;
642 
643  $this->setLevelHead();
644  $ilTabs->activateTab("level_trigger");
645 
646  $trigger = ilBasicSkill::lookupLevelTrigger((int) $_GET["level_id"]);
647  if (ilObject::_lookupType($trigger["obj_id"]) != "crs" ||
648  ilObject::_isInTrash($trigger["ref_id"])) {
649  $trigger = array();
650  }
651 
652  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
653  $this->form = new ilPropertyFormGUI();
654 
655  // trigger
656  $ne = new ilNonEditableValueGUI($lng->txt("skmg_trigger"), "trigger");
657  if ($trigger["obj_id"] > 0) {
658  $ne->setValue(ilObject::_lookupTitle($trigger["obj_id"]));
659  } else {
660  $ne->setValue($lng->txt("skmg_no_trigger"));
661  }
662  $this->form->addItem($ne);
663 
664  if ($trigger["obj_id"] > 0) {
665  $this->form->addCommandButton("removeLevelTrigger", $lng->txt("skmg_remove_trigger"));
666  }
667  $this->form->addCommandButton("selectLevelTrigger", $lng->txt("skmg_select_trigger"));
668 
669  $this->form->setTitle($lng->txt("skmg_skill_level_trigger"));
670  $this->form->setFormAction($ilCtrl->getFormAction($this));
671 
672  $tpl->setContent($this->form->getHTML());
673  }
This class represents a property form user interface.
$_GET["client_id"]
static _isInTrash($a_ref_id)
checks wether object is in trash
static _lookupTitle($a_id)
lookup object title
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.
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.
+ Here is the call graph for this function:

◆ editProperties()

ilBasicSkillGUI::editProperties ( )

Edit properties.

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

References setTabs().

271  {
272  $this->setTabs("properties");
273  parent::editProperties();
274  }
setTabs($a_tab="levels")
Set header for skill.
+ Here is the call graph for this function:

◆ executeCommand()

ilBasicSkillGUI::executeCommand ( )

Execute command.

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

References $_GET, $ctrl, $ilCtrl, $ret, $tabs, and setLevelHead().

92  {
94  $ilTabs = $this->tabs;
95 
96  //$tpl->getStandardTemplate();
97 
98  $next_class = $ilCtrl->getNextClass($this);
99  $cmd = $ilCtrl->getCmd();
100  switch ($next_class) {
101  case "ilcertificategui":
102  $this->setLevelHead();
103  $ilTabs->activateTab("level_certificate");
104  include_once "./Services/Certificate/classes/class.ilCertificateGUI.php";
105  include_once("./Services/Skill/classes/class.ilSkillCertificateAdapter.php");
106  $output_gui = new ilCertificateGUI(
107  new ilSkillCertificateAdapter($this->node_object, (int) $_GET["level_id"])
108  );
109  $ret = $ilCtrl->forwardCommand($output_gui);
110  break;
111 
112  default:
113  $ret = $this->$cmd();
114  break;
115  }
116  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
GUI class to create PDF certificates.
setLevelHead()
Set header for level.
$ret
Definition: parser.php:6
+ Here is the call graph for this function:

◆ getLevelValues()

ilBasicSkillGUI::getLevelValues ( )

Get current values for level from.

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

References $_GET, $data, and array.

Referenced by editLevel().

422  {
423  $values = array();
424 
425  $data = $this->node_object->getLevelData((int) $_GET["level_id"]);
426  $values["title"] = $data["title"];
427  $values["description"] = $data["description"];
428  $this->form->setValuesByArray($values);
429  }
$_GET["client_id"]
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ getType()

ilBasicSkillGUI::getType ( )

Get Node Type.

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

84  {
85  return "skll";
86  }

◆ initForm()

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

Init form.

Parameters
int$a_modeEdit Mode

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

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

215  {
216  $lng = $this->lng;
218 
219  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
220  $this->form = new ilPropertyFormGUI();
221 
222  // title
223  $ti = new ilTextInputGUI($lng->txt("title"), "title");
224  $ti->setMaxLength(200);
225  $ti->setSize(50);
226  $ti->setRequired(true);
227  $this->form->addItem($ti);
228 
229  // order nr
230  $ni = new ilNumberInputGUI($lng->txt("skmg_order_nr"), "order_nr");
231  $ni->setInfo($lng->txt("skmg_order_nr_info"));
232  $ni->setMaxLength(6);
233  $ni->setSize(6);
234  $ni->setRequired(true);
235  if ($a_mode == "create") {
236  include_once("./Services/Skill/classes/class.ilSkillTree.php");
237  $tree = new ilSkillTree();
238  $max = $tree->getMaxOrderNr((int) $_GET["obj_id"]);
239  $ni->setValue($max + 10);
240  }
241  $this->form->addItem($ni);
242 
243  // status
244  $this->addStatusInput($this->form);
245 
246  // selectable
247  $cb = new ilCheckboxInputGUI($lng->txt("skmg_selectable"), "self_eval");
248  $cb->setInfo($lng->txt("skmg_selectable_info"));
249  $this->form->addItem($cb);
250 
251  // save and cancel commands
252  if ($this->checkPermissionBool("write")) {
253  if ($a_mode == "create") {
254  $this->form->addCommandButton("save", $lng->txt("save"));
255  $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
256  $this->form->setTitle($lng->txt("skmg_create_skll"));
257  } else {
258  $this->form->addCommandButton("update", $lng->txt("save"));
259  $this->form->setTitle($lng->txt("skmg_edit_skll"));
260  }
261  }
262 
263  $ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
264  $this->form->setFormAction($ilCtrl->getFormAction($this));
265  }
This class represents a property form user interface.
Skill tree.
$_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.
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 377 of file class.ilBasicSkillGUI.php.

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

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

378  {
379  $lng = $this->lng;
381  $ilTabs = $this->tabs;
382 
383  $ilCtrl->saveParameter($this, "level_id");
384  $this->setLevelHead();
385  $ilTabs->activateTab("level_settings");
386 
387  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
388  $this->form = new ilPropertyFormGUI();
389 
390  // title
391  $ti = new ilTextInputGUI($lng->txt("title"), "title");
392  $ti->setMaxLength(200);
393  $ti->setRequired(true);
394  $this->form->addItem($ti);
395 
396  // description
397  $ta = new ilTextAreaInputGUI($lng->txt("description"), "description");
398  $ta->setCols(50);
399  $ta->setRows(5);
400  $this->form->addItem($ta);
401 
402  // save and cancel commands
403  if ($this->checkPermissionBool("write")) {
404  if ($a_mode == "create") {
405  $this->form->addCommandButton("saveLevel", $lng->txt("save"));
406  $this->form->addCommandButton("edit", $lng->txt("cancel"));
407  $this->form->setTitle($lng->txt("skmg_new_level"));
408  } else {
409  $this->form->addCommandButton("updateLevel", $lng->txt("save"));
410  $this->form->addCommandButton("edit", $lng->txt("cancel"));
411  $this->form->setTitle($lng->txt("skmg_edit_level"));
412  }
413  }
414 
415  $this->form->setFormAction($ilCtrl->getFormAction($this));
416  }
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.
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:

◆ redirectToParent()

ilBasicSkillGUI::redirectToParent (   $a_tmp_mode = false)

Redirect to parent (identified by current obj_id)

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

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

738  {
740 
741  $t = ilSkillTreeNode::_lookupType((int) $_GET["obj_id"]);
742 
743  switch ($t) {
744  case "skrt":
745  $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id", (int) $_GET["obj_id"]);
746  $ilCtrl->redirectByClass("ilskillrootgui", "listSkills");
747  break;
748  }
749 
750  parent::redirectToParent();
751  }
$_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 885 of file class.ilBasicSkillGUI.php.

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

886  {
888  $lng = $this->lng;
889 
890  if (!$this->checkPermissionBool("write")) {
891  return;
892  }
893 
894  if (is_array($_POST["id"])) {
895  include_once("./Services/Skill/classes/class.ilSkillResources.php");
896  $sres = new ilSkillResources($this->base_skill_id, $this->tref_id);
897  foreach ($_POST["id"] as $i) {
898  $sres->setResourceAsImparting((int) $_GET["level_id"], $i, false);
899  }
900  $sres->save();
901  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
902  }
903 
904  $ilCtrl->redirect($this, "showLevelResources");
905  }
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.
$i
Definition: disco.tpl.php:19
$_POST["username"]
+ Here is the call graph for this function:

◆ removeLevelTrigger()

ilBasicSkillGUI::removeLevelTrigger ( )

Remove trigger.

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

References $_GET, $ctrl, and $ilCtrl.

727  {
729 
730  ilBasicSkill::writeLevelTrigger((int) $_GET["level_id"], 0);
731  $ilCtrl->redirect($this, "editLevelTrigger");
732  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18

◆ saveItem()

ilBasicSkillGUI::saveItem ( )

Save item.

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

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

135  {
136  if (!$this->checkPermissionBool("write")) {
137  return;
138  }
139 
140  $it = new ilBasicSkill();
141  $it->setTitle($this->form->getInput("title"));
142  $it->setOrderNr($this->form->getInput("order_nr"));
143  $it->setStatus($this->form->getInput("status"));
144  $it->setSelfEvaluation($_POST["self_eval"]);
145  $it->create();
146  ilSkillTreeNode::putInTree($it, (int) $_GET["obj_id"], IL_LAST_NODE);
147  $this->node_object = $it;
148  }
$_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.
$_POST["username"]
+ Here is the call graph for this function:

◆ saveLevel()

ilBasicSkillGUI::saveLevel ( )

Save level form.

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

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

315  {
316  $tpl = $this->tpl;
317  $lng = $this->lng;
319 
320  if (!$this->checkPermissionBool("write")) {
321  return;
322  }
323 
324  $this->initLevelForm("create");
325  if ($this->form->checkInput()) {
326  // perform save
327  $this->node_object->addLevel(
328  $this->form->getInput("title"),
329  $this->form->getInput("description")
330  );
331 
332  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
333  $ilCtrl->redirect($this, "edit");
334  }
335 
336  $this->form->setValuesByPost();
337  $tpl->setContent($this->form->getHtml());
338  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
initLevelForm($a_mode="edit")
Init level form.
+ Here is the call graph for this function:

◆ saveLevelResource()

ilBasicSkillGUI::saveLevelResource ( )

Save level resource.

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

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

823  {
825  $lng = $this->lng;
826 
827  $ref_id = (int) $_GET["root_id"];
828 
829  if (!$this->checkPermissionBool("write")) {
830  return;
831  }
832 
833  if ($ref_id > 0) {
834  include_once("./Services/Skill/classes/class.ilSkillResources.php");
835  $sres = new ilSkillResources($this->base_skill_id, $this->tref_id);
836  $sres->setResourceAsImparting((int) $_GET["level_id"], $ref_id);
837  $sres->save();
838 
839  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
840  }
841 
842  $ilCtrl->redirect($this, "showLevelResources");
843  }
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.
+ Here is the call graph for this function:

◆ saveLevelTrigger()

ilBasicSkillGUI::saveLevelTrigger ( )

Save level trigger.

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

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

712  {
714 
715  if (!$this->checkPermissionBool("write")) {
716  return;
717  }
718 
719  ilBasicSkill::writeLevelTrigger((int) $_GET["level_id"], (int) $_GET["root_id"]);
720  $ilCtrl->redirect($this, "editLevelTrigger");
721  }
$_GET["client_id"]
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ saveResourceSettings()

ilBasicSkillGUI::saveResourceSettings ( )

Save resource settings.

Parameters

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

References $_GET, $_POST, $ctrl, $ilCtrl, and $r.

914  {
916 
917  include_once("./Services/Skill/classes/class.ilSkillResources.php");
918  $resources = new ilSkillResources($this->base_skill_id, $this->tref_id);
919 
920  foreach ($resources->getResourcesOfLevel((int) $_GET["level_id"]) as $r) {
921  $imparting = false;
922  if (is_array($_POST["suggested"]) && isset($_POST["suggested"][$r["rep_ref_id"]]) && $_POST["suggested"][$r["rep_ref_id"]]) {
923  $imparting = true;
924  }
925  $trigger = false;
926  if (is_array($_POST["trigger"]) && isset($_POST["trigger"][$r["rep_ref_id"]]) && $_POST["trigger"][$r["rep_ref_id"]]) {
927  $trigger = true;
928  }
929  $resources->setResourceAsImparting((int) $_GET["level_id"], $r["rep_ref_id"], $imparting);
930  $resources->setResourceAsTrigger((int) $_GET["level_id"], $r["rep_ref_id"], $trigger);
931  }
932  $resources->save();
933 
934  $ilCtrl->redirect($this, "showLevelResources");
935  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
$r
Definition: example_031.php:79
Manages resources for skills.
$_POST["username"]

◆ selectLevelTrigger()

ilBasicSkillGUI::selectLevelTrigger ( )

Select skill level trigger.

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

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

679  {
681  $ilTabs = $this->tabs;
682  $lng = $this->lng;
683  $tree = $this->tree;
684  $tpl = $this->tpl;
685 
686  if (!$this->checkPermissionBool("write")) {
687  return;
688  }
689 
690  $this->setLevelHead();
691  $ilTabs->activateTab("level_trigger");
692 
693  include_once 'Services/Search/classes/class.ilSearchRootSelector.php';
694  $exp = new ilSearchRootSelector(
695  $ilCtrl->getLinkTarget($this, 'showRepositorySelection')
696  );
697  $exp->setExpand($_GET["search_root_expand"] ? $_GET["search_root_expand"] : $tree->readRootId());
698  $exp->setExpandTarget($ilCtrl->getLinkTarget($this, 'selectLevelTrigger'));
699  $exp->setTargetClass(get_class($this));
700  $exp->setCmd('saveLevelTrigger');
701  $exp->setClickableTypes(array("crs"));
702 
703  // build html-output
704  $exp->setOutput(0);
705  $tpl->setContent($exp->getOutput());
706  }
$_GET["client_id"]
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.
setLevelHead()
Set header for level.
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 508 of file class.ilBasicSkillGUI.php.

References $_GET, $ctrl, $help, $ilCtrl, $lng, $path, $tabs, $tpl, $tree, array, and ilBasicSkill\lookupLevelTitle().

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

509  {
510  $ilTabs = $this->tabs;
512  $tpl = $this->tpl;
513  $lng = $this->lng;
514  $ilHelp = $this->help;
515 
516  // tabs
517  $ilTabs->clearTargets();
518  $ilHelp->setScreenIdComponent("skmg_lev");
519 
520  $ilTabs->setBackTarget(
521  $lng->txt("back"),
522  $ilCtrl->getLinkTarget($this, "edit")
523  );
524 
525  if ($_GET["level_id"] > 0) {
526  $ilTabs->addTab(
527  "level_settings",
528  $lng->txt("settings"),
529  $ilCtrl->getLinkTarget($this, "editLevel")
530  );
531 
532  /* $ilTabs->addTab("level_trigger",
533  $lng->txt("skmg_trigger"),
534  $ilCtrl->getLinkTarget($this, "editLevelTrigger"));*/
535 
536  $ilTabs->addTab(
537  "level_resources",
538  $lng->txt("skmg_resources"),
539  $ilCtrl->getLinkTarget($this, "showLevelResources")
540  );
541  /*
542  $ilTabs->addTab("level_certificate",
543  $lng->txt("certificate"),
544  $ilCtrl->getLinkTargetByClass("ilcertificategui", "certificateEditor"));*/
545  }
546 
547  // title
548  if ($_GET["level_id"] > 0) {
549  $tpl->setTitle($lng->txt("skmg_skill_level") . ": " .
550  ilBasicSkill::lookupLevelTitle((int) $_GET["level_id"]));
551  } else {
552  $tpl->setTitle($lng->txt("skmg_skill_level"));
553  }
554 
555  include_once("./Services/Skill/classes/class.ilSkillTree.php");
556  $tree = new ilSkillTree();
557  $path = $tree->getPathFull($this->node_object->getId());
558  $desc = "";
559  foreach ($path as $p) {
560  if (in_array($p["type"], array("scat", "skll"))) {
561  $desc.= $sep . $p["title"];
562  $sep = " > ";
563  }
564  }
565  $tpl->setDescription($desc);
566  }
static lookupLevelTitle($a_id)
Lookup level title.
Skill tree.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.
+ 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 573 of file class.ilBasicSkillGUI.php.

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

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

574  {
575  $ilTabs = $this->tabs;
577  $tpl = $this->tpl;
578  $lng = $this->lng;
579  $ilHelp = $this->help;
580 
581  $ilTabs->clearTargets();
582  $ilHelp->setScreenIdComponent("skmg_skll");
583  // $ilTabs->setBackTarget($lng->txt("skmg_skill_hierarchie"),
584  // $ilCtrl->getLinkTargetByClass("ilobjskillmanagementgui", "editSkills"));
585 
586  if (is_object($this->node_object)) {
587 
588  // levels
589  $ilTabs->addTab(
590  "levels",
591  $lng->txt("skmg_skill_levels"),
592  $ilCtrl->getLinkTarget($this, 'edit')
593  );
594 
595  // properties
596  $ilTabs->addTab(
597  "properties",
598  $lng->txt("settings"),
599  $ilCtrl->getLinkTarget($this, 'editProperties')
600  );
601 
602  // usage
603  $this->addUsageTab($ilTabs);
604 
605  $ilCtrl->setParameterByClass(
606  "ilskillrootgui",
607  "obj_id",
608  $this->node_object->skill_tree->getRootId()
609  );
610  $ilTabs->setBackTarget(
611  $lng->txt("obj_skmg"),
612  $ilCtrl->getLinkTargetByClass("ilskillrootgui", "listSkills")
613  );
614  $ilCtrl->setParameterByClass(
615  "ilskillrootgui",
616  "obj_id",
617  $_GET["obj_id"]
618  );
619 
620  $ilTabs->activateTab($a_tab);
621 
622  $tpl->setTitle($lng->txt("skmg_skill") . ": " .
623  $this->node_object->getTitle());
624 
625  $this->setSkillNodeDescription();
626  } else {
627  $tpl->setTitle($lng->txt("skmg_skill"));
628  $tpl->setDescription("");
629  }
630  parent::setTitleIcon();
631  }
addUsageTab($a_tabs)
Add usage tab.
setSkillNodeDescription()
Set skill node description.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
+ 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 761 of file class.ilBasicSkillGUI.php.

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

762  {
763  $tpl = $this->tpl;
764  $ilTabs = $this->tabs;
765  $ilToolbar = $this->toolbar;
766  $lng = $this->lng;
768 
769  if ($this->checkPermissionBool("write")) {
770  $ilToolbar->addButton(
771  $lng->txt("skmg_add_resource"),
772  $ilCtrl->getLinkTarget($this, "addLevelResource")
773  );
774  }
775 
776  $this->setLevelHead();
777  $ilTabs->activateTab("level_resources");
778 
779  include_once("./Services/Skill/classes/class.ilSkillLevelResourcesTableGUI.php");
781  $this,
782  "showLevelResources",
783  $this->base_skill_id,
784  $this->tref_id,
785  (int) $_GET["level_id"],
786  $this->checkPermissionBool("write")
787  );
788 
789  $tpl->setContent($tab->getHTML());
790  }
$_GET["client_id"]
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
TableGUI class for skill level resources.
setLevelHead()
Set header for level.
+ Here is the call graph for this function:

◆ showProperties()

ilBasicSkillGUI::showProperties ( )

Show properties.

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

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

122  {
123  $tpl = $this->tpl;
124 
125  $this->setTabs();
126  $this->setLocator();
127 
128  $tpl->setContent("Properties");
129  }
setLocator()
Set Locator Items.
setTabs($a_tab="levels")
Set header for skill.
+ Here is the call graph for this function:

◆ updateItem()

ilBasicSkillGUI::updateItem ( )

Update item.

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

References $_POST, and ilSkillTreeNodeGUI\checkPermissionBool().

169  {
170  if (!$this->checkPermissionBool("write")) {
171  return;
172  }
173 
174  $this->node_object->setTitle($this->form->getInput("title"));
175  $this->node_object->setOrderNr($this->form->getInput("order_nr"));
176  $this->node_object->setSelfEvaluation($_POST["self_eval"]);
177  $this->node_object->setStatus($_POST["status"]);
178  $this->node_object->update();
179  }
checkPermissionBool($a_perm)
Check permission pool.
$_POST["username"]
+ Here is the call graph for this function:

◆ updateLevel()

ilBasicSkillGUI::updateLevel ( )

Update level form.

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

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

344  {
345  $lng = $this->lng;
347  $tpl = $this->tpl;
348 
349  if (!$this->checkPermissionBool("write")) {
350  return;
351  }
352 
353  $this->initLevelForm("edit");
354  if ($this->form->checkInput()) {
355  $this->node_object->writeLevelTitle(
356  (int) $_GET["level_id"],
357  $this->form->getInput("title")
358  );
359  $this->node_object->writeLevelDescription(
360  (int) $_GET["level_id"],
361  $this->form->getInput("description")
362  );
363 
364  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
365  $ilCtrl->redirect($this, "edit");
366  }
367 
368  $this->form->setValuesByPost();
369  $tpl->setContent($this->form->getHtml());
370  }
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
initLevelForm($a_mode="edit")
Init level form.
+ Here is the call graph for this function:

◆ updateLevelOrder()

ilBasicSkillGUI::updateLevelOrder ( )

Update level order.

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

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

435  {
436  $lng = $this->lng;
438 
439  if (!$this->checkPermissionBool("write")) {
440  return;
441  }
442 
443  $order = ilUtil::stripSlashesArray($_POST["order"]);
444  $this->node_object->updateLevelOrder($order);
445  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
446  $ilCtrl->redirect($this, "edit");
447  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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.
$_POST["username"]
+ Here is the call graph for this function:

Field Documentation

◆ $base_skill_id

ilBasicSkillGUI::$base_skill_id
protected

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

◆ $ctrl

◆ $help

ilBasicSkillGUI::$help
protected

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

Referenced by setLevelHead(), and setTabs().

◆ $lng

◆ $tabs

◆ $toolbar

ilBasicSkillGUI::$toolbar
protected

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

Referenced by edit(), and showLevelResources().

◆ $tpl

◆ $tree

◆ $tref_id

ilBasicSkillGUI::$tref_id = 0
protected

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


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