ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 }
global $ilCtrl
Definition: ilias.php:18
global $DIC
Definition: saml.php:7

References $DIC, and $ilCtrl.

Member Function Documentation

◆ addCreationButtons()

static ilSkillCategoryGUI::addCreationButtons ( )
static

Add creation buttons.

Parameters

return

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

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

426 {
428
429 $ilCtrl->redirectByClass("ilobjskillmanagementgui", "editSkills");
430 }

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

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

References $values.

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

305 {
308
309 if ($this->isInUse()) {
310 ilUtil::sendInfo($lng->txt("skmg_skill_in_use"));
311 }
312
313 if ($this->checkPermissionBool("write")) {
315 }
316 $this->setTabs("content");
317
318 include_once("./Services/Skill/classes/class.ilSkillCatTableGUI.php");
320 $this,
321 "listItems",
322 (int) $_GET["obj_id"],
324 );
325
326 $tpl->setContent($table->getHTML());
327 }
static addCreationButtons()
Add creation buttons.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if(empty($password)) $table
Definition: pwgen.php:24

References $_GET, $lng, $table, $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 438 of file class.ilSkillCategoryGUI.php.

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

References $_GET, $ctrl, $ilCtrl, $t, 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 include_once "Services/Skill/classes/class.ilSkillCategory.php";
237
238 $tree = new ilSkillTree();
239
240 $it = new ilSkillCategory();
241 $it->setTitle($this->form->getInput("title"));
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, $tree, 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 264 of file class.ilSkillCategoryGUI.php.

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

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: