ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 ($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...
 
- 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

 $tref_id = 0
 
 $base_skill_id
 

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 26 of file class.ilBasicSkillGUI.php.

References $ilCtrl, and array.

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::__construct($a_node_id);
34  }
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 247 of file class.ilBasicSkillGUI.php.

References $tpl, and initLevelForm().

248  {
249  global $tpl;
250 
251  $this->initLevelForm("create");
252  $tpl->setContent($this->form->getHTML());
253  }
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 732 of file class.ilBasicSkillGUI.php.

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

733  {
734  global $ilCtrl, $ilTabs, $lng, $tree, $tpl;
735 
736  $this->setLevelHead();
737  $ilTabs->activateTab("level_resources");
738 
739  include_once("./Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php");
740  $exp = new ilRepositorySelectorExplorerGUI($this, "addLevelResource",
741  $this, "saveLevelResource", "root_id");
742  if (!$exp->handleCommand())
743  {
744  $tpl->setContent($exp->getHTML());
745  }
746  }
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:17
+ 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 411 of file class.ilBasicSkillGUI.php.

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

412  {
413  global $ilCtrl, $tpl, $lng;
414 
415  if (!$this->checkPermissionBool("write"))
416  {
417  return;
418  }
419 
420  $this->setTabs("levels");
421 
422  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0)
423  {
424  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
425  $ilCtrl->redirect($this, "edit");
426  }
427  else
428  {
429  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
430  $cgui = new ilConfirmationGUI();
431  $cgui->setFormAction($ilCtrl->getFormAction($this));
432  $cgui->setHeaderText($lng->txt("skmg_really_delete_levels"));
433  $cgui->setCancel($lng->txt("cancel"), "edit");
434  $cgui->setConfirm($lng->txt("delete"), "deleteLevel");
435 
436  foreach ($_POST["id"] as $i)
437  {
438  $cgui->addItem("id[]", $i, ilBasicSkill::lookupLevelTitle($i));
439  }
440 
441  $tpl->setContent($cgui->getHTML());
442  }
443  }
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:17
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ confirmLevelResourcesRemoval()

ilBasicSkillGUI::confirmLevelResourcesRemoval ( )

Confirm level resources removal.

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

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

779  {
780  global $ilCtrl, $tpl, $lng, $ilTabs;
781 
782  if (!$this->checkPermissionBool("write"))
783  {
784  return;
785  }
786 
787  $this->setLevelHead();
788  $ilTabs->activateTab("level_resources");
789 
790  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0)
791  {
792  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
793  $ilCtrl->redirect($this, "showLevelResources");
794  }
795  else
796  {
797  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
798  $cgui = new ilConfirmationGUI();
799  $cgui->setFormAction($ilCtrl->getFormAction($this));
800  $cgui->setHeaderText($lng->txt("skmg_confirm_level_resources_removal"));
801  $cgui->setCancel($lng->txt("cancel"), "showLevelResources");
802  $cgui->setConfirm($lng->txt("remove"), "removeLevelResources");
803 
804  foreach ($_POST["id"] as $i)
805  {
807  $cgui->addItem("id[]", $i, $title);
808  }
809 
810  $tpl->setContent($cgui->getHTML());
811  }
812  }
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:17
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ deleteLevel()

ilBasicSkillGUI::deleteLevel ( )

Delete levels.

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

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

449  {
450  global $lng, $ilCtrl;
451 
452  if (!$this->checkPermissionBool("write"))
453  {
454  return;
455  }
456 
457  if (is_array($_POST["id"]))
458  {
459  foreach ($_POST["id"] as $id)
460  {
461  $this->node_object->deleteLevel((int) $id);
462  }
463  $this->node_object->fixLevelNumbering();
464  }
465  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
466  $ilCtrl->redirect($this, "edit");
467  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:17
$_POST["username"]
+ 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(), ilSkillTreeNodeGUI\isInUse(), ilUtil\sendInfo(), and setTabs().

152  {
153  global $tpl, $ilToolbar, $lng, $ilCtrl;
154 
155  $this->setTabs("levels");
156 
157  if ($this->isInUse())
158  {
159  ilUtil::sendInfo($lng->txt("skmg_skill_in_use"));
160  }
161  else
162  {
163  if ($this->checkPermissionBool("write"))
164  {
165  $ilToolbar->addButton($lng->txt("skmg_add_level"),
166  $ilCtrl->getLinkTarget($this, "addLevel"));
167  }
168  }
169 
170  include_once("./Services/Skill/classes/class.ilSkillLevelTableGUI.php");
171  $table = new ilSkillLevelTableGUI($this->base_skill_id, $this, "edit", 0, $this->isInUse());
172  $tpl->setContent($table->getHTML());
173  }
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:17
+ Here is the call graph for this function:

◆ editLevel()

ilBasicSkillGUI::editLevel ( )

Edit level.

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

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

259  {
260  global $tpl, $lng;
261 
262  if ($this->isInUse())
263  {
264  ilUtil::sendInfo($lng->txt("skmg_skill_in_use"));
265  }
266 
267  $this->initLevelForm();
268  $this->getLevelValues();
269  $tpl->setContent($this->form->getHTML());
270  }
global $tpl
Definition: ilias.php:8
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
global $lng
Definition: privfeed.php:17
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 582 of file class.ilBasicSkillGUI.php.

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

583  {
584  global $lng, $ilCtrl, $tpl, $ilTabs;
585 
586  $this->setLevelHead();
587  $ilTabs->activateTab("level_trigger");
588 
589  $trigger = ilBasicSkill::lookupLevelTrigger((int) $_GET["level_id"]);
590  if (ilObject::_lookupType($trigger["obj_id"]) != "crs" ||
591  ilObject::_isInTrash($trigger["ref_id"]))
592  {
593  $trigger = array();
594  }
595 
596  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
597  $this->form = new ilPropertyFormGUI();
598 
599  // trigger
600  $ne = new ilNonEditableValueGUI($lng->txt("skmg_trigger"), "trigger");
601  if ($trigger["obj_id"] > 0)
602  {
603  $ne->setValue(ilObject::_lookupTitle($trigger["obj_id"]));
604  }
605  else
606  {
607  $ne->setValue($lng->txt("skmg_no_trigger"));
608  }
609  $this->form->addItem($ne);
610 
611  if ($trigger["obj_id"] > 0)
612  {
613  $this->form->addCommandButton("removeLevelTrigger", $lng->txt("skmg_remove_trigger"));
614  }
615  $this->form->addCommandButton("selectLevelTrigger", $lng->txt("skmg_select_trigger"));
616 
617  $this->form->setTitle($lng->txt("skmg_skill_level_trigger"));
618  $this->form->setFormAction($ilCtrl->getFormAction($this));
619 
620  $tpl->setContent($this->form->getHTML());
621  }
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 $tpl
Definition: ilias.php:8
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.
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ editProperties()

ilBasicSkillGUI::editProperties ( )

Edit properties.

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

References setTabs().

232  {
233  $this->setTabs("properties");
234  parent::editProperties();
235  }
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.
$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 380 of file class.ilBasicSkillGUI.php.

References $_GET, $data, and array.

Referenced by editLevel().

381  {
382  $values = array();
383 
384  $data = $this->node_object->getLevelData((int) $_GET["level_id"]);
385  $values["title"] = $data["title"];
386  $values["description"] = $data["description"];
387  $this->form->setValuesByArray($values);
388  }
$_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 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 180 of file class.ilBasicSkillGUI.php.

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

181  {
182  global $lng, $ilCtrl;
183 
184  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
185  $this->form = new ilPropertyFormGUI();
186 
187  // title
188  $ti = new ilTextInputGUI($lng->txt("title"), "title");
189  $ti->setMaxLength(200);
190  $ti->setSize(50);
191  $ti->setRequired(true);
192  $this->form->addItem($ti);
193 
194  // order nr
195  $ni = new ilNumberInputGUI($lng->txt("skmg_order_nr"), "order_nr");
196  $ni->setMaxLength(6);
197  $ni->setSize(6);
198  $ni->setRequired(true);
199  $this->form->addItem($ni);
200 
201  // status
202  $this->addStatusInput($this->form);
203 
204  // selectable
205  $cb = new ilCheckboxInputGUI($lng->txt("skmg_selectable"), "self_eval");
206  $cb->setInfo($lng->txt("skmg_selectable_info"));
207  $this->form->addItem($cb);
208 
209  // save and cancel commands
210  if ($this->checkPermissionBool("write"))
211  {
212  if ($a_mode == "create")
213  {
214  $this->form->addCommandButton("save", $lng->txt("save"));
215  $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
216  $this->form->setTitle($lng->txt("skmg_create_skll"));
217  } else
218  {
219  $this->form->addCommandButton("update", $lng->txt("save"));
220  $this->form->setTitle($lng->txt("skmg_edit_skll"));
221  }
222  }
223 
224  $ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
225  $this->form->setFormAction($ilCtrl->getFormAction($this));
226  }
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:17
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 335 of file class.ilBasicSkillGUI.php.

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

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

336  {
337  global $lng, $ilCtrl, $ilTabs;
338 
339  $ilCtrl->saveParameter($this, "level_id");
340  $this->setLevelHead();
341  $ilTabs->activateTab("level_settings");
342 
343  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
344  $this->form = new ilPropertyFormGUI();
345 
346  // title
347  $ti = new ilTextInputGUI($lng->txt("title"), "title");
348  $ti->setMaxLength(200);
349  $ti->setRequired(true);
350  $this->form->addItem($ti);
351 
352  // description
353  $ta = new ilTextAreaInputGUI($lng->txt("description"), "description");
354  $ta->setCols(50);
355  $ta->setRows(5);
356  $this->form->addItem($ta);
357 
358  // save and cancel commands
359  if ($this->checkPermissionBool("write"))
360  {
361  if ($a_mode == "create")
362  {
363  $this->form->addCommandButton("saveLevel", $lng->txt("save"));
364  $this->form->addCommandButton("edit", $lng->txt("cancel"));
365  $this->form->setTitle($lng->txt("skmg_new_level"));
366  } else
367  {
368  $this->form->addCommandButton("updateLevel", $lng->txt("save"));
369  $this->form->addCommandButton("edit", $lng->txt("cancel"));
370  $this->form->setTitle($lng->txt("skmg_edit_level"));
371  }
372  }
373 
374  $this->form->setFormAction($ilCtrl->getFormAction($this));
375  }
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:17
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 (   $a_tmp_mode = false)

Redirect to parent (identified by current obj_id)

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

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

684  {
685  global $ilCtrl;
686 
687  $t = ilSkillTreeNode::_lookupType((int) $_GET["obj_id"]);
688 
689  switch ($t)
690  {
691  case "skrt":
692  $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id", (int) $_GET["obj_id"]);
693  $ilCtrl->redirectByClass("ilskillrootgui", "listSkills");
694  break;
695  }
696 
697  parent::redirectToParent();
698  }
$_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 817 of file class.ilBasicSkillGUI.php.

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

818  {
819  global $ilCtrl, $lng;
820 
821  if (!$this->checkPermissionBool("write"))
822  {
823  return;
824  }
825 
826  if (is_array($_POST["id"]))
827  {
828  include_once("./Services/Skill/classes/class.ilSkillResources.php");
829  $sres = new ilSkillResources($this->base_skill_id, $this->tref_id);
830  foreach ($_POST["id"] as $i)
831  {
832  $sres->setResourceAsImparting((int) $_GET["level_id"], $i, false);
833  }
834  $sres->save();
835  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
836  }
837 
838  $ilCtrl->redirect($this, "showLevelResources");
839  }
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:17
$_POST["username"]
+ Here is the call graph for this function:

◆ removeLevelTrigger()

ilBasicSkillGUI::removeLevelTrigger ( )

Remove trigger.

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

References $_GET, and $ilCtrl.

673  {
674  global $ilCtrl;
675 
676  ilBasicSkill::writeLevelTrigger((int) $_GET["level_id"], 0);
677  $ilCtrl->redirect($this, "editLevelTrigger");
678  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18

◆ 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  }
$_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 275 of file class.ilBasicSkillGUI.php.

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

276  {
277  global $tpl, $lng, $ilCtrl;
278 
279  if (!$this->checkPermissionBool("write"))
280  {
281  return;
282  }
283 
284  $this->initLevelForm("create");
285  if ($this->form->checkInput())
286  {
287  // perform save
288  $this->node_object->addLevel(
289  $this->form->getInput("title"),
290  $this->form->getInput("description"));
291 
292  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
293  $ilCtrl->redirect($this, "edit");
294  }
295 
296  $this->form->setValuesByPost();
297  $tpl->setContent($this->form->getHtml());
298  }
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:17
initLevelForm($a_mode="edit")
Init level form.
+ Here is the call graph for this function:

◆ saveLevelResource()

ilBasicSkillGUI::saveLevelResource ( )

Save level resource.

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

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

752  {
753  global $ilCtrl, $lng;
754 
755  $ref_id = (int) $_GET["root_id"];
756 
757  if (!$this->checkPermissionBool("write"))
758  {
759  return;
760  }
761 
762  if ($ref_id > 0)
763  {
764  include_once("./Services/Skill/classes/class.ilSkillResources.php");
765  $sres = new ilSkillResources($this->base_skill_id, $this->tref_id);
766  $sres->setResourceAsImparting((int) $_GET["level_id"], $ref_id);
767  $sres->save();
768 
769  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
770  }
771 
772  $ilCtrl->redirect($this, "showLevelResources");
773  }
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:17
+ Here is the call graph for this function:

◆ saveLevelTrigger()

ilBasicSkillGUI::saveLevelTrigger ( )

Save level trigger.

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

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

657  {
658  global $ilCtrl;
659 
660  if (!$this->checkPermissionBool("write"))
661  {
662  return;
663  }
664 
665  ilBasicSkill::writeLevelTrigger((int) $_GET["level_id"], (int) $_GET["root_id"]);
666  $ilCtrl->redirect($this, "editLevelTrigger");
667  }
$_GET["client_id"]
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ selectLevelTrigger()

ilBasicSkillGUI::selectLevelTrigger ( )

Select skill level trigger.

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

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

627  {
628  global $ilCtrl, $ilTabs, $lng, $tree, $tpl;
629 
630  if (!$this->checkPermissionBool("write"))
631  {
632  return;
633  }
634 
635  $this->setLevelHead();
636  $ilTabs->activateTab("level_trigger");
637 
638  include_once 'Services/Search/classes/class.ilSearchRootSelector.php';
639  $exp = new ilSearchRootSelector(
640  $ilCtrl->getLinkTarget($this,'showRepositorySelection'));
641  $exp->setExpand($_GET["search_root_expand"] ? $_GET["search_root_expand"] : $tree->readRootId());
642  $exp->setExpandTarget($ilCtrl->getLinkTarget($this,'selectLevelTrigger'));
643  $exp->setTargetClass(get_class($this));
644  $exp->setCmd('saveLevelTrigger');
645  $exp->setClickableTypes(array("crs"));
646 
647  // build html-output
648  $exp->setOutput(0);
649  $tpl->setContent($exp->getOutput());
650 
651  }
$_GET["client_id"]
global $tpl
Definition: ilias.php:8
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.
global $lng
Definition: privfeed.php:17
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 472 of file class.ilBasicSkillGUI.php.

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

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

473  {
474  global $ilTabs, $ilCtrl, $tpl, $lng, $ilHelp;
475 
476  // tabs
477  $ilTabs->clearTargets();
478  $ilHelp->setScreenIdComponent("skmg_lev");
479 
480  $ilTabs->setBackTarget($lng->txt("back"),
481  $ilCtrl->getLinkTarget($this, "edit"));
482 
483  if ($_GET["level_id"] > 0)
484  {
485  $ilTabs->addTab("level_settings",
486  $lng->txt("settings"),
487  $ilCtrl->getLinkTarget($this, "editLevel"));
488 
489 /* $ilTabs->addTab("level_trigger",
490  $lng->txt("skmg_trigger"),
491  $ilCtrl->getLinkTarget($this, "editLevelTrigger"));*/
492 
493  $ilTabs->addTab("level_resources",
494  $lng->txt("skmg_resources"),
495  $ilCtrl->getLinkTarget($this, "showLevelResources"));
496 /*
497  $ilTabs->addTab("level_certificate",
498  $lng->txt("certificate"),
499  $ilCtrl->getLinkTargetByClass("ilcertificategui", "certificateEditor"));*/
500 
501  }
502 
503  // title
504  if ($_GET["level_id"] > 0)
505  {
506  $tpl->setTitle($lng->txt("skmg_skill_level").": ".
507  ilBasicSkill::lookupLevelTitle((int) $_GET["level_id"]));
508  }
509  else
510  {
511  $tpl->setTitle($lng->txt("skmg_skill_level"));
512  }
513 
514  include_once("./Services/Skill/classes/class.ilSkillTree.php");
515  $tree = new ilSkillTree();
516  $path = $tree->getPathFull($this->node_object->getId());
517  $desc = "";
518  foreach ($path as $p)
519  {
520  if (in_array($p["type"], array("scat", "skll")))
521  {
522  $desc.= $sep.$p["title"];
523  $sep = " > ";
524  }
525  }
526  $tpl->setDescription($desc);
527  }
$path
Definition: aliased.php:25
static lookupLevelTitle($a_id)
Lookup level title.
Skill tree.
$_GET["client_id"]
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.
global $lng
Definition: privfeed.php:17
+ 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 534 of file class.ilBasicSkillGUI.php.

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

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

535  {
536  global $ilTabs, $ilCtrl, $tpl, $lng, $ilHelp;
537 
538  $ilTabs->clearTargets();
539  $ilHelp->setScreenIdComponent("skmg_skll");
540 // $ilTabs->setBackTarget($lng->txt("skmg_skill_hierarchie"),
541 // $ilCtrl->getLinkTargetByClass("ilobjskillmanagementgui", "editSkills"));
542 
543  if (is_object($this->node_object))
544  {
545 
546  // levels
547  $ilTabs->addTab("levels", $lng->txt("skmg_skill_levels"),
548  $ilCtrl->getLinkTarget($this, 'edit'));
549 
550  // properties
551  $ilTabs->addTab("properties", $lng->txt("settings"),
552  $ilCtrl->getLinkTarget($this, 'editProperties'));
553 
554  // usage
555  $this->addUsageTab($ilTabs);
556 
557  $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id",
558  $this->node_object->skill_tree->getRootId());
559  $ilTabs->setBackTarget($lng->txt("obj_skmg"),
560  $ilCtrl->getLinkTargetByClass("ilskillrootgui", "listSkills"));
561  $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id",
562  $_GET["obj_id"]);
563 
564  $ilTabs->activateTab($a_tab);
565 
566  $tpl->setTitle($lng->txt("skmg_skill").": ".
567  $this->node_object->getTitle());
568 
569  $this->setSkillNodeDescription();
570  }
571  else
572  {
573  $tpl->setTitle($lng->txt("skmg_skill"));
574  $tpl->setDescription("");
575  }
576  parent::setTitleIcon();
577  }
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:17
+ 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 708 of file class.ilBasicSkillGUI.php.

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

709  {
710  global $tpl, $ilTabs, $ilToolbar, $lng, $ilCtrl;
711 
712  if ($this->checkPermissionBool("write"))
713  {
714  $ilToolbar->addButton(
715  $lng->txt("skmg_add_resource"),
716  $ilCtrl->getLinkTarget($this, "addLevelResource"));
717  }
718 
719  $this->setLevelHead();
720  $ilTabs->activateTab("level_resources");
721 
722  include_once("./Services/Skill/classes/class.ilSkillLevelResourcesTableGUI.php");
723  $tab = new ilSkillLevelResourcesTableGUI($this, "showLevelResources",
724  $this->base_skill_id, $this->tref_id, (int) $_GET["level_id"]);
725 
726  $tpl->setContent($tab->getHTML());
727  }
$_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:17
+ 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  }
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 303 of file class.ilBasicSkillGUI.php.

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

304  {
305  global $lng, $ilCtrl, $tpl;
306 
307  if (!$this->checkPermissionBool("write"))
308  {
309  return;
310  }
311 
312  $this->initLevelForm("edit");
313  if ($this->form->checkInput())
314  {
315  $this->node_object->writeLevelTitle(
316  (int) $_GET["level_id"],
317  $this->form->getInput("title"));
318  $this->node_object->writeLevelDescription(
319  (int) $_GET["level_id"],
320  $this->form->getInput("description"));
321 
322  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
323  $ilCtrl->redirect($this, "edit");
324  }
325 
326  $this->form->setValuesByPost();
327  $tpl->setContent($this->form->getHtml());
328  }
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:17
initLevelForm($a_mode="edit")
Init level form.
+ Here is the call graph for this function:

◆ updateLevelOrder()

ilBasicSkillGUI::updateLevelOrder ( )

Update level order.

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

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

394  {
395  global $lng, $ilCtrl;
396 
397  if (!$this->checkPermissionBool("write"))
398  {
399  return;
400  }
401 
402  $order = ilUtil::stripSlashesArray($_POST["order"]);
403  $this->node_object->updateLevelOrder($order);
404  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
405  $ilCtrl->redirect($this, "edit");
406  }
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.
global $lng
Definition: privfeed.php:17
$_POST["username"]
+ 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: