ILIAS  release_7 Revision v7.30-3-g800a261c036
ilBasicSkillTemplateGUI Class Reference

Basic skill template GUI class. More...

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

Public Member Functions

 __construct ($a_node_id=0, $a_tref_id=0)
 Constructor. More...
 
 getType ()
 Get Node Type. More...
 
 initForm ($a_mode="edit")
 Init form. More...
 
 setLevelHead ()
 Set header for level. More...
 
 setTabs ($a_tab="")
 Set header for skill. More...
 
 saveItem ()
 Save item. More...
 
 afterSave ()
 After saving. More...
 
 edit ()
 Edit skill. More...
 
 showUsage ()
 Show skill usage. More...
 
 showObjects ()
 Show assigned objects. More...
 
- Public Member Functions inherited from ilBasicSkillGUI
 __construct ($a_node_id=0)
 Constructor. More...
 
 getType ()
 Get Node Type. More...
 
 executeCommand ()
 Execute command. More...
 
 showProperties ()
 Show properties. More...
 
 saveItem ()
 Save item. More...
 
 afterSave ()
 After saving. More...
 
 updateItem ()
 Update item. More...
 
 edit ()
 Edit skill. More...
 
 initForm ($a_mode="edit")
 Init form. More...
 
 editProperties ()
 Edit properties. More...
 
 addLevel ()
 Add new level. More...
 
 editLevel ()
 Edit level. More...
 
 saveLevel ()
 Save level form. More...
 
 updateLevel ()
 Update level form. More...
 
 initLevelForm ($a_mode="edit")
 Init level form. More...
 
 getLevelValues ()
 Get current values for level from. More...
 
 updateLevelOrder ()
 Update level order. More...
 
 confirmLevelDeletion ()
 Confirm level deletion. More...
 
 deleteLevel ()
 Delete levels. More...
 
 setLevelHead ()
 Set header for level. More...
 
 setTabs ($a_tab="levels")
 Set header for skill. More...
 
 editLevelTrigger ()
 Edit level trigger. More...
 
 selectLevelTrigger ()
 Select skill level trigger. More...
 
 saveLevelTrigger ()
 Save level trigger. More...
 
 removeLevelTrigger ()
 Remove trigger. More...
 
 redirectToParent ($a_tmp_mode=false)
 Redirect to parent (identified by current obj_id) More...
 
 showLevelResources ()
 Show level resources. More...
 
 addLevelResource ()
 Add level resource. More...
 
 saveLevelResource ()
 Save level resource. More...
 
 confirmLevelResourcesRemoval ()
 Confirm level resources removal. More...
 
 removeLevelResources ()
 Remove level resource. More...
 
 saveResourceSettings ()
 Save resource settings. More...
 
- Public Member Functions inherited from ilSkillTreeNodeGUI
 __construct ($a_node_id=0)
 constructor More...
 
 isInUse ()
 Is in use? More...
 
 checkPermissionBool ($a_perm)
 Check permission pool. More...
 
 setParentGUI ($a_parentgui)
 Set Parent GUI class. More...
 
 getParentGUI ()
 Get Parent GUI class (ilObjSCORM2004LearningModuleGUI). More...
 
 readNodeObject ($a_node_id)
 Get node object instance. More...
 
 saveAllTitles ()
 Save Titles. More...
 
 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 ()
 cancel delete More...
 
 confirmedDelete ()
 confirmed delete More...
 
 setLocator ()
 Set Locator Items. More...
 
 setSkillNodeDescription ()
 Set skill node description. More...
 
 create ()
 Create skill tree node. More...
 
 addStatusInput (ilPropertyFormGUI $a_form)
 Add status input. More...
 
 editProperties ()
 Edit properties form. More...
 
 getPropertyValues ()
 Get property values for edit form. More...
 
 save ()
 Save skill tree node. More...
 
 afterSave ()
 After saving. More...
 
 update ()
 Update skill tree node. More...
 
 afterUpdate ()
 After update. More...
 
 initForm ($a_mode="edit")
 Init form. More...
 
 cancelSave ()
 Cancel saving. More...
 
 redirectToParent ($a_tmp_mode=false)
 Redirect to parent (identified by current obj_id) More...
 
 saveOrder ()
 Save order. More...
 
 insertBasicSkillClip ()
 Insert basic skills from clipboard. More...
 
 insertSkillCategoryClip ()
 Insert skill categories from clipboard. More...
 
 insertTemplateReferenceClip ()
 Insert skill template references from clipboard. More...
 
 insertSkillTemplateClip ()
 Insert skill template from clipboard. More...
 
 insertTemplateCategoryClip ()
 Insert skill template category from clipboard. More...
 
 setTitleIcon ()
 Set title icon. More...
 
 addUsageTab ($a_tabs)
 Add usage tab. More...
 
 showUsage ()
 Show skill usage. More...
 
 addObjectsTab ($a_tabs)
 
 showObjects ()
 Show assigned objects. More...
 
 exportSelectedNodes ()
 Export seleced nodes. More...
 

Protected Attributes

 $ctrl
 
 $lng
 
 $tabs
 
 $tpl
 
 $help
 
 $toolbar
 
- Protected Attributes inherited from ilBasicSkillGUI
 $ctrl
 
 $tpl
 
 $tabs
 
 $help
 
 $toolbar
 
 $lng
 
 $tree
 
 $tref_id = 0
 
 $base_skill_id
 
- Protected Attributes inherited from ilSkillTreeNodeGUI
 $ctrl
 
 $lng
 
 $locator
 
 $tpl
 
 $user
 

Additional Inherited Members

- Data Fields inherited from ilSkillTreeNodeGUI
 $node_object
 
 $in_use = false
 
 $use_checked = false
 
 $access
 
 $ref_id
 

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

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

Constructor & Destructor Documentation

◆ __construct()

ilBasicSkillTemplateGUI::__construct (   $a_node_id = 0,
  $a_tref_id = 0 
)

Constructor.

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

48 {
49 global $DIC;
50
51 $this->ctrl = $DIC->ctrl();
52 $this->lng = $DIC->language();
53 $this->tabs = $DIC->tabs();
54 $this->tpl = $DIC["tpl"];
55 $this->help = $DIC["ilHelp"];
56 $this->toolbar = $DIC->toolbar();
57 $ilCtrl = $DIC->ctrl();
58
59 $this->tref_id = $a_tref_id;
60
61 $ilCtrl->saveParameter($this, array("obj_id", "level_id"));
62
63 parent::__construct($a_node_id);
64 }
global $DIC
Definition: goto.php:24
help()
Definition: help.php:2
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), and help().

+ Here is the call graph for this function:

Member Function Documentation

◆ afterSave()

ilBasicSkillTemplateGUI::afterSave ( )

After saving.

Reimplemented from ilBasicSkillGUI.

Reimplemented in ilSkillTemplateReferenceGUI.

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

291 {
292 $ilCtrl = $this->ctrl;
293
294 $ilCtrl->setParameterByClass(
295 "ilbasicskilltemplategui",
296 "obj_id",
297 $this->node_object->getId()
298 );
299 $ilCtrl->redirectByClass("ilbasicskilltemplategui", "edit");
300 }

References $ctrl.

◆ edit()

ilBasicSkillTemplateGUI::edit ( )

Edit skill.

Parameters

return

Reimplemented from ilBasicSkillGUI.

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

309 {
311 $ilToolbar = $this->toolbar;
313 $ilCtrl = $this->ctrl;
314
315 $this->setTabs("levels");
316
317 if ($this->isInUse()) {
318 ilUtil::sendInfo($lng->txt("skmg_skill_in_use"));
319 } else {
320 if ($this->checkPermissionBool("write")) {
321 if ($this->tref_id == 0) {
322 $ilToolbar->addButton(
323 $lng->txt("skmg_add_level"),
324 $ilCtrl->getLinkTarget($this, "addLevel")
325 );
326 }
327 }
328 }
329
330 $table = new ilSkillLevelTableGUI((int) $_GET["obj_id"], $this, "edit", $this->tref_id, $this->isInUse());
331 $tpl->setContent($table->getHTML());
332 }
$_GET["client_id"]
setTabs($a_tab="")
Set header for skill.
checkPermissionBool($a_perm)
Check permission pool.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References $_GET, $ctrl, $lng, $toolbar, $tpl, ilSkillTreeNodeGUI\checkPermissionBool(), ilSkillTreeNodeGUI\isInUse(), ilUtil\sendInfo(), and setTabs().

+ Here is the call graph for this function:

◆ getType()

ilBasicSkillTemplateGUI::getType ( )

Get Node Type.

Reimplemented from ilBasicSkillGUI.

Reimplemented in ilSkillTemplateReferenceGUI.

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

70 {
71 return "sktp";
72 }

◆ initForm()

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

Init form.

Parameters
string$a_modeedit mode

Reimplemented from ilBasicSkillGUI.

Reimplemented in ilSkillTemplateReferenceGUI.

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

80 {
82 $ilCtrl = $this->ctrl;
83
84 $this->form = new ilPropertyFormGUI();
85
86 // title
87 $ti = new ilTextInputGUI($lng->txt("title"), "title");
88 $ti->setMaxLength(200);
89 $ti->setSize(50);
90 $ti->setRequired(true);
91 $this->form->addItem($ti);
92
93 // description
94 $ta = new ilTextAreaInputGUI($lng->txt("description"), "description");
95 $ta->setRows(5);
96 $this->form->addItem($ta);
97
98 // order nr
99 $ni = new ilNumberInputGUI($lng->txt("skmg_order_nr"), "order_nr");
100 $ni->setInfo($lng->txt("skmg_order_nr_info"));
101 $ni->setMaxLength(6);
102 $ni->setSize(6);
103 $ni->setRequired(true);
104 if ($a_mode == "create") {
105 $tree = new ilSkillTree();
106 $max = $tree->getMaxOrderNr((int) $_GET["obj_id"], true);
107 $ni->setValue($max + 10);
108 }
109 $this->form->addItem($ni);
110
111 // save and cancel commands
112 if ($this->checkPermissionBool("write")) {
113 if ($a_mode == "create") {
114 $this->form->addCommandButton("save", $lng->txt("save"));
115 $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
116 $this->form->setTitle($lng->txt("skmg_create_skll"));
117 } else {
118 $this->form->addCommandButton("update", $lng->txt("save"));
119 $this->form->setTitle($lng->txt("skmg_edit_skll"));
120 }
121 }
122
123 $ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
124 $this->form->setFormAction($ilCtrl->getFormAction($this));
125 }
This class represents a number property in a property form.
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.

References $_GET, $ctrl, $lng, ilBasicSkillGUI\$tree, and ilSkillTreeNodeGUI\checkPermissionBool().

+ Here is the call graph for this function:

◆ saveItem()

ilBasicSkillTemplateGUI::saveItem ( )

Save item.

Reimplemented from ilBasicSkillGUI.

Reimplemented in ilSkillTemplateReferenceGUI.

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

273 {
274 if (!$this->checkPermissionBool("write")) {
275 return;
276 }
277
278 $it = new ilBasicSkillTemplate();
279 $it->setTitle($this->form->getInput("title"));
280 $it->setDescription($this->form->getInput("description"));
281 $it->setOrderNr($this->form->getInput("order_nr"));
282 $it->create();
283 ilSkillTreeNode::putInTree($it, (int) $_GET["obj_id"], IL_LAST_NODE);
284 $this->node_object = $it;
285 }
const IL_LAST_NODE
Definition: class.ilTree.php:4
static putInTree($a_obj, $a_parent_id="", $a_target_node_id="")
Put this object into the skill tree.

References $_GET, ilSkillTreeNodeGUI\checkPermissionBool(), IL_LAST_NODE, and ilSkillTreeNode\putInTree().

+ Here is the call graph for this function:

◆ setLevelHead()

ilBasicSkillTemplateGUI::setLevelHead ( )

Set header for level.

Reimplemented from ilBasicSkillGUI.

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

131 {
132 $ilTabs = $this->tabs;
133 $ilCtrl = $this->ctrl;
136 $ilHelp = $this->help;
137
138 // tabs
139 $ilTabs->clearTargets();
140 $ilHelp->setScreenIdComponent("skmg_lev");
141 $ilTabs->setBackTarget(
142 $lng->txt("skmg_skill_levels"),
143 $ilCtrl->getLinkTarget($this, "edit")
144 );
145
146 if ($_GET["level_id"] > 0) {
147 if ($this->tref_id == 0) {
148 $ilTabs->addTab(
149 "level_settings",
150 $lng->txt("settings"),
151 $ilCtrl->getLinkTarget($this, "editLevel")
152 );
153 } else {
154 $ilTabs->addTab(
155 "level_resources",
156 $lng->txt("skmg_resources"),
157 $ilCtrl->getLinkTarget($this, "showLevelResources")
158 );
159 }
160
161 /* $ilTabs->addTab("level_trigger",
162 $lng->txt("skmg_trigger"),
163 $ilCtrl->getLinkTarget($this, "editLevelTrigger"));
164
165 $ilTabs->addTab("level_certificate",
166 $lng->txt("certificate"),
167 $ilCtrl->getLinkTargetByClass("ilcertificategui", "certificateEditor"));*/
168 }
169
170 // title
171 if ($_GET["level_id"] > 0) {
172 $tpl->setTitle($lng->txt("skmg_skill_level") . ": " .
173 ilBasicSkill::lookupLevelTitle((int) $_GET["level_id"]));
174 } else {
175 $tpl->setTitle($lng->txt("skmg_skill_level"));
176 }
177
178 $tree = new ilSkillTree();
179 $path = $tree->getPathFull($this->node_object->getId());
180 $desc = "";
181 foreach ($path as $p) {
182 if (in_array($p["type"], array("scat", "skll"))) {
183 $desc .= $sep . $p["title"];
184 $sep = " > ";
185 }
186 }
187 $tpl->setDescription($desc);
188
189 $tpl->setTitleIcon(
191 0,
192 "sktp",
193 "",
194 false
195 )
196 );
197 }
static lookupLevelTitle(int $a_id)
static getIconPath($a_obj_id, $a_type, $a_size="", $a_status=0)
Get icon path.

References $_GET, $ctrl, $help, $lng, $tabs, $tpl, ilBasicSkillGUI\$tree, ilSkillTreeNode\getIconPath(), and ilBasicSkill\lookupLevelTitle().

+ Here is the call graph for this function:

◆ setTabs()

ilBasicSkillTemplateGUI::setTabs (   $a_tab = "")

Set header for skill.

Parameters

return

Reimplemented from ilBasicSkillGUI.

Reimplemented in ilSkillTemplateReferenceGUI.

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

206 {
207 $ilTabs = $this->tabs;
208 $ilCtrl = $this->ctrl;
211 $ilHelp = $this->help;
212
213 $ilTabs->clearTargets();
214 $ilHelp->setScreenIdComponent("skmg_sktp");
215
216 if ($this->tref_id == 0) {
217 $ilTabs->setBackTarget(
218 $lng->txt("skmg_skill_templates"),
219 $ilCtrl->getLinkTargetByClass("ilobjskillmanagementgui", "editSkillTemplates")
220 );
221 }
222
223 if (is_object($this->node_object)) {
224 if ($this->tref_id == 0) {
225 $tpl->setTitle($lng->txt("skmg_skill_template") . ": " .
226 $this->node_object->getTitle());
227 } else {
228 $tpl->setTitle(
229 $this->node_object->getTitle()
230 );
231 }
232
233 // levels
234 $ilTabs->addTab(
235 "levels",
236 $lng->txt("skmg_skill_levels"),
237 $ilCtrl->getLinkTarget($this, 'edit')
238 );
239
240 // properties
241 if ($this->tref_id == 0) {
242 $ilTabs->addTab(
243 "properties",
244 $lng->txt("settings"),
245 $ilCtrl->getLinkTarget($this, 'editProperties')
246 );
247 }
248
249 // if ($this->tref_id > 0)
250 // {
251 // usage
252 $this->addUsageTab($ilTabs);
253 // }
254
255 // assigned objects
256 $this->addObjectsTab($ilTabs);
257
258 $ilTabs->activateTab($a_tab);
259
260 parent::setTitleIcon();
261
263 } else {
264 $tpl->setTitle($lng->txt("skmg_skill"));
265 $tpl->setDescription("");
266 }
267 }
setSkillNodeDescription()
Set skill node description.
addUsageTab($a_tabs)
Add usage tab.

References $ctrl, $help, $lng, $tabs, $tpl, ilSkillTreeNodeGUI\addObjectsTab(), ilSkillTreeNodeGUI\addUsageTab(), and ilSkillTreeNodeGUI\setSkillNodeDescription().

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

Show assigned objects.

Reimplemented from ilSkillTreeNodeGUI.

Reimplemented in ilSkillTemplateReferenceGUI.

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

367 {
369
370 // (a) referenced skill template in main tree
371 if ($this->tref_id > 0) {
372 return parent::showObjects();
373 }
374
375 // (b) skill template in templates view
376
377 $this->setTabs("objects");
378
379 $usage_info = new ilSkillUsage();
380 $objects = $usage_info->getAssignedObjectsForSkillTemplate($this->base_skill_id);
381
382 $tab = new ilSkillAssignedObjectsTableGUI($this, "showObjects", $objects);
383
384 $tpl->setContent($tab->getHTML());
385 }
TableGUI class for assigned objects of skills.

References $tpl, and setTabs().

+ Here is the call graph for this function:

◆ showUsage()

ilBasicSkillTemplateGUI::showUsage ( )

Show skill usage.

Reimplemented from ilSkillTreeNodeGUI.

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

338 {
340
341
342 // (a) referenced skill template in main tree
343 if ($this->tref_id > 0) {
344 return parent::showUsage();
345 }
346
347 // (b) skill template in templates view
348
349 $this->setTabs("usage");
350
351 $usage_info = new ilSkillUsage();
352 $usages = $usage_info->getAllUsagesOfTemplate($this->base_skill_id);
353
354 $html = "";
355 foreach ($usages as $k => $usage) {
356 $tab = new ilSkillUsageTableGUI($this, "showUsage", $k, $usage);
357 $html .= $tab->getHTML() . "<br/><br/>";
358 }
359
360 $tpl->setContent($html);
361 }
TableGUI class for skill usages.

References $tpl, and setTabs().

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

◆ $help

ilBasicSkillTemplateGUI::$help
protected

◆ $lng

◆ $tabs

ilBasicSkillTemplateGUI::$tabs
protected

◆ $toolbar

ilBasicSkillTemplateGUI::$toolbar
protected

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

Referenced by edit().

◆ $tpl


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