3 declare(strict_types=1);
44 $this->
ctrl = $DIC->ctrl();
45 $this->tpl = $DIC[
"tpl"];
46 $this->
tabs = $DIC->tabs();
47 $this->
lng = $DIC->language();
48 $this->
help = $DIC[
"ilHelp"];
49 $ilCtrl = $DIC->ctrl();
51 $ilCtrl->saveParameter($this,
"node_id");
52 $this->tref_id = $a_tref_id;
70 $next_class = $ilCtrl->getNextClass($this);
71 $cmd = $ilCtrl->getCmd();
73 switch ($next_class) {
80 public function setTabs(
string $a_tab): void
88 $ilTabs->clearTargets();
95 $ilCtrl->getLinkTarget($this,
'listItems')
100 if ($this->tref_id == 0) {
103 $lng->
txt(
"settings"),
104 $ilCtrl->getLinkTarget($this,
'editProperties')
111 $parent_node_id = $this->tree_repo->getParentNodeIdForNodeId($this->requested_node_id);
116 if ($this->tref_id == 0) {
117 if ($parent_type ===
"sctp") {
118 $ilCtrl->setParameter(
123 $ilTabs->setBackTarget(
125 $ilCtrl->getLinkTarget($this,
"listItems")
127 $ilCtrl->setParameter(
130 $this->requested_node_id
133 $ilCtrl->setParameterByClass(
136 $this->skill_tree_node_manager->getRootId()
138 $ilTabs->setBackTarget(
139 $lng->
txt(
"skmg_skill_templates"),
140 $ilCtrl->getLinkTargetByClass(
"ilskillrootgui",
"listTemplates")
142 $ilCtrl->setParameterByClass(
145 $this->requested_node_id
150 parent::setTitleIcon();
152 $lng->
txt(
"skmg_sctp") .
": " . $this->node_object->getTitle()
156 $ilTabs->activateTab($a_tab);
159 public function initForm(
string $a_mode =
"edit"): void
168 $ti->setMaxLength(200);
170 $ti->setRequired(
true);
171 $this->
form->addItem($ti);
176 $this->
form->addItem($ta);
179 if ($this->tree_access_manager->hasManageCompetenceTemplatesPermission()) {
180 if ($a_mode ==
"create") {
181 $this->
form->addCommandButton(
"save", $lng->
txt(
"save"));
182 $this->
form->addCommandButton(
"cancelSave", $lng->
txt(
"cancel"));
183 $this->
form->setTitle($lng->
txt(
"skmg_create_" . $this->getType()));
185 $this->
form->addCommandButton(
"update", $lng->
txt(
"save"));
186 $this->
form->setTitle($lng->
txt(
"skmg_edit_" . $this->getType()));
189 foreach ($this->
form->getItems() as $item) {
190 $item->setDisabled(
true);
194 $ilCtrl->setParameter($this,
"node_id", $this->requested_node_id);
195 $this->
form->setFormAction($ilCtrl->getFormAction($this));
204 $this->tpl->setOnScreenMessage(
'info', $lng->
txt(
"skmg_skill_in_use"));
207 if ($this->tree_access_manager->hasManageCompetenceTemplatesPermission()) {
208 if ($this->tref_id == 0) {
209 self::addCreationButtons();
218 $this->requested_node_id,
230 $ilCtrl = $DIC->ctrl();
231 $lng = $DIC->language();
232 $ilToolbar = $DIC->toolbar();
233 $ilUser = $DIC->user();
238 $ilCtrl->setParameterByClass(
"ilobjskillmanagementgui",
"tmpmode", 1);
240 $ilCtrl->setParameterByClass(
241 "ilbasicskilltemplategui",
245 $ilToolbar->addButton(
246 $lng->
txt(
"skmg_create_skill_template"),
247 $ilCtrl->getLinkTargetByClass(
"ilbasicskilltemplategui",
"create")
249 $ilCtrl->setParameterByClass(
250 "ilskilltemplatecategorygui",
254 $ilToolbar->addButton(
255 $lng->
txt(
"skmg_create_skill_template_category"),
256 $ilCtrl->getLinkTargetByClass(
"ilskilltemplatecategorygui",
"create")
261 if ($ilUser->clipboardHasObjectsOfType(
"sktp")) {
262 $ilToolbar->addSeparator();
264 $ilToolbar->addButton(
265 $lng->
txt(
"skmg_insert_skill_template_from_clip"),
266 $ilCtrl->getLinkTargetByClass(
"ilskilltemplatecategorygui",
"insertSkillTemplateClip")
271 if ($ilUser->clipboardHasObjectsOfType(
"sctp")) {
273 $ilToolbar->addSeparator();
276 $ilToolbar->addButton(
277 $lng->
txt(
"skmg_insert_template_category_from_clip"),
278 $ilCtrl->getLinkTargetByClass(
"ilskilltemplatecategorygui",
"insertTemplateCategoryClip")
286 parent::editProperties();
291 if (!$this->tree_access_manager->hasManageCompetenceTemplatesPermission()) {
296 $it->setTitle($this->
form->getInput(
"title"));
297 $it->setDescription($this->
form->getInput(
"description"));
304 if (!$this->tree_access_manager->hasManageCompetenceTemplatesPermission()) {
308 $this->node_object->setTitle($this->
form->getInput(
"title"));
309 $this->node_object->setDescription($this->
form->getInput(
"description"));
310 $this->node_object->setOrderNr((
int) $this->
form->getInput(
"order_nr"));
311 $this->node_object->setSelfEvaluation((
bool) $this->
form->getInput(
"self_eval"));
312 $this->node_object->update();
325 if ($this->tref_id > 0) {
334 $usages = $this->usage_manager->getAllUsagesOfTemplate($this->requested_node_id);
337 foreach ($usages as $k => $usage) {
338 $usages_ui = $this->skill_ui_service->getUsagesUI($k, $usage);
339 $html .= $usages_ui->render() .
"<br/><br/>";
347 parent::redirectToParent(
true);
redirectToParent(bool $a_tmp_mode=false)
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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupTitle(int $a_obj_id, int $a_tref_id=0)
initForm(string $a_mode="edit")
static _lookupType(int $a_obj_id)
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
Basic GUI class for skill tree nodes.
__construct(Node\SkillTreeNodeManager $node_manager, int $a_node_id=0, int $a_tref_id=0)
setScreenIdComponent(string $a_comp)
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
SkillAdminGUIRequest $admin_gui_request
Skill template category GUI class.
form( $class_path, string $cmd, string $submit_caption="")
static addCreationButtons()
__construct(Container $dic, ilPlugin $plugin)
This class represents a text area property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...