ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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...
 
 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.
$_GET["client_id"]
user()
Definition: user.php:4
static _lookupType($a_obj_id)
Lookup Type.
$DIC
Definition: xapitoken.php:46
+ 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 728 of file class.ilSkillTreeNodeGUI.php.

References $ctrl, $ilCtrl, and $lng.

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

729  {
730  $lng = $this->lng;
732 
733  $a_tabs->addTab(
734  "usage",
735  $lng->txt("skmg_usage"),
736  $ilCtrl->getLinkTarget($this, "showUsage")
737  );
738  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ afterSave()

ilSkillTreeNodeGUI::afterSave ( )

After saving.

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

References redirectToParent().

Referenced by save().

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

References $ctrl, and $ilCtrl.

Referenced by update().

502  {
504 
505  $ilCtrl->redirect($this, "editProperties");
506  }
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 569 of file class.ilSkillTreeNodeGUI.php.

References redirectToParent().

570  {
571  $this->redirectToParent();
572  }
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 770 of file class.ilSkillTreeNodeGUI.php.

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

771  {
773 
774  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0) {
775  $this->redirectToParent();
776  }
777 
778  include_once("./Services/Export/classes/class.ilExport.php");
779  $exp = new ilExport();
780  $conf = $exp->getConfig("Services/Skill");
781  $conf->setSelectedNodes($_POST["id"]);
782  $exp->exportObject("skmg", ilObject::_lookupObjId((int) $_GET["ref_id"]));
783 
784  $ilCtrl->redirectByClass(array("iladministrationgui", "ilobjskillmanagementgui", "ilexportgui"), "");
785  }
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.

Referenced by editProperties().

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

◆ initForm()

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

Init form.

Parameters
int$a_modeEdit Mode

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

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

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

514  {
515  $lng = $this->lng;
517 
518  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
519  $this->form = new ilPropertyFormGUI();
520 
521  // title
522  $ti = new ilTextInputGUI($lng->txt("title"), "title");
523  $ti->setMaxLength(200);
524  $ti->setSize(50);
525  $ti->setRequired(true);
526  $this->form->addItem($ti);
527 
528  // description
529  $ta = new ilTextAreaInputGUI($lng->txt("description"), "description");
530  $ta->setRows(5);
531  $this->form->addItem($ta);
532 
533  // order nr
534  $ni = new ilNumberInputGUI($lng->txt("skmg_order_nr"), "order_nr");
535  $ni->setInfo($lng->txt("skmg_order_nr_info"));
536  $ni->setMaxLength(6);
537  $ni->setSize(6);
538  $ni->setRequired(true);
539  if ($a_mode == "create") {
540  include_once("./Services/Skill/classes/class.ilSkillTree.php");
541  $tree = new ilSkillTree();
542  $max = $tree->getMaxOrderNr((int) $_GET["obj_id"]);
543  $ni->setValue($max + 10);
544  }
545  $this->form->addItem($ni);
546 
547  // save and cancel commands
548  if ($this->checkPermissionBool("write")) {
549  if ($a_mode == "create") {
550  $this->form->addCommandButton("save", $lng->txt("save"));
551  $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
552  $this->form->setTitle($lng->txt("skmg_create_" . $this->getType()));
553  } else {
554  $this->form->addCommandButton("update", $lng->txt("save"));
555  $this->form->setTitle($lng->txt("skmg_edit_" . $this->getType()));
556  }
557  }
558 
559  $ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
560  $this->form->setFormAction($ilCtrl->getFormAction($this));
561  }
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 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 636 of file class.ilSkillTreeNodeGUI.php.

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

637  {
640 
641  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
642  $nodes = ilSkillTreeNode::insertItemsFromClip("skll", (int) $_GET["obj_id"]);
643  $this->redirectToParent();
644  }
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 649 of file class.ilSkillTreeNodeGUI.php.

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

650  {
653 
654  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
655  $nodes = ilSkillTreeNode::insertItemsFromClip("scat", (int) $_GET["obj_id"]);
656  $this->redirectToParent();
657  }
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 675 of file class.ilSkillTreeNodeGUI.php.

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

676  {
679 
680  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
681  $nodes = ilSkillTreeNode::insertItemsFromClip("sktp", (int) $_GET["obj_id"]);
682  $this->redirectToParent();
683  }
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 688 of file class.ilSkillTreeNodeGUI.php.

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

689  {
692 
693  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
694  $nodes = ilSkillTreeNode::insertItemsFromClip("sctp", (int) $_GET["obj_id"]);
695  $this->redirectToParent();
696  }
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 662 of file class.ilSkillTreeNodeGUI.php.

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

663  {
666 
667  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
668  $nodes = ilSkillTreeNode::insertItemsFromClip("sktr", (int) $_GET["obj_id"]);
669  $this->redirectToParent();
670  }
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 580 of file class.ilSkillTreeNodeGUI.php.

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

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

581  {
583 
584  if ($_GET["tmpmode"]) {
585  $a_tmp_mode = true;
586  }
587 
588  $t = ilSkillTreeNode::_lookupType((int) $_GET["obj_id"]);
589 
590  switch ($t) {
591  case "skrt":
592  $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id", (int) $_GET["obj_id"]);
593  if ($a_tmp_mode) {
594  $ilCtrl->redirectByClass("ilskillrootgui", "listTemplates");
595  } else {
596  $ilCtrl->redirectByClass("ilskillrootgui", "listSkills");
597  }
598  break;
599 
600  case "sctp":
601  $ilCtrl->setParameterByClass("ilskilltemplatecategorygui", "obj_id", (int) $_GET["obj_id"]);
602  $ilCtrl->redirectByClass("ilskilltemplatecategorygui", "listItems");
603  break;
604 
605  case "scat":
606  $ilCtrl->setParameterByClass("ilskillcategorygui", "obj_id", (int) $_GET["obj_id"]);
607  $ilCtrl->redirectByClass("ilskillcategorygui", "listItems");
608  break;
609  }
610  }
$_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 438 of file class.ilSkillTreeNodeGUI.php.

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

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

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

616  {
618  $lng = $this->lng;
619 
620  if (!$this->checkPermissionBool("write")) {
621  return;
622  }
623 
625  (int) $_GET["obj_id"],
626  $_POST["order"],
627  (int) $_GET["tmpmode"]
628  );
629  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
630  $this->redirectToParent((int) $_GET["tmpmode"]);
631  }
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, $tpl, 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  }
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: 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 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 $tpl.

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  }
Skill tree.
+ Here is the caller graph for this function:

◆ setTitleIcon()

ilSkillTreeNodeGUI::setTitleIcon ( )

Set title icon.

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

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

702  {
703  $tpl = $this->tpl;
704 
705  $obj_id = (is_object($this->node_object))
706  ? $this->node_object->getId()
707  :0;
708  $tpl->setTitleIcon(
710  $obj_id,
711  $this->getType(),
712  "",
714  )
715  );
716  }
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 744 of file class.ilSkillTreeNodeGUI.php.

References $tab, and $tpl.

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

◆ update()

ilSkillTreeNodeGUI::update ( )

Update skill tree node.

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

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

478  {
479  $tpl = $this->tpl;
480  $lng = $this->lng;
482 
483  if (!$this->checkPermissionBool("write")) {
484  return;
485  }
486 
487  $this->initForm("edit");
488  if ($this->form->checkInput()) {
489  $this->updateItem();
490  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
491  $this->afterUpdate();
492  } else {
493  $this->form->setValuesByPost();
494  $tpl->setContent($this->form->getHtml());
495  }
496  }
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: