ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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, and $ilCtrl.

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

Member Function Documentation

◆ addLevel()

ilBasicSkillGUI::addLevel ( )

Add new level.

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

References $tpl, and initLevelForm().

281  {
282  $tpl = $this->tpl;
283 
284  $this->initLevelForm("create");
285  $tpl->setContent($this->form->getHTML());
286  }
initLevelForm($a_mode="edit")
Init level form.
+ Here is the call graph for this function:

◆ addLevelResource()

ilBasicSkillGUI::addLevelResource ( )

Add level resource.

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

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

790  {
792  $ilTabs = $this->tabs;
793  $lng = $this->lng;
794  $tree = $this->tree;
795  $tpl = $this->tpl;
796 
797  $this->setLevelHead();
798  $ilTabs->activateTab("level_resources");
799 
800  include_once("./Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php");
802  $this,
803  "addLevelResource",
804  $this,
805  "saveLevelResource",
806  "root_id"
807  );
808  if (!$exp->handleCommand()) {
809  $tpl->setContent($exp->getHTML());
810  }
811  }
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 161 of file class.ilBasicSkillGUI.php.

References $ctrl, and $ilCtrl.

162  {
164 
165  $ilCtrl->setParameterByClass(
166  "ilbasicskillgui",
167  "obj_id",
168  $this->node_object->getId()
169  );
170  $ilCtrl->redirectByClass("ilbasicskillgui", "edit");
171  }
global $ilCtrl
Definition: ilias.php:18

◆ confirmLevelDeletion()

ilBasicSkillGUI::confirmLevelDeletion ( )

Confirm level deletion.

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

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

447  {
449  $tpl = $this->tpl;
450  $lng = $this->lng;
451 
452  if (!$this->checkPermissionBool("write")) {
453  return;
454  }
455 
456  $this->setTabs("levels");
457 
458  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0) {
459  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
460  $ilCtrl->redirect($this, "edit");
461  } else {
462  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
463  $cgui = new ilConfirmationGUI();
464  $cgui->setFormAction($ilCtrl->getFormAction($this));
465  $cgui->setHeaderText($lng->txt("skmg_really_delete_levels"));
466  $cgui->setCancel($lng->txt("cancel"), "edit");
467  $cgui->setConfirm($lng->txt("delete"), "deleteLevel");
468 
469  foreach ($_POST["id"] as $i) {
470  $cgui->addItem("id[]", $i, ilBasicSkill::lookupLevelTitle($i));
471  }
472 
473  $tpl->setContent($cgui->getHTML());
474  }
475  }
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 842 of file class.ilBasicSkillGUI.php.

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

843  {
845  $tpl = $this->tpl;
846  $lng = $this->lng;
847  $ilTabs = $this->tabs;
848 
849  if (!$this->checkPermissionBool("write")) {
850  return;
851  }
852 
853  $this->setLevelHead();
854  $ilTabs->activateTab("level_resources");
855 
856  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0) {
857  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
858  $ilCtrl->redirect($this, "showLevelResources");
859  } else {
860  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
861  $cgui = new ilConfirmationGUI();
862  $cgui->setFormAction($ilCtrl->getFormAction($this));
863  $cgui->setHeaderText($lng->txt("skmg_confirm_level_resources_removal"));
864  $cgui->setCancel($lng->txt("cancel"), "showLevelResources");
865  $cgui->setConfirm($lng->txt("remove"), "removeLevelResources");
866 
867  foreach ($_POST["id"] as $i) {
869  $cgui->addItem("id[]", $i, $title);
870  }
871 
872  $tpl->setContent($cgui->getHTML());
873  }
874  }
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 480 of file class.ilBasicSkillGUI.php.

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

481  {
482  $lng = $this->lng;
484 
485  if (!$this->checkPermissionBool("write")) {
486  return;
487  }
488 
489  if (is_array($_POST["id"])) {
490  foreach ($_POST["id"] as $id) {
491  $this->node_object->deleteLevel((int) $id);
492  }
493  $this->node_object->fixLevelNumbering();
494  }
495  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
496  $ilCtrl->redirect($this, "edit");
497  }
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 191 of file class.ilBasicSkillGUI.php.

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

192  {
193  $tpl = $this->tpl;
194  $ilToolbar = $this->toolbar;
195  $lng = $this->lng;
197 
198  $this->setTabs("levels");
199 
200  if ($this->isInUse()) {
201  ilUtil::sendInfo($lng->txt("skmg_skill_in_use"));
202  } else {
203  if ($this->checkPermissionBool("write")) {
204  $ilToolbar->addButton(
205  $lng->txt("skmg_add_level"),
206  $ilCtrl->getLinkTarget($this, "addLevel")
207  );
208  }
209  }
210 
211  include_once("./Services/Skill/classes/class.ilSkillLevelTableGUI.php");
212  $table = new ilSkillLevelTableGUI($this->base_skill_id, $this, "edit", 0, $this->isInUse());
213  $tpl->setContent($table->getHTML());
214  }
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 291 of file class.ilBasicSkillGUI.php.

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

292  {
293  $tpl = $this->tpl;
294  $lng = $this->lng;
295 
296  if ($this->isInUse()) {
297  ilUtil::sendInfo($lng->txt("skmg_skill_in_use"));
298  }
299 
300  $this->initLevelForm();
301  $this->getLevelValues();
302  $tpl->setContent($this->form->getHTML());
303  }
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 630 of file class.ilBasicSkillGUI.php.

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

631  {
632  $lng = $this->lng;
634  $tpl = $this->tpl;
635  $ilTabs = $this->tabs;
636 
637  $this->setLevelHead();
638  $ilTabs->activateTab("level_trigger");
639 
640  $trigger = ilBasicSkill::lookupLevelTrigger((int) $_GET["level_id"]);
641  if (ilObject::_lookupType($trigger["obj_id"]) != "crs" ||
642  ilObject::_isInTrash($trigger["ref_id"])) {
643  $trigger = array();
644  }
645 
646  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
647  $this->form = new ilPropertyFormGUI();
648 
649  // trigger
650  $ne = new ilNonEditableValueGUI($lng->txt("skmg_trigger"), "trigger");
651  if ($trigger["obj_id"] > 0) {
652  $ne->setValue(ilObject::_lookupTitle($trigger["obj_id"]));
653  } else {
654  $ne->setValue($lng->txt("skmg_no_trigger"));
655  }
656  $this->form->addItem($ne);
657 
658  if ($trigger["obj_id"] > 0) {
659  $this->form->addCommandButton("removeLevelTrigger", $lng->txt("skmg_remove_trigger"));
660  }
661  $this->form->addCommandButton("selectLevelTrigger", $lng->txt("skmg_select_trigger"));
662 
663  $this->form->setTitle($lng->txt("skmg_skill_level_trigger"));
664  $this->form->setFormAction($ilCtrl->getFormAction($this));
665 
666  $tpl->setContent($this->form->getHTML());
667  }
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
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 264 of file class.ilBasicSkillGUI.php.

References setTabs().

265  {
266  $this->setTabs("properties");
267  parent::editProperties();
268  }
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 
105  $skillLevelId = (int) $_GET["level_id"];
106 
107  $output_gui = new ilCertificateGUI(
108  new ilSkillCertificateAdapter($this->node_object, $skillLevelId),
111  $this->node_object->getId(),
112  ilCertificatePathConstants::SKILL_PATH . $this->node_object->getId() . '/' . $skillLevelId
113  );
114 
115  $ret = $ilCtrl->forwardCommand($output_gui);
116  break;
117 
118  default:
119  $ret = $this->$cmd();
120  break;
121  }
122  }
Collection of basic placeholder values that can be used.
$_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
Collection of basic placeholder values that can be used.
+ Here is the call graph for this function:

◆ getLevelValues()

ilBasicSkillGUI::getLevelValues ( )

Get current values for level from.

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

References $_GET, $data, and $values.

Referenced by editLevel().

416  {
417  $values = array();
418 
419  $data = $this->node_object->getLevelData((int) $_GET["level_id"]);
420  $values["title"] = $data["title"];
421  $values["description"] = $data["description"];
422  $this->form->setValuesByArray($values);
423  }
$_GET["client_id"]
$values
$data
Definition: bench.php:6
+ 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 221 of file class.ilBasicSkillGUI.php.

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

222  {
223  $lng = $this->lng;
225 
226  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
227  $this->form = new ilPropertyFormGUI();
228 
229  // title
230  $ti = new ilTextInputGUI($lng->txt("title"), "title");
231  $ti->setMaxLength(200);
232  $ti->setSize(50);
233  $ti->setRequired(true);
234  $this->form->addItem($ti);
235 
236 
237  // status
238  $this->addStatusInput($this->form);
239 
240  // selectable
241  $cb = new ilCheckboxInputGUI($lng->txt("skmg_selectable"), "self_eval");
242  $cb->setInfo($lng->txt("skmg_selectable_info"));
243  $this->form->addItem($cb);
244 
245  // save and cancel commands
246  if ($this->checkPermissionBool("write")) {
247  if ($a_mode == "create") {
248  $this->form->addCommandButton("save", $lng->txt("save"));
249  $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
250  $this->form->setTitle($lng->txt("skmg_create_skll"));
251  } else {
252  $this->form->addCommandButton("update", $lng->txt("save"));
253  $this->form->setTitle($lng->txt("skmg_edit_skll"));
254  }
255  }
256 
257  $ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
258  $this->form->setFormAction($ilCtrl->getFormAction($this));
259  }
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 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 371 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().

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

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

732  {
734 
735  $t = ilSkillTreeNode::_lookupType((int) $_GET["obj_id"]);
736 
737  switch ($t) {
738  case "skrt":
739  $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id", (int) $_GET["obj_id"]);
740  $ilCtrl->redirectByClass("ilskillrootgui", "listSkills");
741  break;
742  }
743 
744  parent::redirectToParent();
745  }
$_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 879 of file class.ilBasicSkillGUI.php.

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

880  {
882  $lng = $this->lng;
883 
884  if (!$this->checkPermissionBool("write")) {
885  return;
886  }
887 
888  if (is_array($_POST["id"])) {
889  include_once("./Services/Skill/classes/class.ilSkillResources.php");
890  $sres = new ilSkillResources($this->base_skill_id, $this->tref_id);
891  foreach ($_POST["id"] as $i) {
892  $sres->setResourceAsImparting((int) $_GET["level_id"], $i, false);
893  $sres->setResourceAsTrigger((int) $_GET["level_id"], $i, false);
894  }
895  $sres->save();
896  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
897  }
898 
899  $ilCtrl->redirect($this, "showLevelResources");
900  }
$_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 720 of file class.ilBasicSkillGUI.php.

References $_GET, $ctrl, and $ilCtrl.

721  {
723 
724  ilBasicSkill::writeLevelTrigger((int) $_GET["level_id"], 0);
725  $ilCtrl->redirect($this, "editLevelTrigger");
726  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18

◆ saveItem()

ilBasicSkillGUI::saveItem ( )

Save item.

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

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

141  {
142  if (!$this->checkPermissionBool("write")) {
143  return;
144  }
145 
146  $tree = new ilSkillTree();
147 
148  $it = new ilBasicSkill();
149  $it->setTitle($this->form->getInput("title"));
150  $it->setOrderNr($tree->getMaxOrderNr((int) $_GET["obj_id"]) + 10);
151  $it->setStatus($this->form->getInput("status"));
152  $it->setSelfEvaluation($_POST["self_eval"]);
153  $it->create();
154  ilSkillTreeNode::putInTree($it, (int) $_GET["obj_id"], IL_LAST_NODE);
155  $this->node_object = $it;
156  }
Skill tree.
$_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 308 of file class.ilBasicSkillGUI.php.

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

309  {
310  $tpl = $this->tpl;
311  $lng = $this->lng;
313 
314  if (!$this->checkPermissionBool("write")) {
315  return;
316  }
317 
318  $this->initLevelForm("create");
319  if ($this->form->checkInput()) {
320  // perform save
321  $this->node_object->addLevel(
322  $this->form->getInput("title"),
323  $this->form->getInput("description")
324  );
325 
326  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
327  $ilCtrl->redirect($this, "edit");
328  }
329 
330  $this->form->setValuesByPost();
331  $tpl->setContent($this->form->getHtml());
332  }
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 816 of file class.ilBasicSkillGUI.php.

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

817  {
819  $lng = $this->lng;
820 
821  $ref_id = (int) $_GET["root_id"];
822 
823  if (!$this->checkPermissionBool("write")) {
824  return;
825  }
826 
827  if ($ref_id > 0) {
828  include_once("./Services/Skill/classes/class.ilSkillResources.php");
829  $sres = new ilSkillResources($this->base_skill_id, $this->tref_id);
830  $sres->setResourceAsImparting((int) $_GET["level_id"], $ref_id);
831  $sres->save();
832 
833  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
834  }
835 
836  $ilCtrl->redirect($this, "showLevelResources");
837  }
$_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 705 of file class.ilBasicSkillGUI.php.

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

706  {
708 
709  if (!$this->checkPermissionBool("write")) {
710  return;
711  }
712 
713  ilBasicSkill::writeLevelTrigger((int) $_GET["level_id"], (int) $_GET["root_id"]);
714  $ilCtrl->redirect($this, "editLevelTrigger");
715  }
$_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 908 of file class.ilBasicSkillGUI.php.

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

909  {
911 
912  include_once("./Services/Skill/classes/class.ilSkillResources.php");
913  $resources = new ilSkillResources($this->base_skill_id, $this->tref_id);
914 
915  foreach ($resources->getResourcesOfLevel((int) $_GET["level_id"]) as $r) {
916  $imparting = false;
917  if (is_array($_POST["suggested"]) && isset($_POST["suggested"][$r["rep_ref_id"]]) && $_POST["suggested"][$r["rep_ref_id"]]) {
918  $imparting = true;
919  }
920  $trigger = false;
921  if (is_array($_POST["trigger"]) && isset($_POST["trigger"][$r["rep_ref_id"]]) && $_POST["trigger"][$r["rep_ref_id"]]) {
922  $trigger = true;
923  }
924  $resources->setResourceAsImparting((int) $_GET["level_id"], $r["rep_ref_id"], $imparting);
925  $resources->setResourceAsTrigger((int) $_GET["level_id"], $r["rep_ref_id"], $trigger);
926  }
927  $resources->save();
928 
929  $ilCtrl->redirect($this, "showLevelResources");
930  }
$_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 672 of file class.ilBasicSkillGUI.php.

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

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

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

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

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

◆ setTabs()

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

Set header for skill.

Parameters
string$a_tabactive tab

Definition at line 567 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().

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

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

756  {
757  $tpl = $this->tpl;
758  $ilTabs = $this->tabs;
759  $ilToolbar = $this->toolbar;
760  $lng = $this->lng;
762 
763  if ($this->checkPermissionBool("write")) {
764  $ilToolbar->addButton(
765  $lng->txt("skmg_add_resource"),
766  $ilCtrl->getLinkTarget($this, "addLevelResource")
767  );
768  }
769 
770  $this->setLevelHead();
771  $ilTabs->activateTab("level_resources");
772 
773  include_once("./Services/Skill/classes/class.ilSkillLevelResourcesTableGUI.php");
775  $this,
776  "showLevelResources",
777  $this->base_skill_id,
778  $this->tref_id,
779  (int) $_GET["level_id"],
780  $this->checkPermissionBool("write")
781  );
782 
783  $tpl->setContent($tab->getHTML());
784  }
$_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 127 of file class.ilBasicSkillGUI.php.

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

128  {
129  $tpl = $this->tpl;
130 
131  $this->setTabs();
132  $this->setLocator();
133 
134  $tpl->setContent("Properties");
135  }
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 176 of file class.ilBasicSkillGUI.php.

References $_POST, and ilSkillTreeNodeGUI\checkPermissionBool().

177  {
178  if (!$this->checkPermissionBool("write")) {
179  return;
180  }
181 
182  $this->node_object->setTitle($this->form->getInput("title"));
183  $this->node_object->setSelfEvaluation($_POST["self_eval"]);
184  $this->node_object->setStatus($_POST["status"]);
185  $this->node_object->update();
186  }
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 337 of file class.ilBasicSkillGUI.php.

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

338  {
339  $lng = $this->lng;
341  $tpl = $this->tpl;
342 
343  if (!$this->checkPermissionBool("write")) {
344  return;
345  }
346 
347  $this->initLevelForm("edit");
348  if ($this->form->checkInput()) {
349  $this->node_object->writeLevelTitle(
350  (int) $_GET["level_id"],
351  $this->form->getInput("title")
352  );
353  $this->node_object->writeLevelDescription(
354  (int) $_GET["level_id"],
355  $this->form->getInput("description")
356  );
357 
358  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
359  $ilCtrl->redirect($this, "edit");
360  }
361 
362  $this->form->setValuesByPost();
363  $tpl->setContent($this->form->getHtml());
364  }
$_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 428 of file class.ilBasicSkillGUI.php.

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

429  {
430  $lng = $this->lng;
432 
433  if (!$this->checkPermissionBool("write")) {
434  return;
435  }
436 
437  $order = ilUtil::stripSlashesArray($_POST["order"]);
438  $this->node_object->updateLevelOrder($order);
439  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
440  $ilCtrl->redirect($this, "edit");
441  }
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: