ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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...
 
 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
Version
$Id$

Definition at line 15 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 59 of file class.ilSkillTreeNodeGUI.php.

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

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

Member Function Documentation

◆ addStatusInput()

ilSkillTreeNodeGUI::addStatusInput ( ilPropertyFormGUI  $a_form)

Add status input.

Parameters
ilPropertyFormGUI$a_formform

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

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

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

389  {
390  $lng = $this->lng;
391 
392  // status
393  $radg = new ilRadioGroupInputGUI($lng->txt("skmg_status"), "status");
394  foreach (ilSkillTreeNode::getAllStatus() as $k => $op) {
395  $op = new ilRadioOption($op, $k, ilSkillTreeNode::getStatusInfo($k));
396  $radg->addOption($op);
397  }
398  $a_form->addItem($radg);
399  }
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 722 of file class.ilSkillTreeNodeGUI.php.

References $ctrl, $ilCtrl, and $lng.

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

723  {
724  $lng = $this->lng;
726 
727  $a_tabs->addTab(
728  "usage",
729  $lng->txt("skmg_usage"),
730  $ilCtrl->getLinkTarget($this, "showUsage")
731  );
732  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ afterSave()

ilSkillTreeNodeGUI::afterSave ( )

After saving.

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

References redirectToParent().

Referenced by save().

467  {
468  $this->redirectToParent();
469  }
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 500 of file class.ilSkillTreeNodeGUI.php.

References $ctrl, and $ilCtrl.

Referenced by update().

501  {
503 
504  $ilCtrl->redirect($this, "editProperties");
505  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ cancelDelete()

ilSkillTreeNodeGUI::cancelDelete ( )

cancel delete

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

References $ctrl, $ilCtrl, and redirectToParent().

256  {
258 
259  $this->redirectToParent();
260  }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ cancelSave()

ilSkillTreeNodeGUI::cancelSave ( )

Cancel saving.

Parameters

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

References redirectToParent().

564  {
565  $this->redirectToParent();
566  }
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 265 of file class.ilSkillTreeNodeGUI.php.

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

266  {
268 
269  if (!$this->checkPermissionBool("write")) {
270  return;
271  }
272 
273  $this->getParentGUI()->confirmedDelete(false);
275  (int) $_GET["obj_id"],
276  array(),
277  $_GET["tmpmode"]
278  );
279 
280  $this->redirectToParent();
281  }
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.
global $ilCtrl
Definition: ilias.php:18
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 217 of file class.ilSkillTreeNodeGUI.php.

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

218  {
220  $lng = $this->lng;
221 
222  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0) {
223  $this->redirectToParent();
224  }
225 
226  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
227 
228  $items = ilUtil::stripSlashesArray($_POST["id"]);
229  $todel = array(); // delete IDs < 0 (needed for non-js editing)
230  foreach ($items as $k => $item) {
231  if ($item < 0) {
232  $todel[] = $k;
233  }
234  }
235  foreach ($todel as $k) {
236  unset($items[$k]);
237  }
238  if (!ilSkillTreeNode::uniqueTypesCheck($items)) {
239  ilUtil::sendInfo($lng->txt("skmg_insert_please_choose_one_type_only"), true);
240  $this->redirectToParent();
241  }
243 
244  // @todo: move this to a service since it can be used here, too
245  include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
247  ilUtil::sendInfo($lng->txt("skmg_selected_items_have_been_copied"), true);
248 
249  $this->redirectToParent();
250  }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
global $ilCtrl
Definition: ilias.php:18
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 375 of file class.ilSkillTreeNodeGUI.php.

References $tpl, and initForm().

376  {
377  $tpl = $this->tpl;
378 
379  $this->initForm("create");
380  $tpl->setContent($this->form->getHTML());
381  }
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 172 of file class.ilSkillTreeNodeGUI.php.

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

173  {
174  $lng = $this->lng;
175 
176  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
177 
178  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0) {
179  $this->redirectToParent();
180  }
181 
182  $items = ilUtil::stripSlashesArray($_POST["id"]);
183  $todel = array(); // delete IDs < 0 (needed for non-js editing)
184  foreach ($items as $k => $item) {
185  if ($item < 0) {
186  $todel[] = $k;
187  }
188  }
189  foreach ($todel as $k) {
190  unset($items[$k]);
191  }
192 
193  if (!ilSkillTreeNode::uniqueTypesCheck($items)) {
194  ilUtil::sendInfo($lng->txt("skmg_insert_please_choose_one_type_only"), true);
195  $this->redirectToParent();
196  }
197 
199 
200  include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
202 
203  ilUtil::sendInfo($lng->txt("skmg_selected_items_have_been_cut"), true);
204 
206  (int) $_GET["obj_id"],
207  array(),
208  $_GET["tmpmode"]
209  );
210 
211  $this->redirectToParent();
212  }
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 161 of file class.ilSkillTreeNodeGUI.php.

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

162  {
164 
165  $ilCtrl->setParameter($this, "backcmd", $_GET["backcmd"]);
166  $this->getParentGUI()->deleteNodes($this);
167  }
$_GET["client_id"]
getParentGUI()
Get Parent GUI class (ilObjSCORM2004LearningModuleGUI).
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ editProperties()

ilSkillTreeNodeGUI::editProperties ( )

Edit properties form.

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

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

405  {
406  $tpl = $this->tpl;
407  $lng = $this->lng;
408 
409  if ($this->isInUse()) {
410  ilUtil::sendInfo($lng->txt("skmg_skill_in_use"));
411  }
412 
413  $this->initForm("edit");
414  $this->getPropertyValues();
415  $tpl->setContent($this->form->getHTML());
416  }
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 764 of file class.ilSkillTreeNodeGUI.php.

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

765  {
767 
768  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0) {
769  $this->redirectToParent();
770  }
771 
772  include_once("./Services/Export/classes/class.ilExport.php");
773  $exp = new ilExport();
774  $conf = $exp->getConfig("Services/Skill");
775  $conf->setSelectedNodes($_POST["id"]);
776  $exp->exportObject("skmg", ilObject::_lookupObjId((int) $_GET["ref_id"]));
777 
778  $ilCtrl->redirectByClass(array("iladministrationgui", "ilobjskillmanagementgui", "ilexportgui"), "");
779  }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
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 133 of file class.ilSkillTreeNodeGUI.php.

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

134  {
135  return $this->parentgui;
136  }
+ Here is the caller graph for this function:

◆ getPropertyValues()

ilSkillTreeNodeGUI::getPropertyValues ( )

Get property values for edit form.

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

References $values.

Referenced by editProperties().

422  {
423  $values = array();
424 
425  $values["title"] = $this->node_object->getTitle();
426  $values["order_nr"] = $this->node_object->getOrderNr();
427  $values["self_eval"] = $this->node_object->getSelfEvaluation();
428  $values["status"] = $this->node_object->getStatus();
429 
430  $this->form->setValuesByArray($values);
431  }
$values
+ Here is the caller graph for this function:

◆ initForm()

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

Init form.

Parameters
int$a_modeEdit Mode

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

References $_GET, $ctrl, $ilCtrl, $lng, $tree, checkPermissionBool(), ilFormPropertyGUI\setInfo(), and ilTextInputGUI\setMaxLength().

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

513  {
514  $lng = $this->lng;
516 
517  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
518  $this->form = new ilPropertyFormGUI();
519 
520  // title
521  $ti = new ilTextInputGUI($lng->txt("title"), "title");
522  $ti->setMaxLength(200);
523  $ti->setSize(50);
524  $ti->setRequired(true);
525  $this->form->addItem($ti);
526 
527  // order nr
528  $ni = new ilNumberInputGUI($lng->txt("skmg_order_nr"), "order_nr");
529  $ni->setInfo($lng->txt("skmg_order_nr_info"));
530  $ni->setMaxLength(6);
531  $ni->setSize(6);
532  $ni->setRequired(true);
533  if ($a_mode == "create") {
534  include_once("./Services/Skill/classes/class.ilSkillTree.php");
535  $tree = new ilSkillTree();
536  $max = $tree->getMaxOrderNr((int) $_GET["obj_id"]);
537  $ni->setValue($max + 10);
538  }
539  $this->form->addItem($ni);
540 
541  // save and cancel commands
542  if ($this->checkPermissionBool("write")) {
543  if ($a_mode == "create") {
544  $this->form->addCommandButton("save", $lng->txt("save"));
545  $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
546  $this->form->setTitle($lng->txt("skmg_create_" . $this->getType()));
547  } else {
548  $this->form->addCommandButton("update", $lng->txt("save"));
549  $this->form->setTitle($lng->txt("skmg_edit_" . $this->getType()));
550  }
551  }
552 
553  $ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
554  $this->form->setFormAction($ilCtrl->getFormAction($this));
555  }
This class represents a property form user interface.
Skill tree.
$_GET["client_id"]
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
setInfo($a_info)
Set Information Text.
This class represents a number property in a property form.
This class represents a text property in a property form.
setMaxLength($a_maxlength)
Set Max Length.
+ 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 630 of file class.ilSkillTreeNodeGUI.php.

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

631  {
634 
635  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
636  $nodes = ilSkillTreeNode::insertItemsFromClip("skll", (int) $_GET["obj_id"]);
637  $this->redirectToParent();
638  }
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.
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

◆ insertSkillCategoryClip()

ilSkillTreeNodeGUI::insertSkillCategoryClip ( )

Insert skill categories from clipboard.

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

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

644  {
647 
648  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
649  $nodes = ilSkillTreeNode::insertItemsFromClip("scat", (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.
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

◆ insertSkillTemplateClip()

ilSkillTreeNodeGUI::insertSkillTemplateClip ( )

Insert skill template from clipboard.

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

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

670  {
673 
674  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
675  $nodes = ilSkillTreeNode::insertItemsFromClip("sktp", (int) $_GET["obj_id"]);
676  $this->redirectToParent();
677  }
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.
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

◆ insertTemplateCategoryClip()

ilSkillTreeNodeGUI::insertTemplateCategoryClip ( )

Insert skill template category from clipboard.

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

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

683  {
686 
687  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
688  $nodes = ilSkillTreeNode::insertItemsFromClip("sctp", (int) $_GET["obj_id"]);
689  $this->redirectToParent();
690  }
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.
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

◆ insertTemplateReferenceClip()

ilSkillTreeNodeGUI::insertTemplateReferenceClip ( )

Insert skill template references from clipboard.

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

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

657  {
660 
661  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
662  $nodes = ilSkillTreeNode::insertItemsFromClip("sktr", (int) $_GET["obj_id"]);
663  $this->redirectToParent();
664  }
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.
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

◆ isInUse()

ilSkillTreeNodeGUI::isInUse ( )

Is in use?

Parameters

Definition at line 86 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().

87  {
88  if (!is_object($this->node_object)) {
89  return false;
90  }
91  if ($this->use_checked) {
92  return $this->in_use;
93  }
94  $cskill_ids = ilSkillTreeNode::getAllCSkillIdsForNodeIds(array($this->node_object->getId()));
95  include_once("./Services/Skill/classes/class.ilSkillUsage.php");
96  $u = new ilSkillUsage();
97  $usages = $u->getAllUsagesInfoOfSubtrees($cskill_ids);
98  if (count($usages) > 0) {
99  $this->in_use = true;
100  } else {
101  $this->in_use = false;
102  }
103  return $this->in_use;
104  }
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 141 of file class.ilSkillTreeNodeGUI.php.

References ilSkillTreeNodeFactory\getInstance().

Referenced by __construct().

142  {
143  include_once("./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
144  $this->node_object = ilSkillTreeNodeFactory::getInstance($a_node_id);
145  }
+ 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 574 of file class.ilSkillTreeNodeGUI.php.

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

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

575  {
577 
578  if ($_GET["tmpmode"]) {
579  $a_tmp_mode = true;
580  }
581 
582  $t = ilSkillTreeNode::_lookupType((int) $_GET["obj_id"]);
583 
584  switch ($t) {
585  case "skrt":
586  $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id", (int) $_GET["obj_id"]);
587  if ($a_tmp_mode) {
588  $ilCtrl->redirectByClass("ilskillrootgui", "listTemplates");
589  } else {
590  $ilCtrl->redirectByClass("ilskillrootgui", "listSkills");
591  }
592  break;
593 
594  case "sctp":
595  $ilCtrl->setParameterByClass("ilskilltemplatecategorygui", "obj_id", (int) $_GET["obj_id"]);
596  $ilCtrl->redirectByClass("ilskilltemplatecategorygui", "listItems");
597  break;
598 
599  case "scat":
600  $ilCtrl->setParameterByClass("ilskillcategorygui", "obj_id", (int) $_GET["obj_id"]);
601  $ilCtrl->redirectByClass("ilskillcategorygui", "listItems");
602  break;
603  }
604  }
$_GET["client_id"]
static _lookupType($a_obj_id)
Lookup Type.
global $ilCtrl
Definition: ilias.php:18
+ 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 437 of file class.ilSkillTreeNodeGUI.php.

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

438  {
439  $tpl = $this->tpl;
440  $lng = $this->lng;
442 
443  if (!$this->checkPermissionBool("write")) {
444  return;
445  }
446 
447  $this->initForm("create");
448  if ($this->form->checkInput()) {
449  $this->saveItem();
450  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
452  (int) $_GET["obj_id"],
453  array(),
454  in_array($this->getType(), array("sktp", "sctp"))
455  );
456  $this->afterSave();
457  } else {
458  $this->form->setValuesByPost();
459  $tpl->setContent($this->form->getHtml());
460  }
461  }
$_GET["client_id"]
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
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 150 of file class.ilSkillTreeNodeGUI.php.

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

151  {
153 
154  $this->getParentGUI()->saveAllTitles(false);
155  $ilCtrl->redirect($this, "showOrganization");
156  }
getParentGUI()
Get Parent GUI class (ilObjSCORM2004LearningModuleGUI).
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ saveOrder()

ilSkillTreeNodeGUI::saveOrder ( )

Save order.

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

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

610  {
612  $lng = $this->lng;
613 
614  if (!$this->checkPermissionBool("write")) {
615  return;
616  }
617 
619  (int) $_GET["obj_id"],
620  $_POST["order"],
621  (int) $_GET["tmpmode"]
622  );
623  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
624  $this->redirectToParent((int) $_GET["tmpmode"]);
625  }
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
$_GET["client_id"]
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
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 286 of file class.ilSkillTreeNodeGUI.php.

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

Referenced by ilBasicSkillGUI\showProperties().

287  {
288  $ilLocator = $this->locator;
289  $tpl = $this->tpl;
291 
292  $ilLocator->addRepositoryItems($_GET["ref_id"]);
293  $this->getParentGUI()->addLocatorItems();
294 
295  if ($_GET["obj_id"] > 0) {
296  include_once("./Services/Skill/classes/class.ilSkillTree.php");
297  $tree = new ilSkillTree();
298  $path = $tree->getPathFull($_GET["obj_id"]);
299  for ($i = 1; $i < count($path); $i++) {
300  switch ($path[$i]["type"]) {
301  case "scat":
302  $ilCtrl->setParameterByClass(
303  "ilskillcategorygui",
304  "obj_id",
305  $path[$i]["child"]
306  );
307  $ilLocator->addItem(
308  $path[$i]["title"],
309  $ilCtrl->getLinkTargetByClass(
310  "ilskillmanagementgui",
311  "ilskillcategorygui"
312  ),
313  "",
314  0,
315  $path[$i]["type"],
316  ilUtil::getImagePath("icon_skmg.svg")
317  );
318  break;
319 
320  case "skll":
321  $ilCtrl->setParameterByClass(
322  "ilbasicskillgui",
323  "obj_id",
324  $path[$i]["child"]
325  );
326  $ilLocator->addItem(
327  $path[$i]["title"],
328  $ilCtrl->getLinkTargetByClass(
329  "ilskillmanagementgui",
330  "ilbasicskillgui"
331  ),
332  "",
333  0,
334  $path[$i]["type"],
335  ilUtil::getImagePath("icon_skmg.svg")
336  );
337  break;
338 
339  }
340  }
341  }
342  $ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
343 
344  $tpl->setLocator();
345  }
$path
Definition: aliased.php:25
Skill tree.
$_GET["client_id"]
getParentGUI()
Get Parent GUI class (ilObjSCORM2004LearningModuleGUI).
global $ilCtrl
Definition: ilias.php:18
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$i
Definition: disco.tpl.php:19
+ 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 123 of file class.ilSkillTreeNodeGUI.php.

124  {
125  $this->parentgui = $a_parentgui;
126  }

◆ setSkillNodeDescription()

ilSkillTreeNodeGUI::setSkillNodeDescription ( )

Set skill node description.

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

References $path, $tpl, and $tree.

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

351  {
352  $tpl = $this->tpl;
353 
354  if (is_object($this->node_object)) {
355  include_once("./Services/Skill/classes/class.ilSkillTree.php");
356  $tree = new ilSkillTree();
357  $path = $this->node_object->skill_tree->getSkillTreePath(
358  $this->node_object->getId(),
359  $this->tref_id
360  );
361  $desc = "";
362  foreach ($path as $p) {
363  if (in_array($p["type"], array("scat", "skll", "sktr"))) {
364  $desc .= $sep . $p["title"];
365  $sep = " > ";
366  }
367  }
368  }
369  $tpl->setDescription($desc);
370  }
$path
Definition: aliased.php:25
Skill tree.
+ Here is the caller graph for this function:

◆ setTitleIcon()

ilSkillTreeNodeGUI::setTitleIcon ( )

Set title icon.

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

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

696  {
697  $tpl = $this->tpl;
698 
699  $obj_id = (is_object($this->node_object))
700  ? $this->node_object->getId()
701  :0;
702  $tpl->setTitleIcon(
704  $obj_id,
705  $this->getType(),
706  "",
708  )
709  );
710  }
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:

◆ showUsage()

ilSkillTreeNodeGUI::showUsage ( )

Show skill usage.

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

References $html, $tab, and $tpl.

739  {
740  $tpl = $this->tpl;
741 
742  $this->setTabs("usage");
743 
744  include_once("./Services/Skill/classes/class.ilSkillUsage.php");
745  $usage_info = new ilSkillUsage();
746  $base_skill_id = ($this->base_skill_id > 0)
747  ? $this->base_skill_id
748  : $this->node_object->getId();
749  $usages = $usage_info->getAllUsagesInfoOfSubtree($base_skill_id . ":" . $this->tref_id);
750 
751  $html = "";
752  include_once("./Services/Skill/classes/class.ilSkillUsageTableGUI.php");
753  foreach ($usages as $k => $usage) {
754  $tab = new ilSkillUsageTableGUI($this, "showUsage", $k, $usage);
755  $html .= $tab->getHTML() . "<br/><br/>";
756  }
757 
758  $tpl->setContent($html);
759  }
TableGUI class for skill usages.
Skill usage.
$html
Definition: example_001.php:87

◆ update()

ilSkillTreeNodeGUI::update ( )

Update skill tree node.

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

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

477  {
478  $tpl = $this->tpl;
479  $lng = $this->lng;
481 
482  if (!$this->checkPermissionBool("write")) {
483  return;
484  }
485 
486  $this->initForm("edit");
487  if ($this->form->checkInput()) {
488  $this->updateItem();
489  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
490  $this->afterUpdate();
491  } else {
492  $this->form->setValuesByPost();
493  $tpl->setContent($this->form->getHtml());
494  }
495  }
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
initForm($a_mode="edit")
Init form.
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilSkillTreeNodeGUI::$access

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

◆ $ctrl

◆ $in_use

ilSkillTreeNodeGUI::$in_use = false

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

Referenced by isInUse().

◆ $lng

ilSkillTreeNodeGUI::$lng
protected

◆ $locator

ilSkillTreeNodeGUI::$locator
protected

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

Referenced by setLocator().

◆ $node_object

ilSkillTreeNodeGUI::$node_object

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

◆ $ref_id

ilSkillTreeNodeGUI::$ref_id

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

Referenced by ilBasicSkillGUI\saveLevelResource().

◆ $tpl

ilSkillTreeNodeGUI::$tpl
protected

◆ $use_checked

ilSkillTreeNodeGUI::$use_checked = false

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

◆ $user


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