ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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 ()
 

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
 
DataFactory $data_factory
 
ExportFactoryInterface $export_factory
 
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 38 of file class.ilSkillCategoryGUI.php.

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

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

Member Function Documentation

◆ addCreationButtons()

static ilSkillCategoryGUI::addCreationButtons ( )
static

Definition at line 280 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().

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

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

159  : void
160  {
161  $tpl = $this->tpl;
162 
163  $this->initForm();
164  $this->getValues();
165  $tpl->setContent($this->form->getHTML());
166  }
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
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 151 of file class.ilSkillCategoryGUI.php.

References $tpl, and setTabs().

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

◆ executeCommand()

ilSkillCategoryGUI::executeCommand ( )

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

References $ctrl, $tabs, and $tpl.

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

◆ getType()

ilSkillCategoryGUI::getType ( )

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

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

◆ getValues()

ilSkillCategoryGUI::getValues ( )

Get current values for from.

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

References ILIAS\Repository\form().

Referenced by edit().

233  : void
234  {
235  $values = [];
236  $values["title"] = $this->node_object->getTitle();
237  $values["description"] = $this->node_object->getDescription();
238  $values["self_eval"] = $this->node_object->getSelfEvaluation();
239  $values["status"] = $this->node_object->getStatus();
240  $this->form->setValuesByArray($values);
241  }
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 168 of file class.ilSkillCategoryGUI.php.

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

Referenced by edit().

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

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

256  : void
257  {
258  $tpl = $this->tpl;
259  $lng = $this->lng;
260 
261  if ($this->isInUse()) {
262  $this->tpl->setOnScreenMessage('info', $lng->txt("skmg_skill_in_use"));
263  }
264 
265  if ($this->tree_access_manager->hasManageCompetencesPermission()) {
266  self::addCreationButtons();
267  }
268  $this->setTabs("content");
269 
270  $table = new ilSkillCatTableGUI(
271  $this,
272  "listItems",
273  $this->requested_node_id,
275  );
276 
277  $tpl->setContent($table->getHTML());
278  }
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...
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
+ 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 370 of file class.ilSkillCategoryGUI.php.

References $ctrl, and ilSkillTreeNode\_lookupType().

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

◆ saveItem()

ilSkillCategoryGUI::saveItem ( )

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

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

215  : void
216  {
217  if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
218  return;
219  }
220 
221  $it = new ilSkillCategory();
222  $it->setTitle($this->form->getInput("title"));
223  $it->setDescription($this->form->getInput("description"));
224  $it->setSelfEvaluation((bool) $this->form->getInput("self_eval"));
225  $it->setStatus((int) $this->form->getInput("status"));
226  $it->create();
227  $this->skill_tree_node_manager->putIntoTree($it, $this->requested_node_id, ilTree::POS_LAST_NODE);
228  }
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 77 of file class.ilSkillCategoryGUI.php.

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

Referenced by editProperties(), and listItems().

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

◆ updateItem()

ilSkillCategoryGUI::updateItem ( )

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

References ILIAS\Repository\form().

243  : void
244  {
245  if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
246  return;
247  }
248 
249  $this->node_object->setTitle($this->form->getInput("title"));
250  $this->node_object->setDescription($this->form->getInput("description"));
251  $this->node_object->setSelfEvaluation((bool) $this->form->getInput("self_eval"));
252  $this->node_object->setStatus((int) $this->form->getInput("status"));
253  $this->node_object->update();
254  }
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 32 of file class.ilSkillCategoryGUI.php.

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

◆ $help

ilHelpGUI ilSkillCategoryGUI::$help
protected

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

Referenced by setTabs().

◆ $lng

ilLanguage ilSkillCategoryGUI::$lng
protected

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

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

◆ $tabs

ilTabsGUI ilSkillCategoryGUI::$tabs
protected

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

Referenced by executeCommand(), and setTabs().

◆ $tpl

ilGlobalTemplateInterface ilSkillCategoryGUI::$tpl
protected

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

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


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