ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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...
 

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

References $ilCtrl.

23  {
24  global $ilCtrl;
25 
26  $ilCtrl->saveParameter($this, "obj_id");
27 
28  parent::__construct($a_node_id);
29  }
global $ilCtrl
Definition: ilias.php:18

Member Function Documentation

◆ addCreationButtons()

static ilSkillCategoryGUI::addCreationButtons ( )
static

Add creation buttons.

Parameters

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

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

Referenced by ilSkillRootGUI\listSkills().

291  {
292  global $ilCtrl, $lng, $ilToolbar, $ilUser;
293 
294  // skill
295  $ilCtrl->setParameterByClass("ilbasicskillgui",
296  "obj_id", (int) $_GET["obj_id"]);
297  $ilToolbar->addButton($lng->txt("skmg_create_skll"),
298  $ilCtrl->getLinkTargetByClass("ilbasicskillgui", "create"));
299 
300  // skill category
301  $ilCtrl->setParameterByClass("ilskillcategorygui",
302  "obj_id", (int) $_GET["obj_id"]);
303  $ilToolbar->addButton($lng->txt("skmg_create_skill_category"),
304  $ilCtrl->getLinkTargetByClass("ilskillcategorygui", "create"));
305 
306  // skill template reference
307  $ilCtrl->setParameterByClass("ilskilltemplatereferencegui",
308  "obj_id", (int) $_GET["obj_id"]);
309  $ilToolbar->addButton($lng->txt("skmg_create_skill_template_reference"),
310  $ilCtrl->getLinkTargetByClass("ilskilltemplatereferencegui", "create"));
311 
312  // skills from clipboard
313  $sep = false;
314  if ($ilUser->clipboardHasObjectsOfType("skll"))
315  {
316  $ilToolbar->addSeparator();
317  $sep = true;
318  $ilToolbar->addButton($lng->txt("skmg_insert_basic_skill_from_clip"),
319  $ilCtrl->getLinkTargetByClass("ilskillcategorygui", "insertBasicSkillClip"));
320  }
321 
322  // skills from clipboard
323  if ($ilUser->clipboardHasObjectsOfType("scat"))
324  {
325  if (!$sep)
326  {
327  $ilToolbar->addSeparator();
328  $sep = true;
329  }
330  $ilToolbar->addButton($lng->txt("skmg_insert_skill_category_from_clip"),
331  $ilCtrl->getLinkTargetByClass("ilskillcategorygui", "insertSkillCategoryClip"));
332  }
333 
334  // skills from clipboard
335  if ($ilUser->clipboardHasObjectsOfType("sktr"))
336  {
337  if (!$sep)
338  {
339  $ilToolbar->addSeparator();
340  $sep = true;
341  }
342  $ilToolbar->addButton($lng->txt("skmg_insert_skill_template_reference_from_clip"),
343  $ilCtrl->getLinkTargetByClass("ilskillcategorygui", "insertTemplateReferenceClip"));
344  }
345 
346  // skill template reference
347  $ilToolbar->addButton($lng->txt("skmg_import_skills"),
348  $ilCtrl->getLinkTargetByClass("ilskillrootgui", "showImportForm"));
349 
350  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
global $lng
Definition: privfeed.php:17
+ Here is the caller graph for this function:

◆ cancel()

ilSkillCategoryGUI::cancel ( )

Cancel.

Parameters

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

References $ilCtrl.

359  {
360  global $ilCtrl;
361 
362  $ilCtrl->redirectByClass("ilobjskillmanagementgui", "editSkills");
363  }
global $ilCtrl
Definition: ilias.php:18

◆ edit()

ilSkillCategoryGUI::edit ( )

Edit.

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

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

124  {
125  global $tpl;
126 
127  $this->initForm();
128  $this->getValues();
129  $tpl->setContent($this->form->getHTML());
130  }
global $tpl
Definition: ilias.php:8
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 100 of file class.ilSkillCategoryGUI.php.

References $tpl, and setTabs().

101  {
102  global $tpl;
103 
104  $this->setTabs("properties");
105  parent::editProperties();
106  }
global $tpl
Definition: ilias.php:8
setTabs($a_tab)
output tabs
+ Here is the call graph for this function:

◆ executeCommand()

ilSkillCategoryGUI::executeCommand ( )

Execute command.

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

References $cmd, $ilCtrl, $ret, and $tpl.

43  {
44  global $ilCtrl, $tpl, $ilTabs;
45 
46  //$tpl->getStandardTemplate();
47 
48  $next_class = $ilCtrl->getNextClass($this);
49  $cmd = $ilCtrl->getCmd();
50 
51  switch($next_class)
52  {
53  default:
54  $ret = $this->$cmd();
55  break;
56  }
57  }
$cmd
Definition: sahs_server.php:35
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
$ret
Definition: parser.php:6

◆ getType()

ilSkillCategoryGUI::getType ( )

Get Node Type.

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

35  {
36  return "scat";
37  }

◆ getValues()

ilSkillCategoryGUI::getValues ( )

Get current values for from.

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

References array.

Referenced by edit().

208  {
209  $values = array();
210  $values["title"] = $this->node_object->getTitle();
211  $values["order_nr"] = $this->node_object->getOrderNr();
212  $values["self_eval"] = $this->node_object->getSelfEvaluation();
213  $values["status"] = $this->node_object->getStatus();
214  $this->form->setValuesByArray($values);
215  }
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 137 of file class.ilSkillCategoryGUI.php.

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

Referenced by edit().

138  {
139  global $lng, $ilCtrl;
140 
141  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
142  $this->form = new ilPropertyFormGUI();
143 
144  // title
145  $ti = new ilTextInputGUI($lng->txt("title"), "title");
146  $ti->setMaxLength(200);
147  $ti->setSize(50);
148  $ti->setRequired(true);
149  $this->form->addItem($ti);
150 
151  // order nr
152  $ni = new ilNumberInputGUI($lng->txt("skmg_order_nr"), "order_nr");
153  $ni->setMaxLength(6);
154  $ni->setSize(6);
155  $ni->setRequired(true);
156  $this->form->addItem($ni);
157 
158  // status
159  $this->addStatusInput($this->form);
160 
161  // selectable
162  $cb = new ilCheckboxInputGUI($lng->txt("skmg_selectable"), "self_eval");
163  $cb->setInfo($lng->txt("skmg_selectable_info"));
164  $this->form->addItem($cb);
165 
166  // save and cancel commands
167  if ($this->checkPermissionBool("write"))
168  {
169  if ($a_mode == "create")
170  {
171  $this->form->addCommandButton("save", $lng->txt("save"));
172  $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
173  $this->form->setTitle($lng->txt("skmg_create_skill_category"));
174  } else
175  {
176  $this->form->addCommandButton("update", $lng->txt("save"));
177  $this->form->setTitle($lng->txt("skmg_edit_scat"));
178  }
179  }
180 
181  $ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
182  $this->form->setFormAction($ilCtrl->getFormAction($this));
183  }
This class represents a property form user interface.
$_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.
setMaxLength($a_maxlength)
Set Max Length.
global $lng
Definition: privfeed.php:17
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 262 of file class.ilSkillCategoryGUI.php.

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

263  {
264  global $tpl, $lng;
265 
266  if ($this->isInUse())
267  {
268  ilUtil::sendInfo($lng->txt("skmg_skill_in_use"));
269  }
270 
271  if ($this->checkPermissionBool("write"))
272  {
273  self::addCreationButtons();
274  }
275  $this->setTabs("content");
276 
277  include_once("./Services/Skill/classes/class.ilSkillCatTableGUI.php");
278  $table = new ilSkillCatTableGUI($this, "listItems", (int) $_GET["obj_id"],
280 
281  $tpl->setContent($table->getHTML());
282  }
$_GET["client_id"]
global $tpl
Definition: ilias.php:8
checkPermissionBool($a_perm)
Check permission pool.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
setTabs($a_tab)
output tabs
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ proceedDragDrop()

ilSkillCategoryGUI::proceedDragDrop ( )

Perform drag and drop action.

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

References $ilCtrl.

112  {
113  global $ilCtrl;
114 
115 // $this->slm_object->executeDragDrop($_POST["il_hform_source_id"], $_POST["il_hform_target_id"],
116 // $_POST["il_hform_fc"], $_POST["il_hform_as_subitem"]);
117 // $ilCtrl->redirect($this, "showOrganization");
118  }
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 371 of file class.ilSkillCategoryGUI.php.

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

372  {
373  global $ilCtrl;
374 
375  $t = ilSkillTreeNode::_lookupType((int) $_GET["obj_id"]);
376 
377  switch ($t)
378  {
379  case "skrt":
380  $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id", (int) $_GET["obj_id"]);
381  $ilCtrl->redirectByClass("ilskillrootgui", "listSkills");
382  break;
383  }
384 
385  parent::redirectToParent();
386  }
$_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 188 of file class.ilSkillCategoryGUI.php.

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

189  {
190  if (!$this->checkPermissionBool("write"))
191  {
192  return;
193  }
194  include_once "Services/Skill/classes/class.ilSkillCategory.php";
195  $it = new ilSkillCategory();
196  $it->setTitle($this->form->getInput("title"));
197  $it->setOrderNr($this->form->getInput("order_nr"));
198  $it->setSelfEvaluation($_POST["self_eval"]);
199  $it->setStatus($_POST["status"]);
200  $it->create();
201  ilSkillTreeNode::putInTree($it, (int) $_GET["obj_id"], IL_LAST_NODE);
202  }
$_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 62 of file class.ilSkillCategoryGUI.php.

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

Referenced by editProperties(), and listItems().

63  {
64  global $ilTabs, $ilCtrl, $tpl, $lng, $ilHelp;
65 
66  $ilTabs->clearTargets();
67  $ilHelp->setScreenIdComponent("skmg_scat");
68 
69  // content
70  $ilTabs->addTab("content", $lng->txt("content"),
71  $ilCtrl->getLinkTarget($this, 'listItems'));
72 
73  // properties
74  $ilTabs->addTab("properties", $lng->txt("settings"),
75  $ilCtrl->getLinkTarget($this, 'editProperties'));
76 
77  // usage
78  $this->addUsageTab($ilTabs);
79 
80  // back link
81  $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id",
82  $this->node_object->skill_tree->getRootId());
83  $ilTabs->setBackTarget($lng->txt("obj_skmg"),
84  $ilCtrl->getLinkTargetByClass("ilskillrootgui", "listSkills"));
85  $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id",
86  $_GET["obj_id"]);
87 
88 
89  parent::setTitleIcon();
90  $tpl->setTitle(
91  $lng->txt("scat").": ".$this->node_object->getTitle());
92  $this->setSkillNodeDescription();
93 
94  $ilTabs->activateTab($a_tab);
95  }
addUsageTab($a_tabs)
Add usage tab.
setSkillNodeDescription()
Set skill node description.
$_GET["client_id"]
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateItem()

ilSkillCategoryGUI::updateItem ( )

Update item.

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

References $_POST, and ilSkillTreeNodeGUI\checkPermissionBool().

221  {
222  if (!$this->checkPermissionBool("write"))
223  {
224  return;
225  }
226 
227  $this->node_object->setTitle($this->form->getInput("title"));
228  $this->node_object->setOrderNr($this->form->getInput("order_nr"));
229  $this->node_object->setSelfEvaluation($_POST["self_eval"]);
230  $this->node_object->setStatus($_POST["status"]);
231  $this->node_object->update();
232  }
checkPermissionBool($a_perm)
Check permission pool.
$_POST["username"]
+ Here is the call graph for this function:

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