ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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$

ilSkillCategoryGUI: ilObjSkillManagementGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilSkillCategoryGUI::__construct (   $a_node_id = 0)

Constructor.

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

References $DIC, and $ilCtrl.

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 $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18

Member Function Documentation

◆ addCreationButtons()

static ilSkillCategoryGUI::addCreationButtons ( )
static

Add creation buttons.

Parameters

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

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

Referenced by ilSkillRootGUI\listSkills().

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

◆ cancel()

ilSkillCategoryGUI::cancel ( )

Cancel.

Parameters

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

References $ctrl, and $ilCtrl.

439  {
441 
442  $ilCtrl->redirectByClass("ilobjskillmanagementgui", "editSkills");
443  }
global $ilCtrl
Definition: ilias.php:18

◆ edit()

ilSkillCategoryGUI::edit ( )

Edit.

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

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

176  {
177  $tpl = $this->tpl;
178 
179  $this->initForm();
180  $this->getValues();
181  $tpl->setContent($this->form->getHTML());
182  }
getValues()
Get current values for from.
initForm($a_mode="edit")
Init form.
+ Here is the call graph for this function:

◆ editProperties()

ilSkillCategoryGUI::editProperties ( )

Edit properties.

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

References $tpl, and setTabs().

153  {
154  $tpl = $this->tpl;
155 
156  $this->setTabs("properties");
157  parent::editProperties();
158  }
setTabs($a_tab)
output tabs
+ Here is the call graph for this function:

◆ executeCommand()

ilSkillCategoryGUI::executeCommand ( )

Execute command.

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

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

75  {
77  $tpl = $this->tpl;
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  }
global $ilCtrl
Definition: ilias.php:18
$ret
Definition: parser.php:6

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

References array.

Referenced by edit().

264  {
265  $values = array();
266  $values["title"] = $this->node_object->getTitle();
267  $values["order_nr"] = $this->node_object->getOrderNr();
268  $values["self_eval"] = $this->node_object->getSelfEvaluation();
269  $values["status"] = $this->node_object->getStatus();
270  $this->form->setValuesByArray($values);
271  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ initForm()

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

Init form.

Parameters
int$a_modeEdit Mode

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

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

Referenced by edit().

190  {
191  $lng = $this->lng;
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  // order nr
205  $ni = new ilNumberInputGUI($lng->txt("skmg_order_nr"), "order_nr");
206  $ni->setInfo($lng->txt("skmg_order_nr_info"));
207  $ni->setMaxLength(6);
208  $ni->setSize(6);
209  $ni->setRequired(true);
210  if ($a_mode == "create") {
211  include_once("./Services/Skill/classes/class.ilSkillTree.php");
212  $tree = new ilSkillTree();
213  $max = $tree->getMaxOrderNr((int) $_GET["obj_id"]);
214  $ni->setValue($max + 10);
215  }
216  $this->form->addItem($ni);
217 
218  // status
219  $this->addStatusInput($this->form);
220 
221  // selectable
222  $cb = new ilCheckboxInputGUI($lng->txt("skmg_selectable"), "self_eval");
223  $cb->setInfo($lng->txt("skmg_selectable_info"));
224  $this->form->addItem($cb);
225 
226  // save and cancel commands
227  if ($this->checkPermissionBool("write")) {
228  if ($a_mode == "create") {
229  $this->form->addCommandButton("save", $lng->txt("save"));
230  $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
231  $this->form->setTitle($lng->txt("skmg_create_skill_category"));
232  } else {
233  $this->form->addCommandButton("update", $lng->txt("save"));
234  $this->form->setTitle($lng->txt("skmg_edit_scat"));
235  }
236  }
237 
238  $ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
239  $this->form->setFormAction($ilCtrl->getFormAction($this));
240  }
This class represents a property form user interface.
Skill tree.
$_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 number property in a property form.
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:
+ Here is the caller graph for this function:

◆ listItems()

ilSkillCategoryGUI::listItems ( )

Update form.

List items

Parameters

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

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

318  {
319  $tpl = $this->tpl;
320  $lng = $this->lng;
321 
322  if ($this->isInUse()) {
323  ilUtil::sendInfo($lng->txt("skmg_skill_in_use"));
324  }
325 
326  if ($this->checkPermissionBool("write")) {
327  self::addCreationButtons();
328  }
329  $this->setTabs("content");
330 
331  include_once("./Services/Skill/classes/class.ilSkillCatTableGUI.php");
333  $this,
334  "listItems",
335  (int) $_GET["obj_id"],
337  );
338 
339  $tpl->setContent($table->getHTML());
340  }
$_GET["client_id"]
checkPermissionBool($a_perm)
Check permission pool.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
setTabs($a_tab)
output tabs
if(empty($password)) $table
Definition: pwgen.php:24
+ 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.

References $ctrl, and $ilCtrl.

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  }
global $ilCtrl
Definition: ilias.php:18

◆ redirectToParent()

ilSkillCategoryGUI::redirectToParent (   $a_tmp_mode = false)

Redirect to parent (identified by current obj_id)

Parameters

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

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

452  {
454 
455  $t = ilSkillTreeNode::_lookupType((int) $_GET["obj_id"]);
456 
457  switch ($t) {
458  case "skrt":
459  $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id", (int) $_GET["obj_id"]);
460  $ilCtrl->redirectByClass("ilskillrootgui", "listSkills");
461  break;
462  }
463 
464  parent::redirectToParent();
465  }
$_GET["client_id"]
static _lookupType($a_obj_id)
Lookup Type.
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ saveItem()

ilSkillCategoryGUI::saveItem ( )

Save item.

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

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

246  {
247  if (!$this->checkPermissionBool("write")) {
248  return;
249  }
250  include_once "Services/Skill/classes/class.ilSkillCategory.php";
251  $it = new ilSkillCategory();
252  $it->setTitle($this->form->getInput("title"));
253  $it->setOrderNr($this->form->getInput("order_nr"));
254  $it->setSelfEvaluation($_POST["self_eval"]);
255  $it->setStatus($_POST["status"]);
256  $it->create();
257  ilSkillTreeNode::putInTree($it, (int) $_GET["obj_id"], IL_LAST_NODE);
258  }
$_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
$_POST["username"]
+ Here is the call graph for this function:

◆ setTabs()

ilSkillCategoryGUI::setTabs (   $a_tab)

output tabs

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

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

Referenced by editProperties(), and listItems().

96  {
97  $ilTabs = $this->tabs;
99  $tpl = $this->tpl;
100  $lng = $this->lng;
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  );
144  $this->setSkillNodeDescription();
145 
146  $ilTabs->activateTab($a_tab);
147  }
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:

◆ updateItem()

ilSkillCategoryGUI::updateItem ( )

Update item.

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

References $_POST, and ilSkillTreeNodeGUI\checkPermissionBool().

277  {
278  if (!$this->checkPermissionBool("write")) {
279  return;
280  }
281 
282  $this->node_object->setTitle($this->form->getInput("title"));
283  $this->node_object->setOrderNr($this->form->getInput("order_nr"));
284  $this->node_object->setSelfEvaluation($_POST["self_eval"]);
285  $this->node_object->setStatus($_POST["status"]);
286  $this->node_object->update();
287  }
checkPermissionBool($a_perm)
Check permission pool.
$_POST["username"]
+ 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: