19 declare(strict_types=1);
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();
49 $ilCtrl->saveParameter($this,
"node_id");
67 $next_class = $ilCtrl->getNextClass($this);
68 $cmd = $ilCtrl->getCmd();
70 switch ($next_class) {
77 public function setTabs(
string $a_tab): void
85 $ilTabs->clearTargets();
92 $ilCtrl->getLinkTarget($this,
'listItems')
98 $lng->
txt(
"settings"),
99 $ilCtrl->getLinkTarget($this,
'editProperties')
105 $parent_node_id = $this->tree_repo->getParentNodeIdForNodeId($this->requested_node_id);
110 if ($parent_type ===
"scat") {
111 $ilCtrl->setParameter(
116 $ilTabs->setBackTarget(
118 $ilCtrl->getLinkTarget($this,
"listItems")
120 $ilCtrl->setParameter(
123 $this->requested_node_id
126 $ilCtrl->setParameterByClass(
129 $this->skill_tree_node_manager->getRootId()
131 $ilTabs->setBackTarget(
132 $lng->
txt(
"skmg_skills"),
133 $ilCtrl->getLinkTargetByClass(
"ilskillrootgui",
"listSkills")
135 $ilCtrl->setParameterByClass(
138 $this->requested_node_id
142 parent::setTitleIcon();
144 $lng->
txt(
"scat") .
": " . $this->node_object->getTitle()
148 $ilTabs->activateTab($a_tab);
156 parent::editProperties();
168 public function initForm(
string $a_mode =
"edit"): void
177 $ti->setMaxLength(200);
179 $ti->setRequired(
true);
180 $this->
form->addItem($ti);
185 $this->
form->addItem($ta);
192 $cb->setInfo($lng->
txt(
"skmg_selectable_info"));
193 $this->
form->addItem($cb);
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"));
202 $this->
form->addCommandButton(
"update", $lng->
txt(
"save"));
203 $this->
form->setTitle($lng->
txt(
"skmg_edit_scat"));
206 foreach ($this->
form->getItems() as $item) {
207 $item->setDisabled(
true);
211 $ilCtrl->setParameter($this,
"node_id", $this->requested_node_id);
212 $this->
form->setFormAction($ilCtrl->getFormAction($this));
217 if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
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"));
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);
245 if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
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();
262 $this->tpl->setOnScreenMessage(
'info', $lng->
txt(
"skmg_skill_in_use"));
265 if ($this->tree_access_manager->hasManageCompetencesPermission()) {
266 self::addCreationButtons();
273 $this->requested_node_id,
284 $ilCtrl = $DIC->ctrl();
285 $lng = $DIC->language();
286 $ilToolbar = $DIC->toolbar();
287 $ilUser = $DIC->user();
293 $ilCtrl->setParameterByClass(
298 $ilToolbar->addButton(
299 $lng->
txt(
"skmg_create_skll"),
300 $ilCtrl->getLinkTargetByClass(
"ilbasicskillgui",
"create")
304 $ilCtrl->setParameterByClass(
305 "ilskillcategorygui",
309 $ilToolbar->addButton(
310 $lng->
txt(
"skmg_create_skill_category"),
311 $ilCtrl->getLinkTargetByClass(
"ilskillcategorygui",
"create")
315 $ilCtrl->setParameterByClass(
316 "ilskilltemplatereferencegui",
320 $ilToolbar->addButton(
321 $lng->
txt(
"skmg_create_skill_template_reference"),
322 $ilCtrl->getLinkTargetByClass(
"ilskilltemplatereferencegui",
"create")
327 if ($ilUser->clipboardHasObjectsOfType(
"skll")) {
328 $ilToolbar->addSeparator();
330 $ilToolbar->addButton(
331 $lng->
txt(
"skmg_insert_basic_skill_from_clip"),
332 $ilCtrl->getLinkTargetByClass(
"ilskillcategorygui",
"insertBasicSkillClip")
337 if ($ilUser->clipboardHasObjectsOfType(
"scat")) {
339 $ilToolbar->addSeparator();
342 $ilToolbar->addButton(
343 $lng->
txt(
"skmg_insert_skill_category_from_clip"),
344 $ilCtrl->getLinkTargetByClass(
"ilskillcategorygui",
"insertSkillCategoryClip")
349 if ($ilUser->clipboardHasObjectsOfType(
"sktr")) {
351 $ilToolbar->addSeparator();
354 $ilToolbar->addButton(
355 $lng->
txt(
"skmg_insert_skill_template_reference_from_clip"),
356 $ilCtrl->getLinkTargetByClass(
"ilskillcategorygui",
"insertTemplateReferenceClip")
361 $ilToolbar->addButton(
362 $lng->
txt(
"skmg_import_skills"),
363 $ilCtrl->getLinkTargetByClass(
"ilskillrootgui",
"showImportForm")
378 $ilCtrl->setParameterByClass(
"ilskillrootgui",
"node_id", $this->requested_node_id);
379 $ilCtrl->redirectByClass(
"ilskillrootgui",
"listSkills");
383 parent::redirectToParent();
Skill category GUI class.
static addCreationButtons()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
setSkillNodeDescription()
addUsageTab(ilTabsGUI $a_tabs)
static _lookupTitle(int $a_obj_id, int $a_tref_id=0)
setContent(string $a_html)
Sets content for standard template.
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
ilGlobalTemplateInterface $tpl
static _lookupType(int $a_obj_id)
Basic GUI class for skill tree nodes.
__construct(Node\SkillTreeNodeManager $node_manager, int $a_node_id=0)
setScreenIdComponent(string $a_comp)
initForm(string $a_mode="edit")
redirectToParent(bool $a_tmp_mode=false)
Redirect to parent (identified by current node_id)
SkillAdminGUIRequest $admin_gui_request
form( $class_path, string $cmd, string $submit_caption="")
__construct(Container $dic, ilPlugin $plugin)
This class represents a text area property in a property form.
getValues()
Get current values for from.
addStatusInput(ilPropertyFormGUI $a_form)