ILIAS  release_7 Revision v7.30-3-g800a261c036
ilSkillCategoryGUI Class Reference

Skill category GUI class. More...

+ Inheritance diagram for ilSkillCategoryGUI:
+ Collaboration diagram for ilSkillCategoryGUI:

Public Member Functions

 __construct ($a_node_id=0)
 Constructor. More...
 
 getType ()
 Get Node Type. More...
 
 executeCommand ()
 Execute command. More...
 
 setTabs ($a_tab)
 output tabs More...
 
 editProperties ()
 Edit properties. More...
 
 proceedDragDrop ()
 Perform drag and drop action. More...
 
 edit ()
 Edit. More...
 
 initForm ($a_mode="edit")
 Init form. More...
 
 saveItem ()
 Save item. More...
 
 getValues ()
 Get current values for from. More...
 
 updateItem ()
 Update item. More...
 
 listItems ()
 Update form. More...
 
 cancel ()
 Cancel. More...
 
 redirectToParent ($a_tmp_mode=false)
 Redirect to parent (identified by current obj_id) 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...
 

Static Public Member Functions

static addCreationButtons ()
 Add creation buttons. More...
 

Protected Attributes

 $ctrl
 
 $tpl
 
 $tabs
 
 $lng
 
 $help
 
- 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

Skill category GUI class.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e

@ilCtrl_isCalledBy ilSkillCategoryGUI: ilObjSkillManagementGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilSkillCategoryGUI::__construct (   $a_node_id = 0)

Constructor.

Reimplemented from ilSkillTreeNodeGUI.

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

44 {
45 global $DIC;
46
47 $this->ctrl = $DIC->ctrl();
48 $this->tpl = $DIC["tpl"];
49 $this->tabs = $DIC->tabs();
50 $this->lng = $DIC->language();
51 $this->help = $DIC["ilHelp"];
52 $ilCtrl = $DIC->ctrl();
53
54 $ilCtrl->saveParameter($this, "obj_id");
55
56 parent::__construct($a_node_id);
57 }
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

◆ addCreationButtons()

static ilSkillCategoryGUI::addCreationButtons ( )
static

Add creation buttons.

Parameters

return

Definition at line 336 of file class.ilSkillCategoryGUI.php.

337 {
338 global $DIC;
339
340 $ilCtrl = $DIC->ctrl();
341 $lng = $DIC->language();
342 $ilToolbar = $DIC->toolbar();
343 $ilUser = $DIC->user();
344
345 // skill
346 $ilCtrl->setParameterByClass(
347 "ilbasicskillgui",
348 "obj_id",
349 (int) $_GET["obj_id"]
350 );
351 $ilToolbar->addButton(
352 $lng->txt("skmg_create_skll"),
353 $ilCtrl->getLinkTargetByClass("ilbasicskillgui", "create")
354 );
355
356 // skill category
357 $ilCtrl->setParameterByClass(
358 "ilskillcategorygui",
359 "obj_id",
360 (int) $_GET["obj_id"]
361 );
362 $ilToolbar->addButton(
363 $lng->txt("skmg_create_skill_category"),
364 $ilCtrl->getLinkTargetByClass("ilskillcategorygui", "create")
365 );
366
367 // skill template reference
368 $ilCtrl->setParameterByClass(
369 "ilskilltemplatereferencegui",
370 "obj_id",
371 (int) $_GET["obj_id"]
372 );
373 $ilToolbar->addButton(
374 $lng->txt("skmg_create_skill_template_reference"),
375 $ilCtrl->getLinkTargetByClass("ilskilltemplatereferencegui", "create")
376 );
377
378 // skills from clipboard
379 $sep = false;
380 if ($ilUser->clipboardHasObjectsOfType("skll")) {
381 $ilToolbar->addSeparator();
382 $sep = true;
383 $ilToolbar->addButton(
384 $lng->txt("skmg_insert_basic_skill_from_clip"),
385 $ilCtrl->getLinkTargetByClass("ilskillcategorygui", "insertBasicSkillClip")
386 );
387 }
388
389 // skills from clipboard
390 if ($ilUser->clipboardHasObjectsOfType("scat")) {
391 if (!$sep) {
392 $ilToolbar->addSeparator();
393 $sep = true;
394 }
395 $ilToolbar->addButton(
396 $lng->txt("skmg_insert_skill_category_from_clip"),
397 $ilCtrl->getLinkTargetByClass("ilskillcategorygui", "insertSkillCategoryClip")
398 );
399 }
400
401 // skills from clipboard
402 if ($ilUser->clipboardHasObjectsOfType("sktr")) {
403 if (!$sep) {
404 $ilToolbar->addSeparator();
405 $sep = true;
406 }
407 $ilToolbar->addButton(
408 $lng->txt("skmg_insert_skill_template_reference_from_clip"),
409 $ilCtrl->getLinkTargetByClass("ilskillcategorygui", "insertTemplateReferenceClip")
410 );
411 }
412
413 // skill template reference
414 $ilToolbar->addButton(
415 $lng->txt("skmg_import_skills"),
416 $ilCtrl->getLinkTargetByClass("ilskillrootgui", "showImportForm")
417 );
418 }
$_GET["client_id"]
$ilUser
Definition: imgupload.php:18

References $_GET, $DIC, $ilUser, and $lng.

Referenced by listItems(), and ilSkillRootGUI\listSkills().

+ Here is the caller graph for this function:

◆ cancel()

ilSkillCategoryGUI::cancel ( )

Cancel.

Parameters

return

Definition at line 426 of file class.ilSkillCategoryGUI.php.

427 {
428 $ilCtrl = $this->ctrl;
429
430 $ilCtrl->redirectByClass("ilobjskillmanagementgui", "editSkills");
431 }

References $ctrl.

◆ edit()

ilSkillCategoryGUI::edit ( )

Edit.

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

172 {
174
175 $this->initForm();
176 $this->getValues();
177 $tpl->setContent($this->form->getHTML());
178 }
initForm($a_mode="edit")
Init form.
getValues()
Get current values for from.

References $tpl, getValues(), and initForm().

+ Here is the call graph for this function:

◆ editProperties()

ilSkillCategoryGUI::editProperties ( )

Edit properties.

Reimplemented from ilSkillTreeNodeGUI.

Definition at line 148 of file class.ilSkillCategoryGUI.php.

149 {
151
152 $this->setTabs("properties");
153 parent::editProperties();
154 }
setTabs($a_tab)
output tabs

References $tpl, and setTabs().

+ Here is the call graph for this function:

◆ executeCommand()

ilSkillCategoryGUI::executeCommand ( )

Execute command.

Definition at line 70 of file class.ilSkillCategoryGUI.php.

71 {
72 $ilCtrl = $this->ctrl;
74 $ilTabs = $this->tabs;
75
76 //$tpl->getStandardTemplate();
77
78 $next_class = $ilCtrl->getNextClass($this);
79 $cmd = $ilCtrl->getCmd();
80
81 switch ($next_class) {
82 default:
83 $ret = $this->$cmd();
84 break;
85 }
86 }
$ret
Definition: parser.php:6

References $ctrl, $ret, $tabs, and $tpl.

◆ getType()

ilSkillCategoryGUI::getType ( )

Get Node Type.

Definition at line 62 of file class.ilSkillCategoryGUI.php.

63 {
64 return "scat";
65 }

◆ getValues()

ilSkillCategoryGUI::getValues ( )

Get current values for from.

Definition at line 252 of file class.ilSkillCategoryGUI.php.

253 {
254 $values = array();
255 $values["title"] = $this->node_object->getTitle();
256 $values["description"] = $this->node_object->getDescription();
257 $values["self_eval"] = $this->node_object->getSelfEvaluation();
258 $values["status"] = $this->node_object->getStatus();
259 $this->form->setValuesByArray($values);
260 }

Referenced by edit().

+ Here is the caller graph for this function:

◆ initForm()

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

Init form.

Parameters
int$a_modeEdit Mode

Reimplemented from ilSkillTreeNodeGUI.

Definition at line 185 of file class.ilSkillCategoryGUI.php.

186 {
188 $ilCtrl = $this->ctrl;
189
190 $this->form = new ilPropertyFormGUI();
191
192 // title
193 $ti = new ilTextInputGUI($lng->txt("title"), "title");
194 $ti->setMaxLength(200);
195 $ti->setSize(50);
196 $ti->setRequired(true);
197 $this->form->addItem($ti);
198
199 // description
200 $ta = new ilTextAreaInputGUI($lng->txt("description"), "description");
201 $ta->setRows(5);
202 $this->form->addItem($ta);
203
204 // status
205 $this->addStatusInput($this->form);
206
207 // selectable
208 $cb = new ilCheckboxInputGUI($lng->txt("skmg_selectable"), "self_eval");
209 $cb->setInfo($lng->txt("skmg_selectable_info"));
210 $this->form->addItem($cb);
211
212 // save and cancel commands
213 if ($this->checkPermissionBool("write")) {
214 if ($a_mode == "create") {
215 $this->form->addCommandButton("save", $lng->txt("save"));
216 $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
217 $this->form->setTitle($lng->txt("skmg_create_skill_category"));
218 } else {
219 $this->form->addCommandButton("update", $lng->txt("save"));
220 $this->form->setTitle($lng->txt("skmg_edit_scat"));
221 }
222 }
223
224 $ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
225 $this->form->setFormAction($ilCtrl->getFormAction($this));
226 }
This class represents a checkbox property in a property form.
This class represents a property form user interface.
addStatusInput(ilPropertyFormGUI $a_form)
Add status input.
checkPermissionBool($a_perm)
Check permission pool.
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().

Referenced by edit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listItems()

ilSkillCategoryGUI::listItems ( )

Update form.

List items

Parameters

return

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

307 {
310
311 if ($this->isInUse()) {
312 ilUtil::sendInfo($lng->txt("skmg_skill_in_use"));
313 }
314
315 if ($this->checkPermissionBool("write")) {
317 }
318 $this->setTabs("content");
319
320 $table = new ilSkillCatTableGUI(
321 $this,
322 "listItems",
323 (int) $_GET["obj_id"],
325 );
326
327 $tpl->setContent($table->getHTML());
328 }
static addCreationButtons()
Add creation buttons.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References $_GET, $lng, $tpl, addCreationButtons(), ilSkillTreeNodeGUI\checkPermissionBool(), ilSkillTreeNodeGUI\isInUse(), ilSkillCatTableGUI\MODE_SCAT, ilUtil\sendInfo(), and setTabs().

+ Here is the call graph for this function:

◆ proceedDragDrop()

ilSkillCategoryGUI::proceedDragDrop ( )

Perform drag and drop action.

Definition at line 159 of file class.ilSkillCategoryGUI.php.

160 {
161 $ilCtrl = $this->ctrl;
162
163 // $this->slm_object->executeDragDrop($_POST["il_hform_source_id"], $_POST["il_hform_target_id"],
164// $_POST["il_hform_fc"], $_POST["il_hform_as_subitem"]);
165// $ilCtrl->redirect($this, "showOrganization");
166 }

References $ctrl.

◆ redirectToParent()

ilSkillCategoryGUI::redirectToParent (   $a_tmp_mode = false)

Redirect to parent (identified by current obj_id)

Parameters

return

Reimplemented from ilSkillTreeNodeGUI.

Definition at line 439 of file class.ilSkillCategoryGUI.php.

440 {
441 $ilCtrl = $this->ctrl;
442
443 $t = ilSkillTreeNode::_lookupType((int) $_GET["obj_id"]);
444
445 switch ($t) {
446 case "skrt":
447 $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id", (int) $_GET["obj_id"]);
448 $ilCtrl->redirectByClass("ilskillrootgui", "listSkills");
449 break;
450 }
451
452 parent::redirectToParent();
453 }
static _lookupType($a_obj_id)
Lookup Type.

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

+ Here is the call graph for this function:

◆ saveItem()

ilSkillCategoryGUI::saveItem ( )

Save item.

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

232 {
233 if (!$this->checkPermissionBool("write")) {
234 return;
235 }
236
237 $tree = new ilSkillTree();
238
239 $it = new ilSkillCategory();
240 $it->setTitle($this->form->getInput("title"));
241 $it->setDescription($this->form->getDescription("description"));
242 $it->setOrderNr($tree->getMaxOrderNr((int) $_GET["obj_id"]) + 10);
243 $it->setSelfEvaluation($_POST["self_eval"]);
244 $it->setStatus($_POST["status"]);
245 $it->create();
246 ilSkillTreeNode::putInTree($it, (int) $_GET["obj_id"], IL_LAST_NODE);
247 }
$_POST["username"]
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, ilSkillTreeNodeGUI\checkPermissionBool(), IL_LAST_NODE, and ilSkillTreeNode\putInTree().

+ Here is the call graph for this function:

◆ setTabs()

ilSkillCategoryGUI::setTabs (   $a_tab)

output tabs

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

92 {
93 $ilTabs = $this->tabs;
94 $ilCtrl = $this->ctrl;
97 $ilHelp = $this->help;
98
99 $ilTabs->clearTargets();
100 $ilHelp->setScreenIdComponent("skmg_scat");
101
102 // content
103 $ilTabs->addTab(
104 "content",
105 $lng->txt("content"),
106 $ilCtrl->getLinkTarget($this, 'listItems')
107 );
108
109 // properties
110 $ilTabs->addTab(
111 "properties",
112 $lng->txt("settings"),
113 $ilCtrl->getLinkTarget($this, 'editProperties')
114 );
115
116 // usage
117 $this->addUsageTab($ilTabs);
118
119 // back link
120 $ilCtrl->setParameterByClass(
121 "ilskillrootgui",
122 "obj_id",
123 $this->node_object->skill_tree->getRootId()
124 );
125 $ilTabs->setBackTarget(
126 $lng->txt("obj_skmg"),
127 $ilCtrl->getLinkTargetByClass("ilskillrootgui", "listSkills")
128 );
129 $ilCtrl->setParameterByClass(
130 "ilskillrootgui",
131 "obj_id",
132 $_GET["obj_id"]
133 );
134
135
136 parent::setTitleIcon();
137 $tpl->setTitle(
138 $lng->txt("scat") . ": " . $this->node_object->getTitle()
139 );
141
142 $ilTabs->activateTab($a_tab);
143 }
setSkillNodeDescription()
Set skill node description.
addUsageTab($a_tabs)
Add usage tab.

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

Referenced by editProperties(), and listItems().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateItem()

ilSkillCategoryGUI::updateItem ( )

Update item.

Definition at line 265 of file class.ilSkillCategoryGUI.php.

266 {
267 if (!$this->checkPermissionBool("write")) {
268 return;
269 }
270
271 $this->node_object->setTitle($this->form->getInput("title"));
272 $this->node_object->setDescription($this->form->getInput("description"));
273 $this->node_object->setSelfEvaluation($_POST["self_eval"]);
274 $this->node_object->setStatus($_POST["status"]);
275 $this->node_object->update();
276 }

References $_POST, and ilSkillTreeNodeGUI\checkPermissionBool().

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilSkillCategoryGUI::$ctrl
protected

◆ $help

ilSkillCategoryGUI::$help
protected

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

Referenced by setTabs().

◆ $lng

ilSkillCategoryGUI::$lng
protected

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

Referenced by addCreationButtons(), initForm(), listItems(), and setTabs().

◆ $tabs

ilSkillCategoryGUI::$tabs
protected

Definition at line 27 of file class.ilSkillCategoryGUI.php.

Referenced by executeCommand(), and setTabs().

◆ $tpl

ilSkillCategoryGUI::$tpl
protected

Definition at line 22 of file class.ilSkillCategoryGUI.php.

Referenced by edit(), editProperties(), executeCommand(), listItems(), and setTabs().


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