ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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)
 
- 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 ()
 
 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
 
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
 
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()

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

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

References $DIC, ILIAS\MetaData\Repository\Validation\Data\__construct(), ILIAS\Repository\ctrl(), ILIAS\Repository\help(), ILIAS\Repository\lng(), ILIAS\Repository\tabs(), and ILIAS\Repository\toolbar().

40  {
41  global $DIC;
42 
43  $this->ctrl = $DIC->ctrl();
44  $this->lng = $DIC->language();
45  $this->tabs = $DIC->tabs();
46  $this->tpl = $DIC["tpl"];
47  $this->help = $DIC["ilHelp"];
48  $this->toolbar = $DIC->toolbar();
49  $ilCtrl = $DIC->ctrl();
50 
51  $this->tref_id = $a_tref_id;
52 
53  $ilCtrl->saveParameter($this, array("node_id", "level_id"));
54 
55  parent::__construct($node_manager, $a_node_id);
56  }
global $DIC
Definition: feed.php:28
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ afterSave()

ilBasicSkillTemplateGUI::afterSave ( )

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

References $ctrl, and ilCtrl\setParameterByClass().

254  : void
255  {
256  $ilCtrl = $this->ctrl;
257 
258  if (!$this->tree_access_manager->hasManageCompetenceTemplatesPermission()) {
259  return;
260  }
261 
262  $ilCtrl->setParameterByClass(
263  "ilbasicskilltemplategui",
264  "node_id",
265  $this->node_object->getId()
266  );
267  $ilCtrl->redirectByClass("ilbasicskilltemplategui", "edit");
268  }
setParameterByClass(string $a_class, string $a_parameter, $a_value)
+ Here is the call graph for this function:

◆ edit()

ilBasicSkillTemplateGUI::edit ( )

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

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

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

◆ getType()

ilBasicSkillTemplateGUI::getType ( )

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

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

◆ initForm()

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

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

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

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

◆ redirectToParent()

ilBasicSkillTemplateGUI::redirectToParent ( bool  $a_tmp_mode = false)

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

References $ctrl, and ilCtrl\setParameterByClass().

352  : void
353  {
354  $ilCtrl = $this->ctrl;
355 
356  $ilCtrl->setParameterByClass("ilskillrootgui", "node_id", $this->requested_node_id);
357  $ilCtrl->redirectByClass("ilskillrootgui", "listTemplates");
358  }
setParameterByClass(string $a_class, string $a_parameter, $a_value)
+ Here is the call graph for this function:

◆ saveItem()

ilBasicSkillTemplateGUI::saveItem ( )

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

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

240  : void
241  {
242  if (!$this->tree_access_manager->hasManageCompetenceTemplatesPermission()) {
243  return;
244  }
245 
246  $it = new ilBasicSkillTemplate();
247  $it->setTitle($this->form->getInput("title"));
248  $it->setDescription($this->form->getInput("description"));
249  $it->create();
250  $this->skill_tree_node_manager->putIntoTree($it, $this->requested_node_id, ilTree::POS_LAST_NODE);
251  $this->node_object = $it;
252  }
const POS_LAST_NODE
form( $class_path, string $cmd, string $submit_caption="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ setLevelHead()

ilBasicSkillTemplateGUI::setLevelHead ( )

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

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

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

◆ setTabs()

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

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

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().

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

◆ showObjects()

ilBasicSkillTemplateGUI::showObjects ( )

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

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

327  : void
328  {
329  $tpl = $this->tpl;
330 
331  // (a) referenced skill template in main tree
332  if ($this->tref_id > 0) {
333  parent::showObjects();
334  return;
335  }
336 
337  // (b) skill template in templates view
338 
339  $this->setTabs("objects");
340 
341  $objects = $this->usage_manager->getAssignedObjectsForSkillTemplate($this->base_skill_id);
342 
343  $table = $this->table_manager->getAssignedObjectsTable(
344  $this,
345  $objects,
346  $this->base_skill_id
347  )->getComponent();
348 
349  $tpl->setContent($this->ui_ren->render($table));
350  }
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ showUsage()

ilBasicSkillTemplateGUI::showUsage ( )

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

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

301  : void
302  {
303  $tpl = $this->tpl;
304 
305 
306  // (a) referenced skill template in main tree
307  if ($this->tref_id > 0) {
308  parent::showUsage();
309  return;
310  }
311 
312  // (b) skill template in templates view
313 
314  $this->setTabs("usage");
315 
316  $usages = $this->usage_manager->getAllUsagesOfTemplate($this->base_skill_id);
317 
318  $html = "";
319  foreach ($usages as $k => $usage) {
320  $usages_ui = $this->skill_ui_service->getUsagesUI($k, $usage);
321  $html .= $usages_ui->render() . "<br/><br/>";
322  }
323 
324  $tpl->setContent($html);
325  }
setContent(string $a_html)
Sets content for standard template.
+ 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 37 of file class.ilBasicSkillTemplateGUI.php.

Referenced by edit().

◆ $tpl


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