ILIAS  release_8 Revision v8.24
ilBasicSkillTemplateGUI Class Reference

Basic skill template GUI class. More...

+ Inheritance diagram for ilBasicSkillTemplateGUI:
+ Collaboration diagram for ilBasicSkillTemplateGUI:

Public Member Functions

 __construct (Tree\SkillTreeNodeManager $node_manager, int $a_node_id=0, int $a_tref_id=0)
 
 getType ()
 
 initForm (string $a_mode="edit")
 
 setLevelHead ()
 
 setTabs (string $a_tab="levels")
 
 saveItem ()
 
 afterSave ()
 
 edit ()
 
 showUsage ()
 
 showObjects ()
 
 redirectToParent (bool $a_tmp_mode=false)
 Redirect to parent (identified by current node_id) More...
 
- Public Member Functions inherited from ilBasicSkillGUI
 __construct (Tree\SkillTreeNodeManager $node_manager, int $a_node_id=0)
 
 getType ()
 
 executeCommand ()
 
 showProperties ()
 
 saveItem ()
 
 afterSave ()
 
 updateItem ()
 
 edit ()
 
 initForm (string $a_mode="edit")
 
 editProperties ()
 
 addLevel ()
 
 editLevel ()
 
 saveLevel ()
 
 updateLevel ()
 
 initLevelForm (string $a_mode="edit")
 
 updateLevelOrder ()
 
 confirmLevelDeletion ()
 
 deleteLevel ()
 
 setLevelHead ()
 
 setTabs (string $a_tab="levels")
 
 redirectToParent (bool $a_tmp_mode=false)
 Redirect to parent (identified by current node_id) More...
 
 showLevelResources ()
 
 addLevelResource ()
 
 saveLevelResource ()
 
 confirmLevelResourcesRemoval ()
 
 removeLevelResources ()
 
 saveResourceSettings ()
 
- 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 ()
 

Protected Attributes

ilCtrl $ctrl
 
ilLanguage $lng
 
ilTabsGUI $tabs
 
ilGlobalTemplateInterface $tpl
 
ilHelpGUI $help
 
ilToolbarGUI $toolbar
 
- Protected Attributes inherited from ilBasicSkillGUI
ilCtrl $ctrl
 
ilGlobalTemplateInterface $tpl
 
ilTabsGUI $tabs
 
ilHelpGUI $help
 
ilToolbarGUI $toolbar
 
ilLanguage $lng
 
Factory $ui_fac
 
Renderer $ui_ren
 
ServerRequestInterface $request
 
int $tref_id = 0
 
int $requested_level_id = 0
 
int $requested_root_id = 0
 
array $requested_level_order = []
 
array $requested_level_ids = []
 
array $requested_resource_ids = []
 
array $requested_suggested = []
 
array $requested_trigger = []
 
- 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

Basic skill template GUI class.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e @ilCtrl_isCalledBy ilBasicSkillTemplateGUI: ilObjSkillManagementGUI, ilObjSkillTreeGUI

Definition at line 28 of file class.ilBasicSkillTemplateGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

38 {
39 global $DIC;
40
41 $this->ctrl = $DIC->ctrl();
42 $this->lng = $DIC->language();
43 $this->tabs = $DIC->tabs();
44 $this->tpl = $DIC["tpl"];
45 $this->help = $DIC["ilHelp"];
46 $this->toolbar = $DIC->toolbar();
47 $ilCtrl = $DIC->ctrl();
48
49 $this->tref_id = $a_tref_id;
50
51 $ilCtrl->saveParameter($this, array("node_id", "level_id"));
52
53 parent::__construct($node_manager, $a_node_id);
54 }
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(), ILIAS\Repository\tabs(), and ILIAS\Repository\toolbar().

+ Here is the call graph for this function:

Member Function Documentation

◆ afterSave()

ilBasicSkillTemplateGUI::afterSave ( )

Reimplemented from ilBasicSkillGUI.

Reimplemented in ilSkillTemplateReferenceGUI.

Definition at line 252 of file class.ilBasicSkillTemplateGUI.php.

252 : void
253 {
254 $ilCtrl = $this->ctrl;
255
256 if (!$this->tree_access_manager->hasManageCompetenceTemplatesPermission()) {
257 return;
258 }
259
260 $ilCtrl->setParameterByClass(
261 "ilbasicskilltemplategui",
262 "node_id",
263 $this->node_object->getId()
264 );
265 $ilCtrl->redirectByClass("ilbasicskilltemplategui", "edit");
266 }
setParameterByClass(string $a_class, string $a_parameter, $a_value)
@inheritDoc

References $ctrl, and ilCtrl\setParameterByClass().

+ Here is the call graph for this function:

◆ edit()

ilBasicSkillTemplateGUI::edit ( )

Reimplemented from ilBasicSkillGUI.

Definition at line 268 of file class.ilBasicSkillTemplateGUI.php.

268 : void
269 {
271 $ilToolbar = $this->toolbar;
273 $ilCtrl = $this->ctrl;
274
275 $this->setTabs("levels");
276
277 if ($this->isInUse()) {
278 $this->tpl->setOnScreenMessage('info', $lng->txt("skmg_skill_in_use"));
279 } elseif ($this->tree_access_manager->hasManageCompetenceTemplatesPermission()) {
280 if ($this->tref_id == 0) {
281 $ilToolbar->addButton(
282 $lng->txt("skmg_add_level"),
283 $ilCtrl->getLinkTarget($this, "addLevel")
284 );
285 }
286 }
287
288 $table = new ilSkillLevelTableGUI(
289 $this->requested_node_id,
290 $this,
291 "edit",
292 $this->tref_id,
293 $this->isInUse(),
294 $this->tree_access_manager->hasManageCompetenceTemplatesPermission()
295 );
296 $tpl->setContent($table->getHTML());
297 }
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setContent(string $a_html)
Sets content for standard template.

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

+ Here is the call graph for this function:

◆ getType()

ilBasicSkillTemplateGUI::getType ( )

Reimplemented from ilBasicSkillGUI.

Reimplemented in ilSkillTemplateReferenceGUI.

Definition at line 56 of file class.ilBasicSkillTemplateGUI.php.

56 : string
57 {
58 return "sktp";
59 }

◆ initForm()

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

Reimplemented from ilBasicSkillGUI.

Reimplemented in ilSkillTemplateReferenceGUI.

Definition at line 61 of file class.ilBasicSkillTemplateGUI.php.

61 : void
62 {
64 $ilCtrl = $this->ctrl;
65
66 $this->form = new ilPropertyFormGUI();
67
68 // title
69 $ti = new ilTextInputGUI($lng->txt("title"), "title");
70 $ti->setMaxLength(200);
71 $ti->setSize(50);
72 $ti->setRequired(true);
73 $this->form->addItem($ti);
74
75 // description
76 $ta = new ilTextAreaInputGUI($lng->txt("description"), "description");
77 $ta->setRows(5);
78 $this->form->addItem($ta);
79
80 // save and cancel commands
81 if ($this->tree_access_manager->hasManageCompetenceTemplatesPermission()) {
82 if ($a_mode == "create") {
83 $this->form->addCommandButton("save", $lng->txt("save"));
84 $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
85 $this->form->setTitle($lng->txt("skmg_create_skll"));
86 } else {
87 $this->form->addCommandButton("update", $lng->txt("save"));
88 $this->form->setTitle($lng->txt("skmg_edit_skll"));
89 }
90 } else {
91 foreach ($this->form->getItems() as $item) {
92 $item->setDisabled(true);
93 }
94 }
95
96 $ilCtrl->setParameter($this, "node_id", $this->requested_node_id);
97 $this->form->setFormAction($ilCtrl->getFormAction($this));
98 }
This class represents a property form user interface.
This class represents a text area property in a property form.
This class represents a text property in a property form.
form( $class_path, string $cmd)

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

+ Here is the call graph for this function:

◆ redirectToParent()

ilBasicSkillTemplateGUI::redirectToParent ( bool  $a_tmp_mode = false)

Redirect to parent (identified by current node_id)

Reimplemented from ilBasicSkillGUI.

Reimplemented in ilSkillTemplateReferenceGUI.

Definition at line 348 of file class.ilBasicSkillTemplateGUI.php.

348 : void
349 {
350 $ilCtrl = $this->ctrl;
351
352 $ilCtrl->setParameterByClass("ilskillrootgui", "node_id", $this->requested_node_id);
353 $ilCtrl->redirectByClass("ilskillrootgui", "listTemplates");
354 }

References $ctrl, and ilCtrl\setParameterByClass().

+ Here is the call graph for this function:

◆ saveItem()

ilBasicSkillTemplateGUI::saveItem ( )

Reimplemented from ilBasicSkillGUI.

Reimplemented in ilSkillTemplateReferenceGUI.

Definition at line 238 of file class.ilBasicSkillTemplateGUI.php.

238 : void
239 {
240 if (!$this->tree_access_manager->hasManageCompetenceTemplatesPermission()) {
241 return;
242 }
243
244 $it = new ilBasicSkillTemplate();
245 $it->setTitle($this->form->getInput("title"));
246 $it->setDescription($this->form->getInput("description"));
247 $it->create();
248 $this->skill_tree_node_manager->putIntoTree($it, $this->requested_node_id, ilTree::POS_LAST_NODE);
249 $this->node_object = $it;
250 }
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:

◆ setLevelHead()

ilBasicSkillTemplateGUI::setLevelHead ( )

Reimplemented from ilBasicSkillGUI.

Definition at line 100 of file class.ilBasicSkillTemplateGUI.php.

100 : void
101 {
102 $ilTabs = $this->tabs;
103 $ilCtrl = $this->ctrl;
106 $ilHelp = $this->help;
107
108 // tabs
109 $ilTabs->clearTargets();
110 $ilHelp->setScreenIdComponent("skmg_lev");
111 $ilTabs->setBackTarget(
112 $lng->txt("skmg_skill_levels"),
113 $ilCtrl->getLinkTarget($this, "edit")
114 );
115
116 if ($this->requested_level_id > 0) {
117 if ($this->tref_id == 0) {
118 $ilTabs->addTab(
119 "level_settings",
120 $lng->txt("settings"),
121 $ilCtrl->getLinkTarget($this, "editLevel")
122 );
123 } else {
124 $ilTabs->addTab(
125 "level_resources",
126 $lng->txt("skmg_resources"),
127 $ilCtrl->getLinkTarget($this, "showLevelResources")
128 );
129 }
130 }
131
132 // title
133 if ($this->requested_level_id > 0) {
134 $tpl->setTitle($lng->txt("skmg_skill_level") . ": " .
135 ilBasicSkill::lookupLevelTitle($this->requested_level_id));
136 } else {
137 $tpl->setTitle($lng->txt("skmg_skill_level"));
138 }
139
140 $desc = $this->skill_tree_node_manager->getWrittenPath($this->node_object->getId());
141 $tpl->setDescription($desc);
142
145 0,
146 "sktp",
147 "",
148 false
149 )
150 );
151 }
static lookupLevelTitle(int $a_id)
setScreenIdComponent(string $a_comp)
static getIconPath(int $a_obj_id, string $a_type, string $a_size="", int $a_status=0)
setDescription(string $a_descr)
Sets description below title in standard template.
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.

References $ctrl, $help, $lng, $tabs, $tpl, ilSkillTreeNode\getIconPath(), ilBasicSkill\lookupLevelTitle(), ilGlobalTemplateInterface\setDescription(), ilHelpGUI\setScreenIdComponent(), ilGlobalTemplateInterface\setTitle(), ilGlobalTemplateInterface\setTitleIcon(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ setTabs()

ilBasicSkillTemplateGUI::setTabs ( string  $a_tab = "levels")

Reimplemented from ilBasicSkillGUI.

Definition at line 153 of file class.ilBasicSkillTemplateGUI.php.

153 : void
154 {
155 $ilTabs = $this->tabs;
156 $ilCtrl = $this->ctrl;
159 $ilHelp = $this->help;
160
161 $ilTabs->clearTargets();
162 $ilHelp->setScreenIdComponent("skmg_sktp");
163
164 $parent_node_id = $this->tree_repo->getParentNodeIdForNodeId($this->requested_node_id);
165 $parent_title = ilSkillTreeNode::_lookupTitle($parent_node_id);
166 $parent_type = ilSkillTreeNode::_lookupType($parent_node_id);
167
168 if ($this->tref_id == 0) {
169 if ($parent_type === "sctp") {
170 $ilCtrl->setParameterByClass(
171 "ilskilltemplatecategorygui",
172 "node_id",
173 $parent_node_id
174 );
175 $ilTabs->setBackTarget(
176 $parent_title,
177 $ilCtrl->getLinkTargetByClass("ilskilltemplatecategorygui", "listItems")
178 );
179 $ilCtrl->setParameterByClass(
180 "ilskilltemplatecategorygui",
181 "node_id",
182 ""
183 );
184 } else {
185 $ilTabs->setBackTarget(
186 $lng->txt("skmg_skill_templates"),
187 $ilCtrl->getLinkTargetByClass("ilobjskilltreegui", "editSkillTemplates")
188 );
189 }
190 }
191
192 if (is_object($this->node_object)) {
193 if ($this->tref_id == 0) {
194 $tpl->setTitle($lng->txt("skmg_skill_template") . ": " .
195 $this->node_object->getTitle());
196 } else {
197 $tpl->setTitle(
198 $this->node_object->getTitle()
199 );
200 }
201
202 // levels
203 $ilTabs->addTab(
204 "levels",
205 $lng->txt("skmg_skill_levels"),
206 $ilCtrl->getLinkTarget($this, 'edit')
207 );
208
209 // properties
210 if ($this->tref_id == 0) {
211 $ilTabs->addTab(
212 "properties",
213 $lng->txt("settings"),
214 $ilCtrl->getLinkTarget($this, 'editProperties')
215 );
216 }
217
218 // if ($this->tref_id > 0)
219 // {
220 // usage
221 $this->addUsageTab($ilTabs);
222 // }
223
224 // assigned objects
225 $this->addObjectsTab($ilTabs);
226
227 $ilTabs->activateTab($a_tab);
228
229 parent::setTitleIcon();
230
232 } else {
233 $tpl->setTitle($lng->txt("skmg_skill"));
234 $tpl->setDescription("");
235 }
236 }
addUsageTab(ilTabsGUI $a_tabs)
addObjectsTab(ilTabsGUI $a_tabs)
static _lookupTitle(int $a_obj_id, int $a_tref_id=0)
static _lookupType(int $a_obj_id)

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

Referenced by edit(), showObjects(), and showUsage().

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

◆ showObjects()

ilBasicSkillTemplateGUI::showObjects ( )

Reimplemented from ilSkillTreeNodeGUI.

Reimplemented in ilSkillTemplateReferenceGUI.

Definition at line 326 of file class.ilBasicSkillTemplateGUI.php.

326 : void
327 {
329
330 // (a) referenced skill template in main tree
331 if ($this->tref_id > 0) {
332 parent::showObjects();
333 return;
334 }
335
336 // (b) skill template in templates view
337
338 $this->setTabs("objects");
339
340 $usage_info = new ilSkillUsage();
341 $objects = $usage_info->getAssignedObjectsForSkillTemplate($this->base_skill_id);
342
343 $tab = new ilSkillAssignedObjectsTableGUI($this, "showObjects", $objects);
344
345 $tpl->setContent($tab->getHTML());
346 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $tpl, ilGlobalTemplateInterface\setContent(), and setTabs().

+ Here is the call graph for this function:

◆ showUsage()

ilBasicSkillTemplateGUI::showUsage ( )

Reimplemented from ilSkillTreeNodeGUI.

Definition at line 299 of file class.ilBasicSkillTemplateGUI.php.

299 : void
300 {
302
303
304 // (a) referenced skill template in main tree
305 if ($this->tref_id > 0) {
306 parent::showUsage();
307 return;
308 }
309
310 // (b) skill template in templates view
311
312 $this->setTabs("usage");
313
314 $usage_info = new ilSkillUsage();
315 $usages = $usage_info->getAllUsagesOfTemplate($this->base_skill_id);
316
317 $html = "";
318 foreach ($usages as $k => $usage) {
319 $tab = new ilSkillUsageTableGUI($this, "showUsage", $k, $usage);
320 $html .= $tab->getHTML() . "<br/><br/>";
321 }
322
323 $tpl->setContent($html);
324 }
TableGUI class for skill usages.

References $tpl, ilGlobalTemplateInterface\setContent(), and setTabs().

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

◆ $help

ilHelpGUI ilBasicSkillTemplateGUI::$help
protected

◆ $lng

◆ $tabs

ilTabsGUI ilBasicSkillTemplateGUI::$tabs
protected

◆ $toolbar

ilToolbarGUI ilBasicSkillTemplateGUI::$toolbar
protected

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

Referenced by edit().

◆ $tpl


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