ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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...
 
 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
Version
$Id$

@ilCtrl_isCalledBy ilSkillCategoryGUI: ilObjSkillManagementGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilSkillCategoryGUI::__construct (   $a_node_id = 0)

Constructor.

Reimplemented from ilSkillTreeNodeGUI.

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

48 {
49 global $DIC;
50
51 $this->ctrl = $DIC->ctrl();
52 $this->tpl = $DIC["tpl"];
53 $this->tabs = $DIC->tabs();
54 $this->lng = $DIC->language();
55 $this->help = $DIC["ilHelp"];
56 $ilCtrl = $DIC->ctrl();
57
58 $ilCtrl->saveParameter($this, "obj_id");
59
60 parent::__construct($a_node_id);
61 }
help()
Definition: help.php:2
global $ilCtrl
Definition: ilias.php:18
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$DIC
Definition: xapitoken.php:46

References $DIC, $ilCtrl, 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 343 of file class.ilSkillCategoryGUI.php.

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

References $_GET, $DIC, $ilCtrl, $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 433 of file class.ilSkillCategoryGUI.php.

434 {
436
437 $ilCtrl->redirectByClass("ilobjskillmanagementgui", "editSkills");
438 }

References $ctrl, and $ilCtrl.

◆ edit()

ilSkillCategoryGUI::edit ( )

Edit.

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

176 {
178
179 $this->initForm();
180 $this->getValues();
181 $tpl->setContent($this->form->getHTML());
182 }
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 152 of file class.ilSkillCategoryGUI.php.

153 {
155
156 $this->setTabs("properties");
157 parent::editProperties();
158 }
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 74 of file class.ilSkillCategoryGUI.php.

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

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

◆ getType()

ilSkillCategoryGUI::getType ( )

Get Node Type.

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

67 {
68 return "scat";
69 }

◆ getValues()

ilSkillCategoryGUI::getValues ( )

Get current values for from.

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

259 {
260 $values = array();
261 $values["title"] = $this->node_object->getTitle();
262 $values["description"] = $this->node_object->getDescription();
263 $values["self_eval"] = $this->node_object->getSelfEvaluation();
264 $values["status"] = $this->node_object->getStatus();
265 $this->form->setValuesByArray($values);
266 }

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 189 of file class.ilSkillCategoryGUI.php.

190 {
193
194 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
195 $this->form = new ilPropertyFormGUI();
196
197 // title
198 $ti = new ilTextInputGUI($lng->txt("title"), "title");
199 $ti->setMaxLength(200);
200 $ti->setSize(50);
201 $ti->setRequired(true);
202 $this->form->addItem($ti);
203
204 // description
205 $ta = new ilTextAreaInputGUI($lng->txt("description"), "description");
206 $ta->setRows(5);
207 $this->form->addItem($ta);
208
209 // status
210 $this->addStatusInput($this->form);
211
212 // selectable
213 $cb = new ilCheckboxInputGUI($lng->txt("skmg_selectable"), "self_eval");
214 $cb->setInfo($lng->txt("skmg_selectable_info"));
215 $this->form->addItem($cb);
216
217 // save and cancel commands
218 if ($this->checkPermissionBool("write")) {
219 if ($a_mode == "create") {
220 $this->form->addCommandButton("save", $lng->txt("save"));
221 $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
222 $this->form->setTitle($lng->txt("skmg_create_skill_category"));
223 } else {
224 $this->form->addCommandButton("update", $lng->txt("save"));
225 $this->form->setTitle($lng->txt("skmg_edit_scat"));
226 }
227 }
228
229 $ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
230 $this->form->setFormAction($ilCtrl->getFormAction($this));
231 }
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, $ilCtrl, $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 312 of file class.ilSkillCategoryGUI.php.

313 {
316
317 if ($this->isInUse()) {
318 ilUtil::sendInfo($lng->txt("skmg_skill_in_use"));
319 }
320
321 if ($this->checkPermissionBool("write")) {
323 }
324 $this->setTabs("content");
325
326 include_once("./Services/Skill/classes/class.ilSkillCatTableGUI.php");
327 $table = new ilSkillCatTableGUI(
328 $this,
329 "listItems",
330 (int) $_GET["obj_id"],
332 );
333
334 $tpl->setContent($table->getHTML());
335 }
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 163 of file class.ilSkillCategoryGUI.php.

164 {
166
167 // $this->slm_object->executeDragDrop($_POST["il_hform_source_id"], $_POST["il_hform_target_id"],
168// $_POST["il_hform_fc"], $_POST["il_hform_as_subitem"]);
169// $ilCtrl->redirect($this, "showOrganization");
170 }

References $ctrl, and $ilCtrl.

◆ redirectToParent()

ilSkillCategoryGUI::redirectToParent (   $a_tmp_mode = false)

Redirect to parent (identified by current obj_id)

Parameters

return

Reimplemented from ilSkillTreeNodeGUI.

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

447 {
449
450 $t = ilSkillTreeNode::_lookupType((int) $_GET["obj_id"]);
451
452 switch ($t) {
453 case "skrt":
454 $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id", (int) $_GET["obj_id"]);
455 $ilCtrl->redirectByClass("ilskillrootgui", "listSkills");
456 break;
457 }
458
459 parent::redirectToParent();
460 }
static _lookupType($a_obj_id)
Lookup Type.

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

+ Here is the call graph for this function:

◆ saveItem()

ilSkillCategoryGUI::saveItem ( )

Save item.

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

237 {
238 if (!$this->checkPermissionBool("write")) {
239 return;
240 }
241 include_once "Services/Skill/classes/class.ilSkillCategory.php";
242
243 $tree = new ilSkillTree();
244
245 $it = new ilSkillCategory();
246 $it->setTitle($this->form->getInput("title"));
247 $it->setDescription($this->form->getDescription("description"));
248 $it->setOrderNr($tree->getMaxOrderNr((int) $_GET["obj_id"]) + 10);
249 $it->setSelfEvaluation($_POST["self_eval"]);
250 $it->setStatus($_POST["status"]);
251 $it->create();
252 ilSkillTreeNode::putInTree($it, (int) $_GET["obj_id"], IL_LAST_NODE);
253 }
$_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 95 of file class.ilSkillCategoryGUI.php.

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

References $_GET, $ctrl, $help, $ilCtrl, $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 271 of file class.ilSkillCategoryGUI.php.

272 {
273 if (!$this->checkPermissionBool("write")) {
274 return;
275 }
276
277 $this->node_object->setTitle($this->form->getInput("title"));
278 $this->node_object->setDescription($this->form->getInput("description"));
279 $this->node_object->setSelfEvaluation($_POST["self_eval"]);
280 $this->node_object->setStatus($_POST["status"]);
281 $this->node_object->update();
282 }

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 41 of file class.ilSkillCategoryGUI.php.

Referenced by setTabs().

◆ $lng

ilSkillCategoryGUI::$lng
protected

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

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

◆ $tabs

ilSkillCategoryGUI::$tabs
protected

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

Referenced by executeCommand(), and setTabs().

◆ $tpl

ilSkillCategoryGUI::$tpl
protected

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

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


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