ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilSkillCategoryGUI Class Reference

Skill category GUI class. More...

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

Public Member Functions

 __construct (Node\SkillTreeNodeManager $node_manager, int $a_node_id=0)
 
 getType ()
 
 executeCommand ()
 
 setTabs (string $a_tab)
 
 editProperties ()
 
 edit ()
 
 initForm (string $a_mode="edit")
 
 saveItem ()
 
 getValues ()
 Get current values for from. More...
 
 updateItem ()
 
 listItems ()
 
 redirectToParent (bool $a_tmp_mode=false)
 Redirect to parent (identified by current node_id) More...
 
- Public Member Functions inherited from ilSkillTreeNodeGUI
 __construct (Node\SkillTreeNodeManager $node_manager, int $a_node_id=0)
 
 isInUse ()
 
 setParentGUI (object $a_parentgui)
 
 getParentGUI ()
 
 readNodeObject (int $a_node_id)
 Get node object instance. More...
 
 saveAllTitles ()
 
 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 ()
 
 confirmedDelete ()
 confirmed delete More...
 
 setSkillNodeDescription ()
 
 create ()
 Create skill tree node. More...
 
 addStatusInput (ilPropertyFormGUI $a_form)
 
 editProperties ()
 
 getPropertyValues ()
 Get property values for edit form. More...
 
 save ()
 Save skill tree node. More...
 
 afterSave ()
 
 update ()
 Update skill tree node. More...
 
 afterUpdate ()
 
 initForm (string $a_mode="edit")
 
 cancelSave ()
 
 redirectToParent (bool $a_tmp_mode=false)
 Redirect to parent (identified by current node_id) More...
 
 saveOrder ()
 
 insertBasicSkillClip ()
 
 insertSkillCategoryClip ()
 
 insertTemplateReferenceClip ()
 
 insertSkillTemplateClip ()
 
 insertTemplateCategoryClip ()
 
 setTitleIcon ()
 
 addUsageTab (ilTabsGUI $a_tabs)
 
 showUsage ()
 
 addObjectsTab (ilTabsGUI $a_tabs)
 
 showObjects ()
 
 exportSelectedNodes ()
 

Static Public Member Functions

static addCreationButtons ()
 

Protected Attributes

ilCtrl $ctrl
 
ilGlobalTemplateInterface $tpl
 
ilTabsGUI $tabs
 
ilLanguage $lng
 
ilHelpGUI $help
 
- Protected Attributes inherited from ilSkillTreeNodeGUI
ilCtrl $ctrl
 
ilLanguage $lng
 
ilLocatorGUI $locator
 
ilGlobalTemplateInterface $tpl
 
ilObjUser $user
 
ilTree $tree
 
ilPropertyFormGUI $form
 
UI Factory $ui_fac
 
UI Renderer $ui_ren
 
object $parentgui
 
int $tref_id = 0
 
Node SkillTreeNodeManager $skill_tree_node_manager
 
SkillTreeAccess $tree_access_manager
 
Table TableManager $table_manager
 
Usage SkillUsageManager $usage_manager
 
ilSkillTreeRepository $tree_repo
 
int $skill_tree_id = 0
 
ilTabsGUI $tabs
 
SkillAdminGUIRequest $admin_gui_request
 
SkillUIService $skill_ui_service
 
int $requested_ref_id = 0
 
int $requested_node_id = 0
 
string $requested_backcmd = ""
 
bool $requested_tmpmode = false
 
int $base_skill_id = 0
 
array $requested_node_ids = []
 
array $requested_node_order = []
 

Additional Inherited Members

- Data Fields inherited from ilSkillTreeNodeGUI
object $node_object = null
 
bool $in_use = false
 
bool $use_checked = false
 
ilAccessHandler $access
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilSkillCategoryGUI::__construct ( Node\SkillTreeNodeManager  $node_manager,
int  $a_node_id = 0 
)

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

References $DIC, ILIAS\MetaData\Repository\Validation\Data\__construct(), ILIAS\Repository\ctrl(), ILIAS\Repository\help(), ILIAS\Repository\lng(), and ILIAS\Repository\tabs().

40  {
41  global $DIC;
42 
43  $this->ctrl = $DIC->ctrl();
44  $this->tpl = $DIC["tpl"];
45  $this->tabs = $DIC->tabs();
46  $this->lng = $DIC->language();
47  $this->help = $DIC["ilHelp"];
48  $ilCtrl = $DIC->ctrl();
49 
50  $ilCtrl->saveParameter($this, "node_id");
51 
52  parent::__construct($node_manager, $a_node_id);
53  }
global $DIC
Definition: feed.php:28
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ addCreationButtons()

static ilSkillCategoryGUI::addCreationButtons ( )
static

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

References ilSkillTreeNodeGUI\$admin_gui_request, $DIC, ilSkillTreeNodeGUI\$requested_node_id, ILIAS\Skill\Service\SkillAdminGUIRequest\getNodeId(), and ilLanguage\txt().

Referenced by ilSkillRootGUI\listSkills().

281  : void
282  {
283  global $DIC;
284 
285  $ilCtrl = $DIC->ctrl();
286  $lng = $DIC->language();
287  $ilToolbar = $DIC->toolbar();
288  $ilUser = $DIC->user();
289  $admin_gui_request = $DIC->skills()->internal()->gui()->admin_request();
290 
292 
293  // skill
294  $ilCtrl->setParameterByClass(
295  "ilbasicskillgui",
296  "node_id",
298  );
299  $ilToolbar->addButton(
300  $lng->txt("skmg_create_skll"),
301  $ilCtrl->getLinkTargetByClass("ilbasicskillgui", "create")
302  );
303 
304  // skill category
305  $ilCtrl->setParameterByClass(
306  "ilskillcategorygui",
307  "node_id",
309  );
310  $ilToolbar->addButton(
311  $lng->txt("skmg_create_skill_category"),
312  $ilCtrl->getLinkTargetByClass("ilskillcategorygui", "create")
313  );
314 
315  // skill template reference
316  $ilCtrl->setParameterByClass(
317  "ilskilltemplatereferencegui",
318  "node_id",
320  );
321  $ilToolbar->addButton(
322  $lng->txt("skmg_create_skill_template_reference"),
323  $ilCtrl->getLinkTargetByClass("ilskilltemplatereferencegui", "create")
324  );
325 
326  // skills from clipboard
327  $sep = false;
328  if ($ilUser->clipboardHasObjectsOfType("skll")) {
329  $ilToolbar->addSeparator();
330  $sep = true;
331  $ilToolbar->addButton(
332  $lng->txt("skmg_insert_basic_skill_from_clip"),
333  $ilCtrl->getLinkTargetByClass("ilskillcategorygui", "insertBasicSkillClip")
334  );
335  }
336 
337  // skills from clipboard
338  if ($ilUser->clipboardHasObjectsOfType("scat")) {
339  if (!$sep) {
340  $ilToolbar->addSeparator();
341  $sep = true;
342  }
343  $ilToolbar->addButton(
344  $lng->txt("skmg_insert_skill_category_from_clip"),
345  $ilCtrl->getLinkTargetByClass("ilskillcategorygui", "insertSkillCategoryClip")
346  );
347  }
348 
349  // skills from clipboard
350  if ($ilUser->clipboardHasObjectsOfType("sktr")) {
351  if (!$sep) {
352  $ilToolbar->addSeparator();
353  $sep = true;
354  }
355  $ilToolbar->addButton(
356  $lng->txt("skmg_insert_skill_template_reference_from_clip"),
357  $ilCtrl->getLinkTargetByClass("ilskillcategorygui", "insertTemplateReferenceClip")
358  );
359  }
360 
361  // skill template reference
362  $ilToolbar->addButton(
363  $lng->txt("skmg_import_skills"),
364  $ilCtrl->getLinkTargetByClass("ilskillrootgui", "showImportForm")
365  );
366  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
global $DIC
Definition: feed.php:28
SkillAdminGUIRequest $admin_gui_request
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ edit()

ilSkillCategoryGUI::edit ( )

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

References $tpl, ILIAS\Repository\form(), getValues(), initForm(), and ilGlobalTemplateInterface\setContent().

160  : void
161  {
162  $tpl = $this->tpl;
163 
164  $this->initForm();
165  $this->getValues();
166  $tpl->setContent($this->form->getHTML());
167  }
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
initForm(string $a_mode="edit")
form( $class_path, string $cmd, string $submit_caption="")
getValues()
Get current values for from.
+ Here is the call graph for this function:

◆ editProperties()

ilSkillCategoryGUI::editProperties ( )

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

References $tpl, and setTabs().

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

◆ executeCommand()

ilSkillCategoryGUI::executeCommand ( )

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

References $ctrl, $tabs, and $tpl.

60  : void
61  {
62  $ilCtrl = $this->ctrl;
63  $tpl = $this->tpl;
64  $ilTabs = $this->tabs;
65 
66  //$tpl->getStandardTemplate();
67 
68  $next_class = $ilCtrl->getNextClass($this);
69  $cmd = $ilCtrl->getCmd();
70 
71  switch ($next_class) {
72  default:
73  $ret = $this->$cmd();
74  break;
75  }
76  }
ilGlobalTemplateInterface $tpl

◆ getType()

ilSkillCategoryGUI::getType ( )

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

55  : string
56  {
57  return "scat";
58  }

◆ getValues()

ilSkillCategoryGUI::getValues ( )

Get current values for from.

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

References ILIAS\Repository\form().

Referenced by edit().

234  : void
235  {
236  $values = [];
237  $values["title"] = $this->node_object->getTitle();
238  $values["description"] = $this->node_object->getDescription();
239  $values["self_eval"] = $this->node_object->getSelfEvaluation();
240  $values["status"] = $this->node_object->getStatus();
241  $this->form->setValuesByArray($values);
242  }
form( $class_path, string $cmd, string $submit_caption="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initForm()

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

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

References $ctrl, $lng, ilSkillTreeNodeGUI\addStatusInput(), ILIAS\Repository\form(), ilTextAreaInputGUI\setRows(), and ilLanguage\txt().

Referenced by edit().

169  : void
170  {
171  $lng = $this->lng;
172  $ilCtrl = $this->ctrl;
173 
174  $this->form = new ilPropertyFormGUI();
175 
176  // title
177  $ti = new ilTextInputGUI($lng->txt("title"), "title");
178  $ti->setMaxLength(200);
179  $ti->setSize(50);
180  $ti->setRequired(true);
181  $this->form->addItem($ti);
182 
183  // description
184  $ta = new ilTextAreaInputGUI($lng->txt("description"), "description");
185  $ta->setRows(5);
186  $this->form->addItem($ta);
187 
188  // status
189  $this->addStatusInput($this->form);
190 
191  // selectable
192  $cb = new ilCheckboxInputGUI($lng->txt("skmg_selectable"), "self_eval");
193  $cb->setInfo($lng->txt("skmg_selectable_info"));
194  $this->form->addItem($cb);
195 
196  // save and cancel commands
197  if ($this->tree_access_manager->hasManageCompetencesPermission()) {
198  if ($a_mode == "create") {
199  $this->form->addCommandButton("save", $lng->txt("save"));
200  $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
201  $this->form->setTitle($lng->txt("skmg_create_skill_category"));
202  } else {
203  $this->form->addCommandButton("update", $lng->txt("save"));
204  $this->form->setTitle($lng->txt("skmg_edit_scat"));
205  }
206  } else {
207  foreach ($this->form->getItems() as $item) {
208  $item->setDisabled(true);
209  }
210  }
211 
212  $ilCtrl->setParameter($this, "node_id", $this->requested_node_id);
213  $this->form->setFormAction($ilCtrl->getFormAction($this));
214  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
form( $class_path, string $cmd, string $submit_caption="")
This class represents a text area property in a property form.
addStatusInput(ilPropertyFormGUI $a_form)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listItems()

ilSkillCategoryGUI::listItems ( )

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

References $lng, $tpl, ilSkillTreeNodeGUI\isInUse(), ilSkillCatTableGUI\MODE_SCAT, ilGlobalTemplateInterface\setContent(), setTabs(), and ilLanguage\txt().

257  : void
258  {
259  $tpl = $this->tpl;
260  $lng = $this->lng;
261 
262  if ($this->isInUse()) {
263  $this->tpl->setOnScreenMessage('info', $lng->txt("skmg_skill_in_use"));
264  }
265 
266  if ($this->tree_access_manager->hasManageCompetencesPermission()) {
267  self::addCreationButtons();
268  }
269  $this->setTabs("content");
270 
271  $table = new ilSkillCatTableGUI(
272  $this,
273  "listItems",
274  $this->requested_node_id,
276  );
277 
278  $tpl->setContent($table->getHTML());
279  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ redirectToParent()

ilSkillCategoryGUI::redirectToParent ( bool  $a_tmp_mode = false)

Redirect to parent (identified by current node_id)

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

References $ctrl, and ilSkillTreeNode\_lookupType().

371  : void
372  {
373  $ilCtrl = $this->ctrl;
374 
375  $t = ilSkillTreeNode::_lookupType($this->requested_node_id);
376 
377  switch ($t) {
378  case "skrt":
379  $ilCtrl->setParameterByClass("ilskillrootgui", "node_id", $this->requested_node_id);
380  $ilCtrl->redirectByClass("ilskillrootgui", "listSkills");
381  break;
382  }
383 
384  parent::redirectToParent();
385  }
static _lookupType(int $a_obj_id)
+ Here is the call graph for this function:

◆ saveItem()

ilSkillCategoryGUI::saveItem ( )

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

References ILIAS\Repository\form(), and ilTree\POS_LAST_NODE.

216  : void
217  {
218  if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
219  return;
220  }
221 
222  $it = new ilSkillCategory();
223  $it->setTitle($this->form->getInput("title"));
224  $it->setDescription($this->form->getInput("description"));
225  $it->setSelfEvaluation((bool) $this->form->getInput("self_eval"));
226  $it->setStatus((int) $this->form->getInput("status"));
227  $it->create();
228  $this->skill_tree_node_manager->putIntoTree($it, $this->requested_node_id, ilTree::POS_LAST_NODE);
229  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const POS_LAST_NODE
form( $class_path, string $cmd, string $submit_caption="")
+ Here is the call graph for this function:

◆ setTabs()

ilSkillCategoryGUI::setTabs ( string  $a_tab)

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

References $ctrl, $help, $lng, $tabs, $tpl, ilSkillTreeNode\_lookupTitle(), ilSkillTreeNode\_lookupType(), ilSkillTreeNodeGUI\addUsageTab(), ilHelpGUI\setScreenIdComponent(), ilSkillTreeNodeGUI\setSkillNodeDescription(), ilGlobalTemplateInterface\setTitle(), and ilLanguage\txt().

Referenced by editProperties(), and listItems().

78  : void
79  {
80  $ilTabs = $this->tabs;
81  $ilCtrl = $this->ctrl;
82  $tpl = $this->tpl;
83  $lng = $this->lng;
84  $ilHelp = $this->help;
85 
86  $ilTabs->clearTargets();
87  $ilHelp->setScreenIdComponent("skmg_scat");
88 
89  // content
90  $ilTabs->addTab(
91  "content",
92  $lng->txt("content"),
93  $ilCtrl->getLinkTarget($this, 'listItems')
94  );
95 
96  // properties
97  $ilTabs->addTab(
98  "properties",
99  $lng->txt("settings"),
100  $ilCtrl->getLinkTarget($this, 'editProperties')
101  );
102 
103  // usage
104  $this->addUsageTab($ilTabs);
105 
106  $parent_node_id = $this->tree_repo->getParentNodeIdForNodeId($this->requested_node_id);
107  $parent_title = ilSkillTreeNode::_lookupTitle($parent_node_id);
108  $parent_type = ilSkillTreeNode::_lookupType($parent_node_id);
109 
110  // back link
111  if ($parent_type === "scat") {
112  $ilCtrl->setParameter(
113  $this,
114  "node_id",
115  $parent_node_id
116  );
117  $ilTabs->setBackTarget(
118  $parent_title,
119  $ilCtrl->getLinkTarget($this, "listItems")
120  );
121  $ilCtrl->setParameter(
122  $this,
123  "node_id",
124  $this->requested_node_id
125  );
126  } else {
127  $ilCtrl->setParameterByClass(
128  "ilskillrootgui",
129  "node_id",
130  $this->skill_tree_node_manager->getRootId()
131  );
132  $ilTabs->setBackTarget(
133  $lng->txt("skmg_skills"),
134  $ilCtrl->getLinkTargetByClass("ilskillrootgui", "listSkills")
135  );
136  $ilCtrl->setParameterByClass(
137  "ilskillrootgui",
138  "node_id",
139  $this->requested_node_id
140  );
141  }
142 
143  parent::setTitleIcon();
144  $tpl->setTitle(
145  $lng->txt("scat") . ": " . $this->node_object->getTitle()
146  );
147  $this->setSkillNodeDescription();
148 
149  $ilTabs->activateTab($a_tab);
150  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
addUsageTab(ilTabsGUI $a_tabs)
static _lookupTitle(int $a_obj_id, int $a_tref_id=0)
ilGlobalTemplateInterface $tpl
static _lookupType(int $a_obj_id)
setScreenIdComponent(string $a_comp)
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateItem()

ilSkillCategoryGUI::updateItem ( )

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

References ILIAS\Repository\form().

244  : void
245  {
246  if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
247  return;
248  }
249 
250  $this->node_object->setTitle($this->form->getInput("title"));
251  $this->node_object->setDescription($this->form->getInput("description"));
252  $this->node_object->setSelfEvaluation((bool) $this->form->getInput("self_eval"));
253  $this->node_object->setStatus((int) $this->form->getInput("status"));
254  $this->node_object->update();
255  }
form( $class_path, string $cmd, string $submit_caption="")
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilSkillCategoryGUI::$ctrl
protected

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

Referenced by executeCommand(), initForm(), redirectToParent(), and setTabs().

◆ $help

ilHelpGUI ilSkillCategoryGUI::$help
protected

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

Referenced by setTabs().

◆ $lng

ilLanguage ilSkillCategoryGUI::$lng
protected

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

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

◆ $tabs

ilTabsGUI ilSkillCategoryGUI::$tabs
protected

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

Referenced by executeCommand(), and setTabs().

◆ $tpl

ilGlobalTemplateInterface ilSkillCategoryGUI::$tpl
protected

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

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


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