ILIAS  release_7 Revision v7.30-3-g800a261c036
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...
 
 addObjectsTab ($a_tabs)
 
 showObjects ()
 Show assigned objects. 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

Basic skill GUI class.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e @ilCtrl_isCalledBy ilBasicSkillGUI: ilObjSkillManagementGUI @ilCtrl_Calls ilBasicSkillGUI: ilCertificateGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilBasicSkillGUI::__construct (   $a_node_id = 0)

Constructor.

Reimplemented from ilSkillTreeNodeGUI.

Reimplemented in ilSkillTemplateReferenceGUI.

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

56 {
57 global $DIC;
58
59 $this->ctrl = $DIC->ctrl();
60 $this->tpl = $DIC["tpl"];
61 $this->tabs = $DIC->tabs();
62 $this->help = $DIC["ilHelp"];
63 $this->toolbar = $DIC->toolbar();
64 $this->lng = $DIC->language();
65 $this->tree = $DIC->repositoryTree();
66 $ilCtrl = $DIC->ctrl();
67
68 $ilCtrl->saveParameter($this, array("obj_id", "level_id"));
69 $this->base_skill_id = $a_node_id;
70
71 parent::__construct($a_node_id);
72 }
global $DIC
Definition: goto.php:24
help()
Definition: help.php:2
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), and help().

+ Here is the call graph for this function:

Member Function Documentation

◆ addLevel()

ilBasicSkillGUI::addLevel ( )

Add new level.

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

279 {
281
282 $this->initLevelForm("create");
283 $tpl->setContent($this->form->getHTML());
284 }
initLevelForm($a_mode="edit")
Init level form.

References $tpl, and initLevelForm().

+ Here is the call graph for this function:

◆ addLevelResource()

ilBasicSkillGUI::addLevelResource ( )

Add level resource.

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

785 {
786 $ilTabs = $this->tabs;
788
789 $this->setLevelHead();
790 $ilTabs->activateTab("level_resources");
791
793 $this,
794 "addLevelResource",
795 $this,
796 "saveLevelResource",
797 "root_id"
798 );
799 if (!$exp->handleCommand()) {
800 $tpl->setContent($exp->getHTML());
801 }
802 }
setLevelHead()
Set header for level.
Explorer for selecting repository items.

References $tabs, $tpl, and setLevelHead().

+ Here is the call graph for this function:

◆ afterSave()

ilBasicSkillGUI::afterSave ( )

After saving.

Reimplemented from ilSkillTreeNodeGUI.

Reimplemented in ilBasicSkillTemplateGUI, and ilSkillTemplateReferenceGUI.

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

157 {
158 $ilCtrl = $this->ctrl;
159
160 $ilCtrl->setParameterByClass(
161 "ilbasicskillgui",
162 "obj_id",
163 $this->node_object->getId()
164 );
165 $ilCtrl->redirectByClass("ilbasicskillgui", "edit");
166 }

References $ctrl.

◆ confirmLevelDeletion()

ilBasicSkillGUI::confirmLevelDeletion ( )

Confirm level deletion.

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

444 {
445 $ilCtrl = $this->ctrl;
448
449 if (!$this->checkPermissionBool("write")) {
450 return;
451 }
452
453 $this->setTabs("levels");
454
455 if (!is_array($_POST["id"]) || count($_POST["id"]) == 0) {
456 ilUtil::sendInfo($lng->txt("no_checkbox"), true);
457 $ilCtrl->redirect($this, "edit");
458 } else {
459 $cgui = new ilConfirmationGUI();
460 $cgui->setFormAction($ilCtrl->getFormAction($this));
461 $cgui->setHeaderText($lng->txt("skmg_really_delete_levels"));
462 $cgui->setCancel($lng->txt("cancel"), "edit");
463 $cgui->setConfirm($lng->txt("delete"), "deleteLevel");
464
465 foreach ($_POST["id"] as $i) {
466 $cgui->addItem("id[]", $i, ilBasicSkill::lookupLevelTitle($i));
467 }
468
469 $tpl->setContent($cgui->getHTML());
470 }
471 }
$_POST["username"]
setTabs($a_tab="levels")
Set header for skill.
static lookupLevelTitle(int $a_id)
Confirmation screen class.
checkPermissionBool($a_perm)
Check permission pool.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$i
Definition: metadata.php:24

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

+ Here is the call graph for this function:

◆ confirmLevelResourcesRemoval()

ilBasicSkillGUI::confirmLevelResourcesRemoval ( )

Confirm level resources removal.

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

833 {
834 $ilCtrl = $this->ctrl;
837 $ilTabs = $this->tabs;
838
839 if (!$this->checkPermissionBool("write")) {
840 return;
841 }
842
843 $this->setLevelHead();
844 $ilTabs->activateTab("level_resources");
845
846 if (!is_array($_POST["id"]) || count($_POST["id"]) == 0) {
847 ilUtil::sendInfo($lng->txt("no_checkbox"), true);
848 $ilCtrl->redirect($this, "showLevelResources");
849 } else {
850 $cgui = new ilConfirmationGUI();
851 $cgui->setFormAction($ilCtrl->getFormAction($this));
852 $cgui->setHeaderText($lng->txt("skmg_confirm_level_resources_removal"));
853 $cgui->setCancel($lng->txt("cancel"), "showLevelResources");
854 $cgui->setConfirm($lng->txt("remove"), "removeLevelResources");
855
856 foreach ($_POST["id"] as $i) {
858 $cgui->addItem("id[]", $i, $title);
859 }
860
861 $tpl->setContent($cgui->getHTML());
862 }
863 }
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title

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

+ Here is the call graph for this function:

◆ deleteLevel()

ilBasicSkillGUI::deleteLevel ( )

Delete levels.

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

477 {
479 $ilCtrl = $this->ctrl;
480
481 if (!$this->checkPermissionBool("write")) {
482 return;
483 }
484
485 if (is_array($_POST["id"])) {
486 foreach ($_POST["id"] as $id) {
487 $this->node_object->deleteLevel((int) $id);
488 }
489 $this->node_object->fixLevelNumbering();
490 }
491 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
492 $ilCtrl->redirect($this, "edit");
493 }

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

+ Here is the call graph for this function:

◆ edit()

ilBasicSkillGUI::edit ( )

Edit skill.

Reimplemented in ilBasicSkillTemplateGUI.

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

188 {
190 $ilToolbar = $this->toolbar;
192 $ilCtrl = $this->ctrl;
193
194 $this->setTabs("levels");
195
196 if ($this->isInUse()) {
197 ilUtil::sendInfo($lng->txt("skmg_skill_in_use"));
198 } else {
199 if ($this->checkPermissionBool("write")) {
200 $ilToolbar->addButton(
201 $lng->txt("skmg_add_level"),
202 $ilCtrl->getLinkTarget($this, "addLevel")
203 );
204 }
205 }
206
207 $table = new ilSkillLevelTableGUI($this->base_skill_id, $this, "edit", 0, $this->isInUse());
208 $tpl->setContent($table->getHTML());
209 }

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

+ Here is the call graph for this function:

◆ editLevel()

ilBasicSkillGUI::editLevel ( )

Edit level.

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

290 {
293
294 if ($this->isInUse()) {
295 ilUtil::sendInfo($lng->txt("skmg_skill_in_use"));
296 }
297
298 $this->initLevelForm();
299 $this->getLevelValues();
300 $tpl->setContent($this->form->getHTML());
301 }
getLevelValues()
Get current values for level from.

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

+ Here is the call graph for this function:

◆ editLevelTrigger()

ilBasicSkillGUI::editLevelTrigger ( )

Edit level trigger.

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

629 {
631 $ilCtrl = $this->ctrl;
633 $ilTabs = $this->tabs;
634
635 $this->setLevelHead();
636 $ilTabs->activateTab("level_trigger");
637
638 $trigger = ilBasicSkill::lookupLevelTrigger((int) $_GET["level_id"]);
639 if (ilObject::_lookupType($trigger["obj_id"]) != "crs" ||
640 ilObject::_isInTrash($trigger["ref_id"])) {
641 $trigger = array();
642 }
643
644 $this->form = new ilPropertyFormGUI();
645
646 // trigger
647 $ne = new ilNonEditableValueGUI($lng->txt("skmg_trigger"), "trigger");
648 if ($trigger["obj_id"] > 0) {
649 $ne->setValue(ilObject::_lookupTitle($trigger["obj_id"]));
650 } else {
651 $ne->setValue($lng->txt("skmg_no_trigger"));
652 }
653 $this->form->addItem($ne);
654
655 if ($trigger["obj_id"] > 0) {
656 $this->form->addCommandButton("removeLevelTrigger", $lng->txt("skmg_remove_trigger"));
657 }
658 $this->form->addCommandButton("selectLevelTrigger", $lng->txt("skmg_select_trigger"));
659
660 $this->form->setTitle($lng->txt("skmg_skill_level_trigger"));
661 $this->form->setFormAction($ilCtrl->getFormAction($this));
662
663 $tpl->setContent($this->form->getHTML());
664 }
$_GET["client_id"]
This class represents a non editable value in a property form.
static _isInTrash($a_ref_id)
checks wether object is in trash
static _lookupType($a_id, $a_reference=false)
lookup object type
This class represents a property form user interface.

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

+ Here is the call graph for this function:

◆ editProperties()

ilBasicSkillGUI::editProperties ( )

Edit properties.

Reimplemented from ilSkillTreeNodeGUI.

Reimplemented in ilSkillTemplateReferenceGUI.

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

263 {
264 $this->setTabs("properties");
265 parent::editProperties();
266 }

References setTabs().

+ Here is the call graph for this function:

◆ executeCommand()

ilBasicSkillGUI::executeCommand ( )

Execute command.

Reimplemented in ilSkillTemplateReferenceGUI.

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

86 {
87 $ilCtrl = $this->ctrl;
88 $ilTabs = $this->tabs;
89
90 //$tpl->getStandardTemplate();
91
92 $next_class = $ilCtrl->getNextClass($this);
93 $cmd = $ilCtrl->getCmd();
94 switch ($next_class) {
95 case "ilcertificategui":
96 $this->setLevelHead();
97 $ilTabs->activateTab("level_certificate");
98
99 $skillLevelId = (int) $_GET["level_id"];
100
101 $output_gui = new ilCertificateGUI(
102 new ilSkillCertificateAdapter($this->node_object, $skillLevelId),
105 $this->node_object->getId(),
106 ilCertificatePathConstants::SKILL_PATH . $this->node_object->getId() . '/' . $skillLevelId
107 );
108
109 $ret = $ilCtrl->forwardCommand($output_gui);
110 break;
111
112 default:
113 $ret = $this->$cmd();
114 break;
115 }
116 }
GUI class to create PDF certificates.
Collection of basic placeholder values that can be used.
Collection of basic placeholder values that can be used.
$ret
Definition: parser.php:6

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

+ Here is the call graph for this function:

◆ getLevelValues()

ilBasicSkillGUI::getLevelValues ( )

Get current values for level from.

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

413 {
414 $values = array();
415
416 $data = $this->node_object->getLevelData((int) $_GET["level_id"]);
417 $values["title"] = $data["title"];
418 $values["description"] = $data["description"];
419 $this->form->setValuesByArray($values);
420 }
$data
Definition: storeScorm.php:23

References $_GET, and $data.

Referenced by editLevel().

+ Here is the caller graph for this function:

◆ getType()

ilBasicSkillGUI::getType ( )

Get Node Type.

Reimplemented in ilBasicSkillTemplateGUI, and ilSkillTemplateReferenceGUI.

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

78 {
79 return "skll";
80 }

◆ initForm()

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

Init form.

Parameters
int$a_modeEdit Mode

Reimplemented from ilSkillTreeNodeGUI.

Reimplemented in ilBasicSkillTemplateGUI, and ilSkillTemplateReferenceGUI.

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

217 {
219 $ilCtrl = $this->ctrl;
220
221 $this->form = new ilPropertyFormGUI();
222
223 // title
224 $ti = new ilTextInputGUI($lng->txt("title"), "title");
225 $ti->setMaxLength(200);
226 $ti->setSize(50);
227 $ti->setRequired(true);
228 $this->form->addItem($ti);
229
230 // description
231 $ta = new ilTextAreaInputGUI($lng->txt("description"), "description");
232 $ta->setRows(5);
233 $this->form->addItem($ta);
234
235 // status
236 $this->addStatusInput($this->form);
237
238 // selectable
239 $cb = new ilCheckboxInputGUI($lng->txt("skmg_selectable"), "self_eval");
240 $cb->setInfo($lng->txt("skmg_selectable_info"));
241 $this->form->addItem($cb);
242
243 // save and cancel commands
244 if ($this->checkPermissionBool("write")) {
245 if ($a_mode == "create") {
246 $this->form->addCommandButton("save", $lng->txt("save"));
247 $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
248 $this->form->setTitle($lng->txt("skmg_create_skll"));
249 } else {
250 $this->form->addCommandButton("update", $lng->txt("save"));
251 $this->form->setTitle($lng->txt("skmg_edit_skll"));
252 }
253 }
254
255 $ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
256 $this->form->setFormAction($ilCtrl->getFormAction($this));
257 }
This class represents a checkbox property in a property form.
addStatusInput(ilPropertyFormGUI $a_form)
Add status input.
This class represents a text area property in a property form.
This class represents a text property in a property form.

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

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

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

References $ctrl, $lng, $tabs, ilSkillTreeNodeGUI\checkPermissionBool(), and setLevelHead().

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

+ 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)

Reimplemented from ilSkillTreeNodeGUI.

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

728 {
729 $ilCtrl = $this->ctrl;
730
731 $t = ilSkillTreeNode::_lookupType((int) $_GET["obj_id"]);
732
733 switch ($t) {
734 case "skrt":
735 $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id", (int) $_GET["obj_id"]);
736 $ilCtrl->redirectByClass("ilskillrootgui", "listSkills");
737 break;
738 }
739
740 parent::redirectToParent();
741 }
static _lookupType($a_obj_id)
Lookup Type.

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

+ Here is the call graph for this function:

◆ removeLevelResources()

ilBasicSkillGUI::removeLevelResources ( )

Remove level resource.

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

869 {
870 $ilCtrl = $this->ctrl;
872
873 if (!$this->checkPermissionBool("write")) {
874 return;
875 }
876
877 if (is_array($_POST["id"])) {
878 $sres = new ilSkillResources($this->base_skill_id, $this->tref_id);
879 foreach ($_POST["id"] as $i) {
880 $sres->setResourceAsImparting((int) $_GET["level_id"], $i, false);
881 $sres->setResourceAsTrigger((int) $_GET["level_id"], $i, false);
882 }
883 $sres->save();
884 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
885 }
886
887 $ilCtrl->redirect($this, "showLevelResources");
888 }
Manages resources for skills.

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

+ Here is the call graph for this function:

◆ removeLevelTrigger()

ilBasicSkillGUI::removeLevelTrigger ( )

Remove trigger.

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

717 {
718 $ilCtrl = $this->ctrl;
719
720 ilBasicSkill::writeLevelTrigger((int) $_GET["level_id"], 0);
721 $ilCtrl->redirect($this, "editLevelTrigger");
722 }

References $_GET, and $ctrl.

◆ saveItem()

ilBasicSkillGUI::saveItem ( )

Save item.

Reimplemented in ilBasicSkillTemplateGUI, and ilSkillTemplateReferenceGUI.

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

135 {
136 if (!$this->checkPermissionBool("write")) {
137 return;
138 }
139
140 $tree = new ilSkillTree();
141
142 $it = new ilBasicSkill();
143 $it->setTitle($this->form->getInput("title"));
144 $it->setDescription($this->form->getInput("description"));
145 $it->setOrderNr($tree->getMaxOrderNr((int) $_GET["obj_id"]) + 10);
146 $it->setStatus($this->form->getInput("status"));
147 $it->setSelfEvaluation($_POST["self_eval"]);
148 $it->create();
149 ilSkillTreeNode::putInTree($it, (int) $_GET["obj_id"], IL_LAST_NODE);
150 $this->node_object = $it;
151 }
const IL_LAST_NODE
Definition: class.ilTree.php:4
static putInTree($a_obj, $a_parent_id="", $a_target_node_id="")
Put this object into the skill tree.

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

+ Here is the call graph for this function:

◆ saveLevel()

ilBasicSkillGUI::saveLevel ( )

Save level form.

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

307 {
310 $ilCtrl = $this->ctrl;
311
312 if (!$this->checkPermissionBool("write")) {
313 return;
314 }
315
316 $this->initLevelForm("create");
317 if ($this->form->checkInput()) {
318 // perform save
319 $this->node_object->addLevel(
320 $this->form->getInput("title"),
321 $this->form->getInput("description")
322 );
323
324 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
325 $ilCtrl->redirect($this, "edit");
326 }
327
328 $this->form->setValuesByPost();
329 $tpl->setContent($this->form->getHtml());
330 }

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

+ Here is the call graph for this function:

◆ saveLevelResource()

ilBasicSkillGUI::saveLevelResource ( )

Save level resource.

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

808 {
809 $ilCtrl = $this->ctrl;
811
812 $ref_id = (int) $_GET["root_id"];
813
814 if (!$this->checkPermissionBool("write")) {
815 return;
816 }
817
818 if ($ref_id > 0) {
819 $sres = new ilSkillResources($this->base_skill_id, $this->tref_id);
820 $sres->setResourceAsImparting((int) $_GET["level_id"], $ref_id);
821 $sres->save();
822
823 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
824 }
825
826 $ilCtrl->redirect($this, "showLevelResources");
827 }

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

+ Here is the call graph for this function:

◆ saveLevelTrigger()

ilBasicSkillGUI::saveLevelTrigger ( )

Save level trigger.

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

702 {
703 $ilCtrl = $this->ctrl;
704
705 if (!$this->checkPermissionBool("write")) {
706 return;
707 }
708
709 ilBasicSkill::writeLevelTrigger((int) $_GET["level_id"], (int) $_GET["root_id"]);
710 $ilCtrl->redirect($this, "editLevelTrigger");
711 }

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

+ Here is the call graph for this function:

◆ saveResourceSettings()

ilBasicSkillGUI::saveResourceSettings ( )

Save resource settings.

Parameters

return

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

897 {
898 $ilCtrl = $this->ctrl;
899
900 $resources = new ilSkillResources($this->base_skill_id, $this->tref_id);
901
902 foreach ($resources->getResourcesOfLevel((int) $_GET["level_id"]) as $r) {
903 $imparting = false;
904 if (is_array($_POST["suggested"]) && isset($_POST["suggested"][$r["rep_ref_id"]]) && $_POST["suggested"][$r["rep_ref_id"]]) {
905 $imparting = true;
906 }
907 $trigger = false;
908 if (is_array($_POST["trigger"]) && isset($_POST["trigger"][$r["rep_ref_id"]]) && $_POST["trigger"][$r["rep_ref_id"]]) {
909 $trigger = true;
910 }
911 $resources->setResourceAsImparting((int) $_GET["level_id"], $r["rep_ref_id"], $imparting);
912 $resources->setResourceAsTrigger((int) $_GET["level_id"], $r["rep_ref_id"], $trigger);
913 }
914 $resources->save();
915
916 $ilCtrl->redirect($this, "showLevelResources");
917 }

References $_GET, $_POST, and $ctrl.

◆ selectLevelTrigger()

ilBasicSkillGUI::selectLevelTrigger ( )

Select skill level trigger.

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

670 {
671 $ilCtrl = $this->ctrl;
672 $ilTabs = $this->tabs;
676
677 if (!$this->checkPermissionBool("write")) {
678 return;
679 }
680
681 $this->setLevelHead();
682 $ilTabs->activateTab("level_trigger");
683
684 $exp = new ilSearchRootSelector(
685 $ilCtrl->getLinkTarget($this, 'showRepositorySelection')
686 );
687 $exp->setExpand($_GET["search_root_expand"] ? $_GET["search_root_expand"] : $tree->readRootId());
688 $exp->setExpandTarget($ilCtrl->getLinkTarget($this, 'selectLevelTrigger'));
689 $exp->setTargetClass(get_class($this));
690 $exp->setCmd('saveLevelTrigger');
691 $exp->setClickableTypes(array("crs"));
692
693 // build html-output
694 $exp->setOutput(0);
695 $tpl->setContent($exp->getOutput());
696 }

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

+ Here is the call graph for this function:

◆ setLevelHead()

ilBasicSkillGUI::setLevelHead ( )

Set header for level.

Reimplemented in ilBasicSkillTemplateGUI.

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

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

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

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

+ 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

Reimplemented in ilBasicSkillTemplateGUI, and ilSkillTemplateReferenceGUI.

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

563 {
564 $ilTabs = $this->tabs;
565 $ilCtrl = $this->ctrl;
568 $ilHelp = $this->help;
569
570 $ilTabs->clearTargets();
571 $ilHelp->setScreenIdComponent("skmg_skll");
572 // $ilTabs->setBackTarget($lng->txt("skmg_skill_hierarchie"),
573 // $ilCtrl->getLinkTargetByClass("ilobjskillmanagementgui", "editSkills"));
574
575 if (is_object($this->node_object)) {
576
577 // levels
578 $ilTabs->addTab(
579 "levels",
580 $lng->txt("skmg_skill_levels"),
581 $ilCtrl->getLinkTarget($this, 'edit')
582 );
583
584 // properties
585 $ilTabs->addTab(
586 "properties",
587 $lng->txt("settings"),
588 $ilCtrl->getLinkTarget($this, 'editProperties')
589 );
590
591 // usage
592 $this->addUsageTab($ilTabs);
593
594 // assigned objects
595 $this->addObjectsTab($ilTabs);
596
597 $ilCtrl->setParameterByClass(
598 "ilskillrootgui",
599 "obj_id",
600 $this->node_object->skill_tree->getRootId()
601 );
602 $ilTabs->setBackTarget(
603 $lng->txt("obj_skmg"),
604 $ilCtrl->getLinkTargetByClass("ilskillrootgui", "listSkills")
605 );
606 $ilCtrl->setParameterByClass(
607 "ilskillrootgui",
608 "obj_id",
609 $_GET["obj_id"]
610 );
611
612 $ilTabs->activateTab($a_tab);
613
614 $tpl->setTitle($lng->txt("skmg_skill") . ": " .
615 $this->node_object->getTitle());
616
618 } else {
619 $tpl->setTitle($lng->txt("skmg_skill"));
620 $tpl->setDescription("");
621 }
622 parent::setTitleIcon();
623 }
setSkillNodeDescription()
Set skill node description.
addUsageTab($a_tabs)
Add usage tab.

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

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

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

752 {
754 $ilTabs = $this->tabs;
755 $ilToolbar = $this->toolbar;
757 $ilCtrl = $this->ctrl;
758
759 if ($this->checkPermissionBool("write")) {
760 $ilToolbar->addButton(
761 $lng->txt("skmg_add_resource"),
762 $ilCtrl->getLinkTarget($this, "addLevelResource")
763 );
764 }
765
766 $this->setLevelHead();
767 $ilTabs->activateTab("level_resources");
768
770 $this,
771 "showLevelResources",
772 $this->base_skill_id,
773 $this->tref_id,
774 (int) $_GET["level_id"],
775 $this->checkPermissionBool("write")
776 );
777
778 $tpl->setContent($tab->getHTML());
779 }
TableGUI class for skill level resources.

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

+ Here is the call graph for this function:

◆ showProperties()

ilBasicSkillGUI::showProperties ( )

Show properties.

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

122 {
124
125 $this->setTabs();
126 $this->setLocator();
127
128 $tpl->setContent("Properties");
129 }
setLocator()
Set Locator Items.

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

+ Here is the call graph for this function:

◆ updateItem()

ilBasicSkillGUI::updateItem ( )

Update item.

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

172 {
173 if (!$this->checkPermissionBool("write")) {
174 return;
175 }
176
177 $this->node_object->setTitle($this->form->getInput("title"));
178 $this->node_object->setDescription($this->form->getInput("description"));
179 $this->node_object->setSelfEvaluation($_POST["self_eval"]);
180 $this->node_object->setStatus($_POST["status"]);
181 $this->node_object->update();
182 }

References $_POST, and ilSkillTreeNodeGUI\checkPermissionBool().

+ Here is the call graph for this function:

◆ updateLevel()

ilBasicSkillGUI::updateLevel ( )

Update level form.

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

336 {
338 $ilCtrl = $this->ctrl;
340
341 if (!$this->checkPermissionBool("write")) {
342 return;
343 }
344
345 $this->initLevelForm("edit");
346 if ($this->form->checkInput()) {
347 $this->node_object->writeLevelTitle(
348 (int) $_GET["level_id"],
349 $this->form->getInput("title")
350 );
351 $this->node_object->writeLevelDescription(
352 (int) $_GET["level_id"],
353 $this->form->getInput("description")
354 );
355
356 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
357 $ilCtrl->redirect($this, "edit");
358 }
359
360 $this->form->setValuesByPost();
361 $tpl->setContent($this->form->getHtml());
362 }

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

+ Here is the call graph for this function:

◆ updateLevelOrder()

ilBasicSkillGUI::updateLevelOrder ( )

Update level order.

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

426 {
428 $ilCtrl = $this->ctrl;
429
430 if (!$this->checkPermissionBool("write")) {
431 return;
432 }
433
434 $order = ilUtil::stripSlashesArray($_POST["order"]);
435 $this->node_object->updateLevelOrder($order);
436 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
437 $ilCtrl->redirect($this, "edit");
438 }
static stripSlashesArray($a_arr, $a_strip_html=true, $a_allow="")
Strip slashes from array.

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

+ Here is the call graph for this function:

Field Documentation

◆ $base_skill_id

ilBasicSkillGUI::$base_skill_id
protected

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

◆ $ctrl

◆ $help

ilBasicSkillGUI::$help
protected

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

Referenced by setLevelHead(), and setTabs().

◆ $lng

◆ $tabs

◆ $toolbar

ilBasicSkillGUI::$toolbar
protected

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

Referenced by edit(), and showLevelResources().

◆ $tpl

◆ $tree

◆ $tref_id

ilBasicSkillGUI::$tref_id = 0
protected

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


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