ILIAS  release_8 Revision v8.24
ilSkillCategoryGUI Class Reference

Skill category GUI class. More...

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

Public Member Functions

 __construct (Tree\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 (Tree\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
 
object $parentgui
 
int $tref_id = 0
 
Tree SkillTreeNodeManager $skill_tree_node_manager
 
SkillTreeAccess $tree_access_manager
 
ilSkillTreeRepository $tree_repo
 
int $skill_tree_id = 0
 
ilTabsGUI $tabs
 
SkillAdminGUIRequest $admin_gui_request
 
int $requested_ref_id = 0
 
int $requested_node_id = 0
 
string $requested_backcmd = ""
 
int $requested_tmpmode = 0
 
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

Skill category GUI class.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e

@ilCtrl_isCalledBy ilSkillCategoryGUI: ilObjSkillManagementGUI, ilObjSkillTreeGUI

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

Constructor & Destructor Documentation

◆ __construct()

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

Reimplemented from ilSkillTreeNodeGUI.

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

38 {
39 global $DIC;
40
41 $this->ctrl = $DIC->ctrl();
42 $this->tpl = $DIC["tpl"];
43 $this->tabs = $DIC->tabs();
44 $this->lng = $DIC->language();
45 $this->help = $DIC["ilHelp"];
46 $ilCtrl = $DIC->ctrl();
47
48 $ilCtrl->saveParameter($this, "node_id");
49
50 parent::__construct($node_manager, $a_node_id);
51 }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), ILIAS\Repository\help(), ILIAS\Repository\lng(), and ILIAS\Repository\tabs().

+ Here is the call graph for this function:

Member Function Documentation

◆ addCreationButtons()

static ilSkillCategoryGUI::addCreationButtons ( )
static

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

279 : void
280 {
281 global $DIC;
282
283 $ilCtrl = $DIC->ctrl();
284 $lng = $DIC->language();
285 $ilToolbar = $DIC->toolbar();
286 $ilUser = $DIC->user();
287 $admin_gui_request = $DIC->skills()->internal()->gui()->admin_request();
288
290
291 // skill
292 $ilCtrl->setParameterByClass(
293 "ilbasicskillgui",
294 "node_id",
296 );
297 $ilToolbar->addButton(
298 $lng->txt("skmg_create_skll"),
299 $ilCtrl->getLinkTargetByClass("ilbasicskillgui", "create")
300 );
301
302 // skill category
303 $ilCtrl->setParameterByClass(
304 "ilskillcategorygui",
305 "node_id",
307 );
308 $ilToolbar->addButton(
309 $lng->txt("skmg_create_skill_category"),
310 $ilCtrl->getLinkTargetByClass("ilskillcategorygui", "create")
311 );
312
313 // skill template reference
314 $ilCtrl->setParameterByClass(
315 "ilskilltemplatereferencegui",
316 "node_id",
318 );
319 $ilToolbar->addButton(
320 $lng->txt("skmg_create_skill_template_reference"),
321 $ilCtrl->getLinkTargetByClass("ilskilltemplatereferencegui", "create")
322 );
323
324 // skills from clipboard
325 $sep = false;
326 if ($ilUser->clipboardHasObjectsOfType("skll")) {
327 $ilToolbar->addSeparator();
328 $sep = true;
329 $ilToolbar->addButton(
330 $lng->txt("skmg_insert_basic_skill_from_clip"),
331 $ilCtrl->getLinkTargetByClass("ilskillcategorygui", "insertBasicSkillClip")
332 );
333 }
334
335 // skills from clipboard
336 if ($ilUser->clipboardHasObjectsOfType("scat")) {
337 if (!$sep) {
338 $ilToolbar->addSeparator();
339 $sep = true;
340 }
341 $ilToolbar->addButton(
342 $lng->txt("skmg_insert_skill_category_from_clip"),
343 $ilCtrl->getLinkTargetByClass("ilskillcategorygui", "insertSkillCategoryClip")
344 );
345 }
346
347 // skills from clipboard
348 if ($ilUser->clipboardHasObjectsOfType("sktr")) {
349 if (!$sep) {
350 $ilToolbar->addSeparator();
351 $sep = true;
352 }
353 $ilToolbar->addButton(
354 $lng->txt("skmg_insert_skill_template_reference_from_clip"),
355 $ilCtrl->getLinkTargetByClass("ilskillcategorygui", "insertTemplateReferenceClip")
356 );
357 }
358
359 // skill template reference
360 $ilToolbar->addButton(
361 $lng->txt("skmg_import_skills"),
362 $ilCtrl->getLinkTargetByClass("ilskillrootgui", "showImportForm")
363 );
364 }
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...
SkillAdminGUIRequest $admin_gui_request
$ilUser
Definition: imgupload.php:34

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

Referenced by listItems(), and ilSkillRootGUI\listSkills().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ edit()

ilSkillCategoryGUI::edit ( )

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

158 : void
159 {
161
162 $this->initForm();
163 $this->getValues();
164 $tpl->setContent($this->form->getHTML());
165 }
ilGlobalTemplateInterface $tpl
getValues()
Get current values for from.
initForm(string $a_mode="edit")
setContent(string $a_html)
Sets content for standard template.
form( $class_path, string $cmd)

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

+ Here is the call graph for this function:

◆ editProperties()

ilSkillCategoryGUI::editProperties ( )

Reimplemented from ilSkillTreeNodeGUI.

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

150 : void
151 {
153
154 $this->setTabs("properties");
155 parent::editProperties();
156 }

References $tpl, and setTabs().

+ Here is the call graph for this function:

◆ executeCommand()

ilSkillCategoryGUI::executeCommand ( )

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

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

References $ctrl, $tabs, and $tpl.

◆ getType()

ilSkillCategoryGUI::getType ( )

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

53 : string
54 {
55 return "scat";
56 }

◆ getValues()

ilSkillCategoryGUI::getValues ( )

Get current values for from.

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

232 : void
233 {
234 $values = [];
235 $values["title"] = $this->node_object->getTitle();
236 $values["description"] = $this->node_object->getDescription();
237 $values["self_eval"] = $this->node_object->getSelfEvaluation();
238 $values["status"] = $this->node_object->getStatus();
239 $this->form->setValuesByArray($values);
240 }

References ILIAS\Repository\form().

Referenced by edit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initForm()

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

Reimplemented from ilSkillTreeNodeGUI.

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

167 : void
168 {
170 $ilCtrl = $this->ctrl;
171
172 $this->form = new ilPropertyFormGUI();
173
174 // title
175 $ti = new ilTextInputGUI($lng->txt("title"), "title");
176 $ti->setMaxLength(200);
177 $ti->setSize(50);
178 $ti->setRequired(true);
179 $this->form->addItem($ti);
180
181 // description
182 $ta = new ilTextAreaInputGUI($lng->txt("description"), "description");
183 $ta->setRows(5);
184 $this->form->addItem($ta);
185
186 // status
187 $this->addStatusInput($this->form);
188
189 // selectable
190 $cb = new ilCheckboxInputGUI($lng->txt("skmg_selectable"), "self_eval");
191 $cb->setInfo($lng->txt("skmg_selectable_info"));
192 $this->form->addItem($cb);
193
194 // save and cancel commands
195 if ($this->tree_access_manager->hasManageCompetencesPermission()) {
196 if ($a_mode == "create") {
197 $this->form->addCommandButton("save", $lng->txt("save"));
198 $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
199 $this->form->setTitle($lng->txt("skmg_create_skill_category"));
200 } else {
201 $this->form->addCommandButton("update", $lng->txt("save"));
202 $this->form->setTitle($lng->txt("skmg_edit_scat"));
203 }
204 } else {
205 foreach ($this->form->getItems() as $item) {
206 $item->setDisabled(true);
207 }
208 }
209
210 $ilCtrl->setParameter($this, "node_id", $this->requested_node_id);
211 $this->form->setFormAction($ilCtrl->getFormAction($this));
212 }
This class represents a checkbox property in a property form.
This class represents a property form user interface.
addStatusInput(ilPropertyFormGUI $a_form)
This class represents a text area property in a property form.
This class represents a text property in a property form.

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

Referenced by edit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listItems()

ilSkillCategoryGUI::listItems ( )

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

255 : void
256 {
259
260 if ($this->isInUse()) {
261 $this->tpl->setOnScreenMessage('info', $lng->txt("skmg_skill_in_use"));
262 }
263
264 if ($this->tree_access_manager->hasManageCompetencesPermission()) {
266 }
267 $this->setTabs("content");
268
269 $table = new ilSkillCatTableGUI(
270 $this,
271 "listItems",
272 $this->requested_node_id,
274 );
275
276 $tpl->setContent($table->getHTML());
277 }

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

+ Here is the call graph for this function:

◆ redirectToParent()

ilSkillCategoryGUI::redirectToParent ( bool  $a_tmp_mode = false)

Redirect to parent (identified by current node_id)

Reimplemented from ilSkillTreeNodeGUI.

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

369 : void
370 {
371 $ilCtrl = $this->ctrl;
372
373 $t = ilSkillTreeNode::_lookupType($this->requested_node_id);
374
375 switch ($t) {
376 case "skrt":
377 $ilCtrl->setParameterByClass("ilskillrootgui", "node_id", $this->requested_node_id);
378 $ilCtrl->redirectByClass("ilskillrootgui", "listSkills");
379 break;
380 }
381
382 parent::redirectToParent();
383 }
static _lookupType(int $a_obj_id)

References $ctrl, and ilSkillTreeNode\_lookupType().

+ Here is the call graph for this function:

◆ saveItem()

ilSkillCategoryGUI::saveItem ( )

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

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

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

+ Here is the call graph for this function:

◆ setTabs()

ilSkillCategoryGUI::setTabs ( string  $a_tab)

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

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

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateItem()

ilSkillCategoryGUI::updateItem ( )

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

242 : void
243 {
244 if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
245 return;
246 }
247
248 $this->node_object->setTitle($this->form->getInput("title"));
249 $this->node_object->setDescription($this->form->getInput("description"));
250 $this->node_object->setSelfEvaluation((bool) $this->form->getInput("self_eval"));
251 $this->node_object->setStatus($this->form->getInput("status"));
252 $this->node_object->update();
253 }

References ILIAS\Repository\form().

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilSkillCategoryGUI::$ctrl
protected

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

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

◆ $help

ilHelpGUI ilSkillCategoryGUI::$help
protected

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

Referenced by setTabs().

◆ $lng

ilLanguage ilSkillCategoryGUI::$lng
protected

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

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

◆ $tabs

ilTabsGUI ilSkillCategoryGUI::$tabs
protected

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

Referenced by executeCommand(), and setTabs().

◆ $tpl

ilGlobalTemplateInterface ilSkillCategoryGUI::$tpl
protected

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

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


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