ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilBasicSkillTemplateGUI Class Reference

Basic skill template GUI class. More...

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

Public Member Functions

 __construct (Node\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 (Node\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 ()
 
 removeLevelResources ()
 
 saveResourcesAsSuggested ()
 
 saveResourcesAsNotSuggested ()
 
 saveResourcesAsTrigger ()
 
 saveResourcesAsNoTrigger ()
 
- 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 ()
 

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
 
Data Factory $df
 
ServerRequestInterface $request
 
ArrayBasedRequestWrapper $query
 
Resource SkillResourcesManager $resource_manager
 
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 = []
 
string $requested_table_action = ""
 
array $requested_table_rep_ref_ids = []
 
- 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

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 29 of file class.ilBasicSkillTemplateGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

39 {
40 global $DIC;
41
42 $this->ctrl = $DIC->ctrl();
43 $this->lng = $DIC->language();
44 $this->tabs = $DIC->tabs();
45 $this->tpl = $DIC["tpl"];
46 $this->help = $DIC["ilHelp"];
47 $this->toolbar = $DIC->toolbar();
48 $ilCtrl = $DIC->ctrl();
49
50 $this->tref_id = $a_tref_id;
51
52 $ilCtrl->saveParameter($this, array("node_id", "level_id"));
53
54 parent::__construct($node_manager, $a_node_id);
55 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

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 253 of file class.ilBasicSkillTemplateGUI.php.

253 : void
254 {
255 $ilCtrl = $this->ctrl;
256
257 if (!$this->tree_access_manager->hasManageCompetenceTemplatesPermission()) {
258 return;
259 }
260
261 $ilCtrl->setParameterByClass(
262 "ilbasicskilltemplategui",
263 "node_id",
264 $this->node_object->getId()
265 );
266 $ilCtrl->redirectByClass("ilbasicskilltemplategui", "edit");
267 }
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 269 of file class.ilBasicSkillTemplateGUI.php.

269 : void
270 {
272 $ilToolbar = $this->toolbar;
274 $ilCtrl = $this->ctrl;
275
276 $this->setTabs("levels");
277
278 if ($this->isInUse()) {
279 $this->tpl->setOnScreenMessage('info', $lng->txt("skmg_skill_in_use"));
280 } elseif ($this->tree_access_manager->hasManageCompetenceTemplatesPermission()) {
281 if ($this->tref_id == 0) {
282 $ilToolbar->addButton(
283 $lng->txt("skmg_add_level"),
284 $ilCtrl->getLinkTarget($this, "addLevel")
285 );
286 }
287 }
288
289 $table = new ilSkillLevelTableGUI(
290 $this->requested_node_id,
291 $this,
292 "edit",
293 $this->tref_id,
294 $this->isInUse(),
295 $this->tree_access_manager->hasManageCompetenceTemplatesPermission()
296 );
297 $tpl->setContent($table->getHTML());
298 }
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.

References $ctrl, $lng, $toolbar, $tpl, ilSkillTreeNodeGUI\isInUse(), ILIAS\UICore\GlobalTemplate\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 57 of file class.ilBasicSkillTemplateGUI.php.

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

◆ initForm()

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

Reimplemented from ilBasicSkillGUI.

Reimplemented in ilSkillTemplateReferenceGUI.

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

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

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 351 of file class.ilBasicSkillTemplateGUI.php.

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

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 239 of file class.ilBasicSkillTemplateGUI.php.

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

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

References $ctrl, $help, $lng, $tabs, $tpl, ilSkillTreeNode\getIconPath(), ilBasicSkill\lookupLevelTitle(), ILIAS\UICore\GlobalTemplate\setDescription(), ilHelpGUI\setScreenIdComponent(), ILIAS\UICore\GlobalTemplate\setTitle(), ILIAS\UICore\GlobalTemplate\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 154 of file class.ilBasicSkillTemplateGUI.php.

154 : void
155 {
156 $ilTabs = $this->tabs;
157 $ilCtrl = $this->ctrl;
160 $ilHelp = $this->help;
161
162 $ilTabs->clearTargets();
163 $ilHelp->setScreenIdComponent("skmg_sktp");
164
165 $parent_node_id = $this->tree_repo->getParentNodeIdForNodeId($this->requested_node_id);
166 $parent_title = ilSkillTreeNode::_lookupTitle($parent_node_id);
167 $parent_type = ilSkillTreeNode::_lookupType($parent_node_id);
168
169 if ($this->tref_id == 0) {
170 if ($parent_type === "sctp") {
171 $ilCtrl->setParameterByClass(
172 "ilskilltemplatecategorygui",
173 "node_id",
174 $parent_node_id
175 );
176 $ilTabs->setBackTarget(
177 $parent_title,
178 $ilCtrl->getLinkTargetByClass("ilskilltemplatecategorygui", "listItems")
179 );
180 $ilCtrl->setParameterByClass(
181 "ilskilltemplatecategorygui",
182 "node_id",
183 ""
184 );
185 } else {
186 $ilTabs->setBackTarget(
187 $lng->txt("skmg_skill_templates"),
188 $ilCtrl->getLinkTargetByClass("ilobjskilltreegui", "editSkillTemplates")
189 );
190 }
191 }
192
193 if (is_object($this->node_object)) {
194 if ($this->tref_id == 0) {
195 $tpl->setTitle($lng->txt("skmg_skill_template") . ": " .
196 $this->node_object->getTitle());
197 } else {
198 $tpl->setTitle(
199 $this->node_object->getTitle()
200 );
201 }
202
203 // levels
204 $ilTabs->addTab(
205 "levels",
206 $lng->txt("skmg_skill_levels"),
207 $ilCtrl->getLinkTarget($this, 'edit')
208 );
209
210 // properties
211 if ($this->tref_id == 0) {
212 $ilTabs->addTab(
213 "properties",
214 $lng->txt("settings"),
215 $ilCtrl->getLinkTarget($this, 'editProperties')
216 );
217 }
218
219 // if ($this->tref_id > 0)
220 // {
221 // usage
222 $this->addUsageTab($ilTabs);
223 // }
224
225 // assigned objects
226 $this->addObjectsTab($ilTabs);
227
228 $ilTabs->activateTab($a_tab);
229
230 parent::setTitleIcon();
231
233 } else {
234 $tpl->setTitle($lng->txt("skmg_skill"));
235 $tpl->setDescription("");
236 }
237 }
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(), ILIAS\UICore\GlobalTemplate\setDescription(), ilHelpGUI\setScreenIdComponent(), ilSkillTreeNodeGUI\setSkillNodeDescription(), ILIAS\UICore\GlobalTemplate\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 $objects = $this->usage_manager->getAssignedObjectsForSkillTemplate($this->base_skill_id);
341
342 $table = $this->table_manager->getAssignedObjectsTable(
343 $this,
344 $objects,
345 $this->base_skill_id
346 )->getComponent();
347
348 $tpl->setContent($this->ui_ren->render($table));
349 }

References $tpl, ILIAS\UICore\GlobalTemplate\setContent(), and setTabs().

+ Here is the call graph for this function:

◆ showUsage()

ilBasicSkillTemplateGUI::showUsage ( )

Reimplemented from ilSkillTreeNodeGUI.

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

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

References $tpl, ILIAS\UICore\GlobalTemplate\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 36 of file class.ilBasicSkillTemplateGUI.php.

Referenced by edit().

◆ $tpl


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