ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilSkillTreeNodeGUI Class Reference

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

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

Public Member Functions

 __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...
 

Data Fields

 $node_object
 
 $in_use = false
 
 $use_checked = false
 
 $access
 
 $ref_id
 

Protected Attributes

 $ctrl
 
 $lng
 
 $locator
 
 $tpl
 
 $user
 

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

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

Constructor & Destructor Documentation

◆ __construct()

ilSkillTreeNodeGUI::__construct (   $a_node_id = 0)

constructor

Parameters
object$a_content_objnode object

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

References $_GET, $DIC, ilSkillTreeNode\_lookupType(), readNodeObject(), and user().

55  {
56  global $DIC;
57 
58  $this->ctrl = $DIC->ctrl();
59  $this->lng = $DIC->language();
60  $this->locator = $DIC["ilLocator"];
61  $this->tpl = $DIC["tpl"];
62  $this->user = $DIC->user();
63  $ilAccess = $DIC->access();
64  $this->tree = $DIC->repositoryTree();
65 
66  $this->node_object = null;
67  $this->access = $ilAccess;
68  $this->ref_id = (int) $_GET["ref_id"];
69 
70  if ($a_node_id > 0 &&
71  $this->getType() == ilSkillTreeNode::_lookupType($a_node_id)) {
72  $this->readNodeObject((int) $a_node_id);
73  }
74  }
readNodeObject($a_node_id)
Get node object instance.
$_GET["client_id"]
user()
Definition: user.php:4
static _lookupType($a_obj_id)
Lookup Type.
global $DIC
Definition: goto.php:24
+ Here is the call graph for this function:

Member Function Documentation

◆ addObjectsTab()

ilSkillTreeNodeGUI::addObjectsTab (   $a_tabs)
Parameters
$a_tabs

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

References $ctrl, and $lng.

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

733  {
734  $lng = $this->lng;
735  $ilCtrl = $this->ctrl;
736 
737  $a_tabs->addTab(
738  "objects",
739  $lng->txt("skmg_assigned_objects"),
740  $ilCtrl->getLinkTarget($this, "showObjects")
741  );
742  }
+ Here is the caller graph for this function:

◆ addStatusInput()

ilSkillTreeNodeGUI::addStatusInput ( ilPropertyFormGUI  $a_form)

Add status input.

Parameters
ilPropertyFormGUI$a_formform

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

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

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

375  {
376  $lng = $this->lng;
377 
378  // status
379  $radg = new ilRadioGroupInputGUI($lng->txt("skmg_status"), "status");
380  foreach (ilSkillTreeNode::getAllStatus() as $k => $op) {
381  $op = new ilRadioOption($op, $k, ilSkillTreeNode::getStatusInfo($k));
382  $radg->addOption($op);
383  }
384  $a_form->addItem($radg);
385  }
This class represents an option in a radio group.
static getAllStatus()
Get all status.
addItem($a_item)
Add Item (Property, SectionHeader).
This class represents a property in a property form.
static getStatusInfo($a_status)
Get status info.
+ 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

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

References $ctrl, and $lng.

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

693  {
694  $lng = $this->lng;
695  $ilCtrl = $this->ctrl;
696 
697  $a_tabs->addTab(
698  "usage",
699  $lng->txt("skmg_usage"),
700  $ilCtrl->getLinkTarget($this, "showUsage")
701  );
702  }
+ Here is the caller graph for this function:

◆ afterSave()

ilSkillTreeNodeGUI::afterSave ( )

After saving.

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

References redirectToParent().

Referenced by save().

454  {
455  $this->redirectToParent();
456  }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ afterUpdate()

ilSkillTreeNodeGUI::afterUpdate ( )

After update.

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

References $ctrl.

Referenced by update().

488  {
489  $ilCtrl = $this->ctrl;
490 
491  $ilCtrl->redirect($this, "editProperties");
492  }
+ Here is the caller graph for this function:

◆ cancelDelete()

ilSkillTreeNodeGUI::cancelDelete ( )

cancel delete

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

References $ctrl, and redirectToParent().

244  {
245  $ilCtrl = $this->ctrl;
246 
247  $this->redirectToParent();
248  }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
+ Here is the call graph for this function:

◆ cancelSave()

ilSkillTreeNodeGUI::cancelSave ( )

Cancel saving.

Parameters

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

References redirectToParent().

554  {
555  $this->redirectToParent();
556  }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
+ Here is the call graph for this function:

◆ checkPermissionBool()

◆ confirmedDelete()

ilSkillTreeNodeGUI::confirmedDelete ( )

confirmed delete

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

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

254  {
255  $ilCtrl = $this->ctrl;
256 
257  if (!$this->checkPermissionBool("write")) {
258  return;
259  }
260 
261  $this->getParentGUI()->confirmedDelete(false);
263  (int) $_GET["obj_id"],
264  array(),
265  $_GET["tmpmode"]
266  );
267 
268  $this->redirectToParent();
269  }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
$_GET["client_id"]
getParentGUI()
Get Parent GUI class (ilObjSCORM2004LearningModuleGUI).
checkPermissionBool($a_perm)
Check permission pool.
static saveChildsOrder($a_par_id, $a_childs_order, $a_templates=false)
Save childs order.
+ Here is the call graph for this function:

◆ copyItems()

ilSkillTreeNodeGUI::copyItems ( )

Copy items to clipboard.

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

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

209  {
210  $ilCtrl = $this->ctrl;
211  $lng = $this->lng;
212 
213  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0) {
214  $this->redirectToParent();
215  }
216 
217  $items = ilUtil::stripSlashesArray($_POST["id"]);
218  $todel = array(); // delete IDs < 0 (needed for non-js editing)
219  foreach ($items as $k => $item) {
220  if ($item < 0) {
221  $todel[] = $k;
222  }
223  }
224  foreach ($todel as $k) {
225  unset($items[$k]);
226  }
227  if (!ilSkillTreeNode::uniqueTypesCheck($items)) {
228  ilUtil::sendInfo($lng->txt("skmg_insert_please_choose_one_type_only"), true);
229  $this->redirectToParent();
230  }
232 
233  // @todo: move this to a service since it can be used here, too
235  ilUtil::sendInfo($lng->txt("skmg_selected_items_have_been_copied"), true);
236 
237  $this->redirectToParent();
238  }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
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 stripSlashesArray($a_arr, $a_strip_html=true, $a_allow="")
Strip slashes from array.
static setAction($a_action)
$_POST["username"]
+ Here is the call graph for this function:

◆ create()

ilSkillTreeNodeGUI::create ( )

Create skill tree node.

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

References $tpl, and initForm().

362  {
363  $tpl = $this->tpl;
364 
365  $this->initForm("create");
366  $tpl->setContent($this->form->getHTML());
367  }
initForm($a_mode="edit")
Init form.
+ 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 166 of file class.ilSkillTreeNodeGUI.php.

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

167  {
168  $lng = $this->lng;
169 
170  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0) {
171  $this->redirectToParent();
172  }
173 
174  $items = ilUtil::stripSlashesArray($_POST["id"]);
175  $todel = array(); // delete IDs < 0 (needed for non-js editing)
176  foreach ($items as $k => $item) {
177  if ($item < 0) {
178  $todel[] = $k;
179  }
180  }
181  foreach ($todel as $k) {
182  unset($items[$k]);
183  }
184 
185  if (!ilSkillTreeNode::uniqueTypesCheck($items)) {
186  ilUtil::sendInfo($lng->txt("skmg_insert_please_choose_one_type_only"), true);
187  $this->redirectToParent();
188  }
189 
191 
193 
194  ilUtil::sendInfo($lng->txt("skmg_selected_items_have_been_cut"), true);
195 
197  (int) $_GET["obj_id"],
198  array(),
199  $_GET["tmpmode"]
200  );
201 
202  $this->redirectToParent();
203  }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
static clipboardCut($a_tree_id, $a_ids)
Cut and copy a set of skills/skill categories into the clipboard.
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static uniqueTypesCheck($a_items)
Check for unique types.
static saveChildsOrder($a_par_id, $a_childs_order, $a_templates=false)
Save childs order.
static stripSlashesArray($a_arr, $a_strip_html=true, $a_allow="")
Strip slashes from array.
static setAction($a_action)
$_POST["username"]
+ Here is the call graph for this function:

◆ deleteNodes()

ilSkillTreeNodeGUI::deleteNodes ( )

Delete nodes in the hierarchy.

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

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

156  {
157  $ilCtrl = $this->ctrl;
158 
159  $ilCtrl->setParameter($this, "backcmd", $_GET["backcmd"]);
160  $this->getParentGUI()->deleteNodes($this);
161  }
$_GET["client_id"]
getParentGUI()
Get Parent GUI class (ilObjSCORM2004LearningModuleGUI).
+ Here is the call graph for this function:

◆ editProperties()

ilSkillTreeNodeGUI::editProperties ( )

Edit properties form.

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

References $lng, $tpl, getPropertyValues(), initForm(), isInUse(), and ilUtil\sendInfo().

391  {
392  $tpl = $this->tpl;
393  $lng = $this->lng;
394 
395  if ($this->isInUse()) {
396  ilUtil::sendInfo($lng->txt("skmg_skill_in_use"));
397  }
398 
399  $this->initForm("edit");
400  $this->getPropertyValues();
401  $tpl->setContent($this->form->getHTML());
402  }
getPropertyValues()
Get property values for edit form.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
initForm($a_mode="edit")
Init form.
+ Here is the call graph for this function:

◆ exportSelectedNodes()

ilSkillTreeNodeGUI::exportSelectedNodes ( )

Export seleced nodes.

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

References $_GET, $_POST, $ctrl, ilObject\_lookupObjId(), and redirectToParent().

768  {
769  $ilCtrl = $this->ctrl;
770 
771  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0) {
772  $this->redirectToParent();
773  }
774 
775  $exp = new ilExport();
776  $conf = $exp->getConfig("Services/Skill");
777  $conf->setSelectedNodes($_POST["id"]);
778  $exp->exportObject("skmg", ilObject::_lookupObjId((int) $_GET["ref_id"]));
779 
780  $ilCtrl->redirectByClass(array("iladministrationgui", "ilobjskillmanagementgui", "ilexportgui"), "");
781  }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
$_GET["client_id"]
static _lookupObjId($a_id)
$_POST["username"]
+ Here is the call graph for this function:

◆ getParentGUI()

ilSkillTreeNodeGUI::getParentGUI ( )

Get Parent GUI class (ilObjSCORM2004LearningModuleGUI).

Returns
object Parent GUI class

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

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

129  {
130  return $this->parentgui;
131  }
+ Here is the caller graph for this function:

◆ getPropertyValues()

ilSkillTreeNodeGUI::getPropertyValues ( )

Get property values for edit form.

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

Referenced by editProperties().

408  {
409  $values = array();
410 
411  $values["title"] = $this->node_object->getTitle();
412  $values["description"] = $this->node_object->getDescription();
413  $values["order_nr"] = $this->node_object->getOrderNr();
414  $values["self_eval"] = $this->node_object->getSelfEvaluation();
415  $values["status"] = $this->node_object->getStatus();
416 
417  $this->form->setValuesByArray($values);
418  }
+ Here is the caller graph for this function:

◆ initForm()

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

Init form.

Parameters
int$a_modeEdit Mode

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

References $_GET, $ctrl, $lng, checkPermissionBool(), ilFormPropertyGUI\setInfo(), and ilTextAreaInputGUI\setRows().

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

500  {
501  $lng = $this->lng;
502  $ilCtrl = $this->ctrl;
503 
504  $this->form = new ilPropertyFormGUI();
505 
506  // title
507  $ti = new ilTextInputGUI($lng->txt("title"), "title");
508  $ti->setMaxLength(200);
509  $ti->setSize(50);
510  $ti->setRequired(true);
511  $this->form->addItem($ti);
512 
513  // description
514  $ta = new ilTextAreaInputGUI($lng->txt("description"), "description");
515  $ta->setRows(5);
516  $this->form->addItem($ta);
517 
518  // order nr
519  $ni = new ilNumberInputGUI($lng->txt("skmg_order_nr"), "order_nr");
520  $ni->setInfo($lng->txt("skmg_order_nr_info"));
521  $ni->setMaxLength(6);
522  $ni->setSize(6);
523  $ni->setRequired(true);
524  if ($a_mode == "create") {
525  $tree = new ilSkillTree();
526  $max = $tree->getMaxOrderNr((int) $_GET["obj_id"]);
527  $ni->setValue($max + 10);
528  }
529  $this->form->addItem($ni);
530 
531  // save and cancel commands
532  if ($this->checkPermissionBool("write")) {
533  if ($a_mode == "create") {
534  $this->form->addCommandButton("save", $lng->txt("save"));
535  $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
536  $this->form->setTitle($lng->txt("skmg_create_" . $this->getType()));
537  } else {
538  $this->form->addCommandButton("update", $lng->txt("save"));
539  $this->form->setTitle($lng->txt("skmg_edit_" . $this->getType()));
540  }
541  }
542 
543  $ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
544  $this->form->setFormAction($ilCtrl->getFormAction($this));
545  }
This class represents a property form user interface.
Skill tree.
$_GET["client_id"]
checkPermissionBool($a_perm)
Check permission pool.
setInfo($a_info)
Set Information Text.
This class represents a number property in a property form.
This class represents a text area property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertBasicSkillClip()

ilSkillTreeNodeGUI::insertBasicSkillClip ( )

Insert basic skills from clipboard.

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

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

621  {
622  $nodes = ilSkillTreeNode::insertItemsFromClip("skll", (int) $_GET["obj_id"]);
623  $this->redirectToParent();
624  }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
$_GET["client_id"]
static insertItemsFromClip($a_type, $a_obj_id)
Insert basic skills from clipboard.
+ Here is the call graph for this function:

◆ insertSkillCategoryClip()

ilSkillTreeNodeGUI::insertSkillCategoryClip ( )

Insert skill categories from clipboard.

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

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

630  {
631  $nodes = ilSkillTreeNode::insertItemsFromClip("scat", (int) $_GET["obj_id"]);
632  $this->redirectToParent();
633  }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
$_GET["client_id"]
static insertItemsFromClip($a_type, $a_obj_id)
Insert basic skills from clipboard.
+ Here is the call graph for this function:

◆ insertSkillTemplateClip()

ilSkillTreeNodeGUI::insertSkillTemplateClip ( )

Insert skill template from clipboard.

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

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

648  {
649  $nodes = ilSkillTreeNode::insertItemsFromClip("sktp", (int) $_GET["obj_id"]);
650  $this->redirectToParent();
651  }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
$_GET["client_id"]
static insertItemsFromClip($a_type, $a_obj_id)
Insert basic skills from clipboard.
+ Here is the call graph for this function:

◆ insertTemplateCategoryClip()

ilSkillTreeNodeGUI::insertTemplateCategoryClip ( )

Insert skill template category from clipboard.

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

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

657  {
658  $nodes = ilSkillTreeNode::insertItemsFromClip("sctp", (int) $_GET["obj_id"]);
659  $this->redirectToParent();
660  }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
$_GET["client_id"]
static insertItemsFromClip($a_type, $a_obj_id)
Insert basic skills from clipboard.
+ Here is the call graph for this function:

◆ insertTemplateReferenceClip()

ilSkillTreeNodeGUI::insertTemplateReferenceClip ( )

Insert skill template references from clipboard.

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

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

639  {
640  $nodes = ilSkillTreeNode::insertItemsFromClip("sktr", (int) $_GET["obj_id"]);
641  $this->redirectToParent();
642  }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
$_GET["client_id"]
static insertItemsFromClip($a_type, $a_obj_id)
Insert basic skills from clipboard.
+ Here is the call graph for this function:

◆ isInUse()

ilSkillTreeNodeGUI::isInUse ( )

Is in use?

Parameters

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

References $in_use, and ilSkillTreeNode\getAllCSkillIdsForNodeIds().

Referenced by ilBasicSkillGUI\edit(), ilBasicSkillTemplateGUI\edit(), ilBasicSkillGUI\editLevel(), editProperties(), ilSkillTemplateCategoryGUI\listItems(), ilSkillCategoryGUI\listItems(), and ilSkillTemplateReferenceGUI\listItems().

83  {
84  if (!is_object($this->node_object)) {
85  return false;
86  }
87  if ($this->use_checked) {
88  return $this->in_use;
89  }
90  $cskill_ids = ilSkillTreeNode::getAllCSkillIdsForNodeIds(array($this->node_object->getId()));
91  $u = new ilSkillUsage();
92  $usages = $u->getAllUsagesInfoOfSubtrees($cskill_ids);
93  if (count($usages) > 0) {
94  $this->in_use = true;
95  } else {
96  $this->in_use = false;
97  }
98  return $this->in_use;
99  }
static getAllCSkillIdsForNodeIds(array $a_node_ids)
Get all possible common skill IDs for node IDs.
Skill usage.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readNodeObject()

ilSkillTreeNodeGUI::readNodeObject (   $a_node_id)

Get node object instance.

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

References ilSkillTreeNodeFactory\getInstance().

Referenced by __construct().

137  {
138  $this->node_object = ilSkillTreeNodeFactory::getInstance($a_node_id);
139  }
+ 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

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

References $_GET, $ctrl, and ilSkillTreeNode\_lookupType().

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

565  {
566  $ilCtrl = $this->ctrl;
567 
568  if ($_GET["tmpmode"]) {
569  $a_tmp_mode = true;
570  }
571 
572  $t = ilSkillTreeNode::_lookupType((int) $_GET["obj_id"]);
573 
574  switch ($t) {
575  case "skrt":
576  $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id", (int) $_GET["obj_id"]);
577  if ($a_tmp_mode) {
578  $ilCtrl->redirectByClass("ilskillrootgui", "listTemplates");
579  } else {
580  $ilCtrl->redirectByClass("ilskillrootgui", "listSkills");
581  }
582  break;
583 
584  case "sctp":
585  $ilCtrl->setParameterByClass("ilskilltemplatecategorygui", "obj_id", (int) $_GET["obj_id"]);
586  $ilCtrl->redirectByClass("ilskilltemplatecategorygui", "listItems");
587  break;
588 
589  case "scat":
590  $ilCtrl->setParameterByClass("ilskillcategorygui", "obj_id", (int) $_GET["obj_id"]);
591  $ilCtrl->redirectByClass("ilskillcategorygui", "listItems");
592  break;
593  }
594  }
$_GET["client_id"]
static _lookupType($a_obj_id)
Lookup Type.
+ 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 424 of file class.ilSkillTreeNodeGUI.php.

References $_GET, $ctrl, $lng, $tpl, afterSave(), checkPermissionBool(), initForm(), and ilSkillTreeNode\saveChildsOrder().

425  {
426  $tpl = $this->tpl;
427  $lng = $this->lng;
428  $ilCtrl = $this->ctrl;
429 
430  if (!$this->checkPermissionBool("write")) {
431  return;
432  }
433 
434  $this->initForm("create");
435  if ($this->form->checkInput()) {
436  $this->saveItem();
437  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
439  (int) $_GET["obj_id"],
440  array(),
441  in_array($this->getType(), array("sktp", "sctp"))
442  );
443  $this->afterSave();
444  } else {
445  $this->form->setValuesByPost();
446  $tpl->setContent($this->form->getHtml());
447  }
448  }
$_GET["client_id"]
checkPermissionBool($a_perm)
Check permission pool.
initForm($a_mode="edit")
Init form.
static saveChildsOrder($a_par_id, $a_childs_order, $a_templates=false)
Save childs order.
+ Here is the call graph for this function:

◆ saveAllTitles()

ilSkillTreeNodeGUI::saveAllTitles ( )

Save Titles.

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

References $ctrl, and getParentGUI().

145  {
146  $ilCtrl = $this->ctrl;
147 
148  $this->getParentGUI()->saveAllTitles(false);
149  $ilCtrl->redirect($this, "showOrganization");
150  }
getParentGUI()
Get Parent GUI class (ilObjSCORM2004LearningModuleGUI).
+ Here is the call graph for this function:

◆ saveOrder()

ilSkillTreeNodeGUI::saveOrder ( )

Save order.

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

References $_GET, $_POST, $ctrl, $lng, checkPermissionBool(), redirectToParent(), and ilSkillTreeNode\saveChildsOrder().

600  {
601  $ilCtrl = $this->ctrl;
602  $lng = $this->lng;
603 
604  if (!$this->checkPermissionBool("write")) {
605  return;
606  }
607 
609  (int) $_GET["obj_id"],
610  $_POST["order"],
611  (int) $_GET["tmpmode"]
612  );
613  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
614  $this->redirectToParent((int) $_GET["tmpmode"]);
615  }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
$_GET["client_id"]
checkPermissionBool($a_perm)
Check permission pool.
static saveChildsOrder($a_par_id, $a_childs_order, $a_templates=false)
Save childs order.
$_POST["username"]
+ Here is the call graph for this function:

◆ setLocator()

ilSkillTreeNodeGUI::setLocator ( )

Set Locator Items.

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

References $_GET, $ctrl, $i, $locator, $tpl, ilUtil\getImagePath(), and getParentGUI().

Referenced by ilBasicSkillGUI\showProperties().

275  {
276  $ilLocator = $this->locator;
277  $tpl = $this->tpl;
278  $ilCtrl = $this->ctrl;
279 
280  $ilLocator->addRepositoryItems($_GET["ref_id"]);
281  $this->getParentGUI()->addLocatorItems();
282 
283  if ($_GET["obj_id"] > 0) {
284  $tree = new ilSkillTree();
285  $path = $tree->getPathFull($_GET["obj_id"]);
286  for ($i = 1; $i < count($path); $i++) {
287  switch ($path[$i]["type"]) {
288  case "scat":
289  $ilCtrl->setParameterByClass(
290  "ilskillcategorygui",
291  "obj_id",
292  $path[$i]["child"]
293  );
294  $ilLocator->addItem(
295  $path[$i]["title"],
296  $ilCtrl->getLinkTargetByClass(
297  "ilskillmanagementgui",
298  "ilskillcategorygui"
299  ),
300  "",
301  0,
302  $path[$i]["type"],
303  ilUtil::getImagePath("icon_skmg.svg")
304  );
305  break;
306 
307  case "skll":
308  $ilCtrl->setParameterByClass(
309  "ilbasicskillgui",
310  "obj_id",
311  $path[$i]["child"]
312  );
313  $ilLocator->addItem(
314  $path[$i]["title"],
315  $ilCtrl->getLinkTargetByClass(
316  "ilskillmanagementgui",
317  "ilbasicskillgui"
318  ),
319  "",
320  0,
321  $path[$i]["type"],
322  ilUtil::getImagePath("icon_skmg.svg")
323  );
324  break;
325 
326  }
327  }
328  }
329  $ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
330 
331  $tpl->setLocator();
332  }
Skill tree.
$_GET["client_id"]
getParentGUI()
Get Parent GUI class (ilObjSCORM2004LearningModuleGUI).
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$i
Definition: metadata.php:24
+ 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 118 of file class.ilSkillTreeNodeGUI.php.

119  {
120  $this->parentgui = $a_parentgui;
121  }

◆ setSkillNodeDescription()

ilSkillTreeNodeGUI::setSkillNodeDescription ( )

Set skill node description.

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

References $tpl.

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

338  {
339  $tpl = $this->tpl;
340 
341  if (is_object($this->node_object)) {
342  $tree = new ilSkillTree();
343  $path = $this->node_object->skill_tree->getSkillTreePath(
344  $this->node_object->getId(),
345  $this->tref_id
346  );
347  $desc = "";
348  foreach ($path as $p) {
349  if (in_array($p["type"], array("scat", "skll", "sktr"))) {
350  $desc .= $sep . $p["title"];
351  $sep = " > ";
352  }
353  }
354  }
355  $tpl->setDescription($desc);
356  }
Skill tree.
+ Here is the caller graph for this function:

◆ setTitleIcon()

ilSkillTreeNodeGUI::setTitleIcon ( )

Set title icon.

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

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

666  {
667  $tpl = $this->tpl;
668 
669  $obj_id = (is_object($this->node_object))
670  ? $this->node_object->getId()
671  :0;
672  $tpl->setTitleIcon(
674  $obj_id,
675  $this->getType(),
676  "",
678  )
679  );
680  }
static getIconPath($a_obj_id, $a_type, $a_size="", $a_status=0)
Get icon path.
static _lookupStatus($a_obj_id)
Lookup Status.
+ Here is the call graph for this function:

◆ showObjects()

ilSkillTreeNodeGUI::showObjects ( )

Show assigned objects.

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

References $tpl.

748  {
749  $tpl = $this->tpl;
750 
751  $this->setTabs("objects");
752 
753  $base_skill_id = ($this->base_skill_id > 0)
754  ? $this->base_skill_id
755  : $this->node_object->getId();
756  $usage_info = new ilSkillUsage();
757  $objects = $usage_info->getAssignedObjectsForSkill($base_skill_id, $this->tref_id);
758 
759  $tab = new ilSkillAssignedObjectsTableGUI($this, "showObjects", $objects);
760 
761  $tpl->setContent($tab->getHTML());
762  }
TableGUI class for assigned objects of skills.
setTabs()
set admin tabs public
Skill usage.

◆ showUsage()

ilSkillTreeNodeGUI::showUsage ( )

Show skill usage.

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

References $tpl.

709  {
710  $tpl = $this->tpl;
711 
712  $this->setTabs("usage");
713 
714  $usage_info = new ilSkillUsage();
715  $base_skill_id = ($this->base_skill_id > 0)
716  ? $this->base_skill_id
717  : $this->node_object->getId();
718  $usages = $usage_info->getAllUsagesInfoOfSubtree($base_skill_id . ":" . $this->tref_id);
719 
720  $html = "";
721  foreach ($usages as $k => $usage) {
722  $tab = new ilSkillUsageTableGUI($this, "showUsage", $k, $usage);
723  $html .= $tab->getHTML() . "<br/><br/>";
724  }
725 
726  $tpl->setContent($html);
727  }
TableGUI class for skill usages.
setTabs()
set admin tabs public
Skill usage.

◆ update()

ilSkillTreeNodeGUI::update ( )

Update skill tree node.

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

References $ctrl, $lng, $tpl, afterUpdate(), checkPermissionBool(), and initForm().

464  {
465  $tpl = $this->tpl;
466  $lng = $this->lng;
467  $ilCtrl = $this->ctrl;
468 
469  if (!$this->checkPermissionBool("write")) {
470  return;
471  }
472 
473  $this->initForm("edit");
474  if ($this->form->checkInput()) {
475  $this->updateItem();
476  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
477  $this->afterUpdate();
478  } else {
479  $this->form->setValuesByPost();
480  $tpl->setContent($this->form->getHtml());
481  }
482  }
checkPermissionBool($a_perm)
Check permission pool.
initForm($a_mode="edit")
Init form.
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilSkillTreeNodeGUI::$access

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

◆ $ctrl

◆ $in_use

ilSkillTreeNodeGUI::$in_use = false

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

Referenced by isInUse().

◆ $lng

ilSkillTreeNodeGUI::$lng
protected

◆ $locator

ilSkillTreeNodeGUI::$locator
protected

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

Referenced by setLocator().

◆ $node_object

ilSkillTreeNodeGUI::$node_object

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

◆ $ref_id

ilSkillTreeNodeGUI::$ref_id

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

Referenced by ilBasicSkillGUI\saveLevelResource().

◆ $tpl

ilSkillTreeNodeGUI::$tpl
protected

◆ $use_checked

ilSkillTreeNodeGUI::$use_checked = false

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

◆ $user

ilSkillTreeNodeGUI::$user
protected

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


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