ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilSkillTreeNodeGUI Class Reference

Basic GUI class for skill tree nodes. More...

+ Inheritance diagram for ilSkillTreeNodeGUI:
+ Collaboration diagram for ilSkillTreeNodeGUI:

Public Member Functions

 ilSkillTreeNodeGUI ($a_node_id=0)
 constructor 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...
 

Data Fields

 $node_object
 

Detailed Description

Basic GUI class for skill tree nodes.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 15 of file class.ilSkillTreeNodeGUI.php.

Member Function Documentation

◆ addStatusInput()

ilSkillTreeNodeGUI::addStatusInput ( ilPropertyFormGUI  $a_form)

Add status input.

Parameters
ilPropertyFormGUI$a_formform

Definition at line 286 of file class.ilSkillTreeNodeGUI.php.

287 {
288 global $lng;
289
290 // status
291 $radg = new ilRadioGroupInputGUI($lng->txt("skmg_status"), "status");
292 foreach (ilSkillTreeNode::getAllStatus() as $k => $op)
293 {
294 $op = new ilRadioOption($op, $k, ilSkillTreeNode::getStatusInfo($k));
295 $radg->addOption($op);
296 }
297 $a_form->addItem($radg);
298 }
addItem($a_item)
Add Item (Property, SectionHeader).
This class represents a property in a property form.
This class represents an option in a radio group.
static getStatusInfo($a_status)
Get status info.
static getAllStatus()
Get all status.
global $lng
Definition: privfeed.php:40

References $lng, ilPropertyFormGUI\addItem(), ilSkillTreeNode\getAllStatus(), and ilSkillTreeNode\getStatusInfo().

Referenced by ilBasicSkillGUI\initForm(), ilSkillCategoryGUI\initForm(), and ilSkillTemplateReferenceGUI\initForm().

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

◆ addUsageTab()

ilSkillTreeNodeGUI::addUsageTab (   $a_tabs)

Add usage tab.

Parameters

return

Definition at line 591 of file class.ilSkillTreeNodeGUI.php.

592 {
593 global $lng, $ilCtrl;
594
595 $a_tabs->addTab("usage",
596 $lng->txt("skmg_usage"),
597 $ilCtrl->getLinkTarget($this, "showUsage"));
598 }
global $ilCtrl
Definition: ilias.php:18

References $ilCtrl, and $lng.

Referenced by ilBasicSkillTemplateGUI\setTabs(), ilSkillCategoryGUI\setTabs(), ilSkillTemplateCategoryGUI\setTabs(), ilSkillTemplateReferenceGUI\setTabs(), and ilBasicSkillGUI\setTabs().

+ Here is the caller graph for this function:

◆ afterSave()

ilSkillTreeNodeGUI::afterSave ( )

After saving.

Reimplemented in ilBasicSkillGUI, ilBasicSkillTemplateGUI, ilSkillTemplateCategoryGUI, and ilSkillTemplateReferenceGUI.

Definition at line 354 of file class.ilSkillTreeNodeGUI.php.

355 {
356 $this->redirectToParent();
357 }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)

References redirectToParent().

Referenced by save().

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

◆ afterUpdate()

ilSkillTreeNodeGUI::afterUpdate ( )

After update.

Definition at line 385 of file class.ilSkillTreeNodeGUI.php.

386 {
387 global $ilCtrl;
388
389 $ilCtrl->redirect($this, "editProperties");
390 }

References $ilCtrl.

Referenced by update().

+ Here is the caller graph for this function:

◆ cancelDelete()

ilSkillTreeNodeGUI::cancelDelete ( )

cancel delete

Reimplemented in ilSkillRootGUI.

Definition at line 178 of file class.ilSkillTreeNodeGUI.php.

179 {
180 global $ilCtrl;
181
182 $this->redirectToParent();
183 }

References $ilCtrl, and redirectToParent().

+ Here is the call graph for this function:

◆ cancelSave()

ilSkillTreeNodeGUI::cancelSave ( )

Cancel saving.

Parameters

return

Definition at line 443 of file class.ilSkillTreeNodeGUI.php.

444 {
445 $this->redirectToParent();
446 }

References redirectToParent().

+ Here is the call graph for this function:

◆ confirmedDelete()

ilSkillTreeNodeGUI::confirmedDelete ( )

confirmed delete

Definition at line 188 of file class.ilSkillTreeNodeGUI.php.

189 {
190 global $ilCtrl;
191
192 $this->getParentGUI()->confirmedDelete(false);
193 ilSkillTreeNode::saveChildsOrder((int) $_GET["obj_id"], array(),
194 $_GET["tmpmode"]);
195
196 $this->redirectToParent();
197 }
$_GET["client_id"]
getParentGUI()
Get Parent GUI class (ilObjSCORM2004LearningModuleGUI).
static saveChildsOrder($a_par_id, $a_childs_order, $a_templates=false)
Save childs order.

References $_GET, $ilCtrl, getParentGUI(), redirectToParent(), and ilSkillTreeNode\saveChildsOrder().

+ Here is the call graph for this function:

◆ copyItems()

ilSkillTreeNodeGUI::copyItems ( )

Copy items to clipboard.

Definition at line 136 of file class.ilSkillTreeNodeGUI.php.

137 {
138 global $ilCtrl, $lng;
139
140 if (!is_array($_POST["id"]) || count($_POST["id"]) == 0)
141 {
142 $this->redirectToParent();
143 }
144
145 include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
146
147 $items = ilUtil::stripSlashesArray($_POST["id"]);
148 $todel = array(); // delete IDs < 0 (needed for non-js editing)
149 foreach($items as $k => $item)
150 {
151 if ($item < 0)
152 {
153 $todel[] = $k;
154 }
155 }
156 foreach($todel as $k)
157 {
158 unset($items[$k]);
159 }
161 {
162 ilUtil::sendInfo($lng->txt("skmg_insert_please_choose_one_type_only"), true);
163 $this->redirectToParent();
164 }
166
167 // @todo: move this to a service since it can be used here, too
168 include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
170 ilUtil::sendInfo($lng->txt("skmg_selected_items_have_been_copied"), true);
171
172 $this->redirectToParent();
173 }
static uniqueTypesCheck($a_items)
Check for unique types.
static clipboardCopy($a_tree_id, $a_ids)
Copy a set of skills/skill categories into the clipboard.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static stripSlashesArray($a_arr, $a_strip_html=true, $a_allow="")
Strip slashes from array.
$_POST['username']
Definition: cron.php:12

References $_POST, $ilCtrl, $lng, ilSkillTreeNode\clipboardCopy(), redirectToParent(), ilUtil\sendInfo(), ilEditClipboard\setAction(), ilUtil\stripSlashesArray(), and ilSkillTreeNode\uniqueTypesCheck().

+ Here is the call graph for this function:

◆ create()

ilSkillTreeNodeGUI::create ( )

Create skill tree node.

Definition at line 273 of file class.ilSkillTreeNodeGUI.php.

274 {
275 global $tpl;
276
277 $this->initForm("create");
278 $tpl->setContent($this->form->getHTML());
279 }
global $tpl
Definition: ilias.php:8
initForm($a_mode="edit")
Init form.

References $tpl, and initForm().

+ Here is the call graph for this function:

◆ cutItems()

ilSkillTreeNodeGUI::cutItems ( )

Copy items to clipboard, then cut them from the current tree.

Definition at line 89 of file class.ilSkillTreeNodeGUI.php.

90 {
91 global $ilCtrl, $lng;
92
93 include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
94
95 if (!is_array($_POST["id"]) || count($_POST["id"]) == 0)
96 {
97 $this->redirectToParent();
98 }
99
100 $items = ilUtil::stripSlashesArray($_POST["id"]);
101 $todel = array(); // delete IDs < 0 (needed for non-js editing)
102 foreach($items as $k => $item)
103 {
104 if ($item < 0)
105 {
106 $todel[] = $k;
107 }
108 }
109 foreach($todel as $k)
110 {
111 unset($items[$k]);
112 }
113
115 {
116 ilUtil::sendInfo($lng->txt("skmg_insert_please_choose_one_type_only"), true);
117 $this->redirectToParent();
118 }
119
121
122 include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
124
125 ilUtil::sendInfo($lng->txt("skmg_selected_items_have_been_cut"), true);
126
127 ilSkillTreeNode::saveChildsOrder((int) $_GET["obj_id"], array(),
128 $_GET["tmpmode"]);
129
130 $this->redirectToParent();
131 }
clipboardCut($a_tree_id, $a_ids)
Cut and copy a set of skills/skill categories into the clipboard.

References $_GET, $_POST, $ilCtrl, $lng, ilSkillTreeNode\clipboardCut(), redirectToParent(), ilSkillTreeNode\saveChildsOrder(), ilUtil\sendInfo(), ilEditClipboard\setAction(), ilUtil\stripSlashesArray(), and ilSkillTreeNode\uniqueTypesCheck().

+ Here is the call graph for this function:

◆ deleteNodes()

ilSkillTreeNodeGUI::deleteNodes ( )

Delete nodes in the hierarchy.

Definition at line 78 of file class.ilSkillTreeNodeGUI.php.

79 {
80 global $ilCtrl;
81
82 $ilCtrl->setParameter($this, "backcmd", $_GET["backcmd"]);
83 $this->getParentGUI()->deleteNodes($this);
84 }

References $_GET, $ilCtrl, and getParentGUI().

+ Here is the call graph for this function:

◆ editProperties()

ilSkillTreeNodeGUI::editProperties ( )

Edit properties form.

Reimplemented in ilBasicSkillGUI, ilSkillCategoryGUI, ilSkillTemplateCategoryGUI, and ilSkillTemplateReferenceGUI.

Definition at line 303 of file class.ilSkillTreeNodeGUI.php.

304 {
305 global $tpl;
306
307 $this->initForm("edit");
308 $this->getPropertyValues();
309 $tpl->setContent($this->form->getHTML());
310 }
getPropertyValues()
Get property values for edit form.

References $tpl, getPropertyValues(), and initForm().

+ Here is the call graph for this function:

◆ getParentGUI()

ilSkillTreeNodeGUI::getParentGUI ( )

Get Parent GUI class (ilObjSCORM2004LearningModuleGUI).

Returns
object Parent GUI class

Definition at line 50 of file class.ilSkillTreeNodeGUI.php.

51 {
52 return $this->parentgui;
53 }

Referenced by confirmedDelete(), deleteNodes(), ilSkillRootGUI\listSkills(), ilSkillRootGUI\listTemplates(), saveAllTitles(), and setLocator().

+ Here is the caller graph for this function:

◆ getPropertyValues()

ilSkillTreeNodeGUI::getPropertyValues ( )

Get property values for edit form.

Definition at line 315 of file class.ilSkillTreeNodeGUI.php.

316 {
317 $values = array();
318
319 $values["title"] = $this->node_object->getTitle();
320 $values["order_nr"] = $this->node_object->getOrderNr();
321 $values["self_eval"] = $this->node_object->getSelfEvaluation();
322 $values["status"] = $this->node_object->getStatus();
323
324 $this->form->setValuesByArray($values);
325 }

Referenced by editProperties().

+ Here is the caller graph for this function:

◆ ilSkillTreeNodeGUI()

ilSkillTreeNodeGUI::ilSkillTreeNodeGUI (   $a_node_id = 0)

constructor

Parameters
object$a_content_objnode object

Definition at line 24 of file class.ilSkillTreeNodeGUI.php.

25 {
26 $this->node_object = null;
27
28 if ($a_node_id > 0 &&
29 $this->getType() == ilSkillTreeNode::_lookupType($a_node_id))
30 {
31 $this->readNodeObject((int) $a_node_id);
32 }
33 }
readNodeObject($a_node_id)
Get node object instance.
static _lookupType($a_obj_id)
Lookup Type.

References ilSkillTreeNode\_lookupType(), and readNodeObject().

+ Here is the call graph for this function:

◆ initForm()

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

Init form.

Parameters
int$a_modeEdit Mode

Reimplemented in ilBasicSkillGUI, ilBasicSkillTemplateGUI, ilSkillCategoryGUI, and ilSkillTemplateReferenceGUI.

Definition at line 397 of file class.ilSkillTreeNodeGUI.php.

398 {
399 global $lng, $ilCtrl;
400
401 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
402 $this->form = new ilPropertyFormGUI();
403
404 // title
405 $ti = new ilTextInputGUI($lng->txt("title"), "title");
406 $ti->setMaxLength(200);
407 $ti->setSize(50);
408 $ti->setRequired(true);
409 $this->form->addItem($ti);
410
411 // order nr
412 $ni = new ilNumberInputGUI($lng->txt("skmg_order_nr"), "order_nr");
413 $ni->setMaxLength(6);
414 $ni->setSize(6);
415 $ni->setRequired(true);
416 $this->form->addItem($ni);
417
418 // save and cancel commands
419 if ($a_mode == "create")
420 {
421 $this->form->addCommandButton("save", $lng->txt("save"));
422 $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
423 $this->form->setTitle($lng->txt("skmg_create_".$this->getType()));
424 }
425 else
426 {
427 $this->form->addCommandButton("update", $lng->txt("save"));
428 $this->form->setTitle($lng->txt("skmg_edit_".$this->getType()));
429 }
430
431
432 $ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
433 $this->form->setFormAction($ilCtrl->getFormAction($this));
434
435 }
This class represents a number property in a property form.
This class represents a property form user interface.
This class represents a text property in a property form.

References $_GET, $ilCtrl, and $lng.

Referenced by create(), editProperties(), save(), and update().

+ Here is the caller graph for this function:

◆ insertBasicSkillClip()

ilSkillTreeNodeGUI::insertBasicSkillClip ( )

Insert basic skills from clipboard.

Definition at line 508 of file class.ilSkillTreeNodeGUI.php.

509 {
510 global $ilCtrl, $ilUser;
511
512 include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
513 $nodes = ilSkillTreeNode::insertItemsFromClip("skll", (int) $_GET["obj_id"]);
514 $this->redirectToParent();
515 }
static insertItemsFromClip($a_type, $a_obj_id)
Insert basic skills from clipboard.
global $ilUser
Definition: imgupload.php:15

References $_GET, $ilCtrl, $ilUser, ilSkillTreeNode\insertItemsFromClip(), and redirectToParent().

+ Here is the call graph for this function:

◆ insertSkillCategoryClip()

ilSkillTreeNodeGUI::insertSkillCategoryClip ( )

Insert skill categories from clipboard.

Definition at line 520 of file class.ilSkillTreeNodeGUI.php.

521 {
522 global $ilCtrl, $ilUser;
523
524 include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
525 $nodes = ilSkillTreeNode::insertItemsFromClip("scat", (int) $_GET["obj_id"]);
526 $this->redirectToParent();
527 }

References $_GET, $ilCtrl, $ilUser, ilSkillTreeNode\insertItemsFromClip(), and redirectToParent().

+ Here is the call graph for this function:

◆ insertSkillTemplateClip()

ilSkillTreeNodeGUI::insertSkillTemplateClip ( )

Insert skill template from clipboard.

Definition at line 544 of file class.ilSkillTreeNodeGUI.php.

545 {
546 global $ilCtrl, $ilUser;
547
548 include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
549 $nodes = ilSkillTreeNode::insertItemsFromClip("sktp", (int) $_GET["obj_id"]);
550 $this->redirectToParent();
551 }

References $_GET, $ilCtrl, $ilUser, ilSkillTreeNode\insertItemsFromClip(), and redirectToParent().

+ Here is the call graph for this function:

◆ insertTemplateCategoryClip()

ilSkillTreeNodeGUI::insertTemplateCategoryClip ( )

Insert skill template category from clipboard.

Definition at line 556 of file class.ilSkillTreeNodeGUI.php.

557 {
558 global $ilCtrl, $ilUser;
559
560 include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
561 $nodes = ilSkillTreeNode::insertItemsFromClip("sctp", (int) $_GET["obj_id"]);
562 $this->redirectToParent();
563 }

References $_GET, $ilCtrl, $ilUser, ilSkillTreeNode\insertItemsFromClip(), and redirectToParent().

+ Here is the call graph for this function:

◆ insertTemplateReferenceClip()

ilSkillTreeNodeGUI::insertTemplateReferenceClip ( )

Insert skill template references from clipboard.

Definition at line 532 of file class.ilSkillTreeNodeGUI.php.

533 {
534 global $ilCtrl, $ilUser;
535
536 include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
537 $nodes = ilSkillTreeNode::insertItemsFromClip("sktr", (int) $_GET["obj_id"]);
538 $this->redirectToParent();
539 }

References $_GET, $ilCtrl, $ilUser, ilSkillTreeNode\insertItemsFromClip(), and redirectToParent().

+ Here is the call graph for this function:

◆ readNodeObject()

ilSkillTreeNodeGUI::readNodeObject (   $a_node_id)

Get node object instance.

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

59 {
60 include_once("./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
61 $this->node_object = ilSkillTreeNodeFactory::getInstance($a_node_id);
62 }

References ilSkillTreeNodeFactory\getInstance().

Referenced by ilSkillTreeNodeGUI().

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

◆ redirectToParent()

ilSkillTreeNodeGUI::redirectToParent (   $a_tmp_mode = false)

Redirect to parent (identified by current obj_id)

Parameters

return

Definition at line 454 of file class.ilSkillTreeNodeGUI.php.

455 {
456 global $ilCtrl;
457
458 if ($_GET["tmpmode"])
459 {
460 $a_tmp_mode = true;
461 }
462
463 $t = ilSkillTreeNode::_lookupType((int) $_GET["obj_id"]);
464
465 switch ($t)
466 {
467 case "skrt":
468 $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id", (int) $_GET["obj_id"]);
469 if ($a_tmp_mode)
470 {
471 $ilCtrl->redirectByClass("ilskillrootgui", "listTemplates");
472 }
473 else
474 {
475 $ilCtrl->redirectByClass("ilskillrootgui", "listSkills");
476 }
477 break;
478
479 case "sctp":
480 $ilCtrl->setParameterByClass("ilskilltemplatecategorygui", "obj_id", (int) $_GET["obj_id"]);
481 $ilCtrl->redirectByClass("ilskilltemplatecategorygui", "listItems");
482 break;
483
484 case "scat":
485 $ilCtrl->setParameterByClass("ilskillcategorygui", "obj_id", (int) $_GET["obj_id"]);
486 $ilCtrl->redirectByClass("ilskillcategorygui", "listItems");
487 break;
488 }
489
490 }

References $_GET, $ilCtrl, $t, and ilSkillTreeNode\_lookupType().

Referenced by ilSkillTemplateCategoryGUI\afterSave(), afterSave(), cancelDelete(), cancelSave(), confirmedDelete(), copyItems(), cutItems(), insertBasicSkillClip(), insertSkillCategoryClip(), insertSkillTemplateClip(), insertTemplateCategoryClip(), insertTemplateReferenceClip(), and saveOrder().

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

◆ save()

ilSkillTreeNodeGUI::save ( )

Save skill tree node.

Definition at line 331 of file class.ilSkillTreeNodeGUI.php.

332 {
333 global $tpl, $lng, $ilCtrl;
334
335 $this->initForm("create");
336 if ($this->form->checkInput())
337 {
338 $this->saveItem();
339 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
340 ilSkillTreeNode::saveChildsOrder((int) $_GET["obj_id"], array(),
341 in_array($this->getType(), array("sktp", "sctp")));
342 $this->afterSave();
343 }
344 else
345 {
346 $this->form->setValuesByPost();
347 $tpl->setContent($this->form->getHtml());
348 }
349 }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.

References $_GET, $ilCtrl, $lng, $tpl, afterSave(), initForm(), ilSkillTreeNode\saveChildsOrder(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ saveAllTitles()

ilSkillTreeNodeGUI::saveAllTitles ( )

Save Titles.

Definition at line 67 of file class.ilSkillTreeNodeGUI.php.

68 {
69 global $ilCtrl;
70
71 $this->getParentGUI()->saveAllTitles(false);
72 $ilCtrl->redirect($this, "showOrganization");
73 }

References $ilCtrl, and getParentGUI().

+ Here is the call graph for this function:

◆ saveOrder()

ilSkillTreeNodeGUI::saveOrder ( )

Save order.

Definition at line 495 of file class.ilSkillTreeNodeGUI.php.

496 {
497 global $ilCtrl, $lng;
498
499 ilSkillTreeNode::saveChildsOrder((int) $_GET["obj_id"], $_POST["order"],
500 (int) $_GET["tmpmode"]);
501 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
502 $this->redirectToParent((int) $_GET["tmpmode"]);
503 }

References $_GET, $_POST, $ilCtrl, $lng, redirectToParent(), ilSkillTreeNode\saveChildsOrder(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ setLocator()

ilSkillTreeNodeGUI::setLocator ( )

Set Locator Items.

Definition at line 202 of file class.ilSkillTreeNodeGUI.php.

203 {
204 global $ilLocator, $tpl, $ilCtrl;
205
206 $ilLocator->addRepositoryItems($_GET["ref_id"]);
207 $this->getParentGUI()->addLocatorItems();
208
209 if ($_GET["obj_id"] > 0)
210 {
211 include_once("./Services/Skill/classes/class.ilSkillTree.php");
212 $tree = new ilSkillTree();
213 $path = $tree->getPathFull($_GET["obj_id"]);
214 for( $i = 1; $i < count($path); $i++)
215 {
216 switch($path[$i]["type"])
217 {
218 case "scat":
219 $ilCtrl->setParameterByClass("ilskillcategorygui", "obj_id",
220 $path[$i]["child"]);
221 $ilLocator->addItem($path[$i]["title"],
222 $ilCtrl->getLinkTargetByClass("ilskillmanagementgui",
223 "ilskillcategorygui"), "", 0, $path[$i]["type"],
224 ilUtil::getImagePath("icon_skmg.svg"));
225 break;
226
227 case "skll":
228 $ilCtrl->setParameterByClass("ilbasicskillgui", "obj_id",
229 $path[$i]["child"]);
230 $ilLocator->addItem($path[$i]["title"],
231 $ilCtrl->getLinkTargetByClass("ilskillmanagementgui",
232 "ilbasicskillgui"), "", 0, $path[$i]["type"],
233 ilUtil::getImagePath("icon_skmg.svg"));
234 break;
235
236 }
237 }
238 }
239 $ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
240
241 $tpl->setLocator();
242 }
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$path
Definition: index.php:22

References $_GET, $ilCtrl, $path, $tpl, ilUtil\getImagePath(), and getParentGUI().

Referenced by ilBasicSkillGUI\showProperties().

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

◆ setParentGUI()

ilSkillTreeNodeGUI::setParentGUI (   $a_parentgui)

Set Parent GUI class.

Parameters
object$a_parentguiParent GUI class

Definition at line 40 of file class.ilSkillTreeNodeGUI.php.

41 {
42 $this->parentgui = $a_parentgui;
43 }

◆ setSkillNodeDescription()

ilSkillTreeNodeGUI::setSkillNodeDescription ( )

Set skill node description.

Definition at line 247 of file class.ilSkillTreeNodeGUI.php.

248 {
249 global $tpl;
250
251 if (is_object($this->node_object))
252 {
253 include_once("./Services/Skill/classes/class.ilSkillTree.php");
254 $tree = new ilSkillTree();
255 $path = $this->node_object->skill_tree->getSkillTreePath($this->node_object->getId(),
256 $this->tref_id);
257 $desc = "";
258 foreach ($path as $p)
259 {
260 if (in_array($p["type"], array("scat", "skll", "sktr")))
261 {
262 $desc.= $sep.$p["title"];
263 $sep = " > ";
264 }
265 }
266 }
267 $tpl->setDescription($desc);
268 }

References $path, and $tpl.

Referenced by ilBasicSkillTemplateGUI\setTabs(), ilSkillCategoryGUI\setTabs(), ilSkillTemplateCategoryGUI\setTabs(), ilSkillTemplateReferenceGUI\setTabs(), and ilBasicSkillGUI\setTabs().

+ Here is the caller graph for this function:

◆ setTitleIcon()

ilSkillTreeNodeGUI::setTitleIcon ( )

Set title icon.

Definition at line 568 of file class.ilSkillTreeNodeGUI.php.

569 {
570 global $tpl;
571
572 $obj_id = (is_object($this->node_object))
573 ? $this->node_object->getId()
574 :0;
575 $tpl->setTitleIcon(
577 $obj_id, $this->getType(), "",
579 }
static getIconPath($a_obj_id, $a_type, $a_size="", $a_status=0)
Get icon path.
static _lookupStatus($a_obj_id)
Lookup Status.

References $tpl, ilSkillTreeNode\_lookupStatus(), ilSkillTreeNode\getIconPath(), and ilSkillTreeNode\STATUS_DRAFT.

+ Here is the call graph for this function:

◆ showUsage()

ilSkillTreeNodeGUI::showUsage ( )

Show skill usage.

Definition at line 604 of file class.ilSkillTreeNodeGUI.php.

605 {
606 global $tpl;
607
608 $this->setTabs("usage");
609
610 include_once("./Services/Skill/classes/class.ilSkillUsage.php");
611 $usage_info = new ilSkillUsage();
612 $base_skill_id = ($this->base_skill_id > 0)
613 ? $this->base_skill_id
614 : $this->node_object->getId();
615 $usages = $usage_info->getAllUsagesInfoOfSubtree($base_skill_id.":".$this->tref_id);
616
617 $html = "";
618 include_once("./Services/Skill/classes/class.ilSkillUsageTableGUI.php");
619 foreach ($usages as $k => $usage)
620 {
621 $tab = new ilSkillUsageTableGUI($this, "showUsage", $k, $usage);
622 $html.= $tab->getHTML()."<br/><br/>";
623 }
624
625 $tpl->setContent($html);
626 }
TableGUI class for skill usages.

References $tab, and $tpl.

◆ update()

ilSkillTreeNodeGUI::update ( )

Update skill tree node.

Definition at line 364 of file class.ilSkillTreeNodeGUI.php.

365 {
366 global $tpl, $lng, $ilCtrl;
367
368 $this->initForm("edit");
369 if ($this->form->checkInput())
370 {
371 $this->updateItem();
372 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
373 $this->afterUpdate();
374 }
375 else
376 {
377 $this->form->setValuesByPost();
378 $tpl->setContent($this->form->getHtml());
379 }
380 }

References $ilCtrl, $lng, $tpl, afterUpdate(), initForm(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

Field Documentation

◆ $node_object

ilSkillTreeNodeGUI::$node_object

Definition at line 17 of file class.ilSkillTreeNodeGUI.php.


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