ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilSkillTreeNode Class Reference

A node in the skill tree. More...

+ Inheritance diagram for ilSkillTreeNode:
+ Collaboration diagram for ilSkillTreeNode:

Public Member Functions

 __construct ($a_id=0)
 
 setTitle ($a_title)
 Set title. More...
 
 getTitle ()
 Get title. More...
 
 setDescription ($a_description)
 Set description. More...
 
 getDescription ()
 Get description. More...
 
 setType ($a_type)
 Set type. More...
 
 getType ()
 Get type. More...
 
 setId ($a_id)
 Set Node ID. More...
 
 getId ()
 Get Node ID. More...
 
 setSelfEvaluation ($a_val)
 Set self evaluation. More...
 
 getSelfEvaluation ()
 Get self evaluation. More...
 
 setOrderNr ($a_val)
 Set order nr. More...
 
 getOrderNr ()
 Get order nr. More...
 
 setImportId ($a_val)
 Set import id. More...
 
 getImportId ()
 Get import id. More...
 
 getCreationDate ()
 Get creation date. More...
 
 read ()
 Read Data of Node. More...
 
 setDataRecord ($a_record)
 this method should only be called by class ilSCORM2004NodeFactory More...
 
 setStatus ($a_val)
 Set status. More...
 
 getStatus ()
 Get status. More...
 
 create ()
 Create Node. More...
 
 update ()
 Update Node. More...
 
 delete ()
 Delete Node. More...
 

Static Public Member Functions

static getAllStatus ()
 Get all status. More...
 
static getStatusInfo ($a_status)
 Get status info. More...
 
static _lookupTitle ($a_obj_id, $a_tref_id=0)
 Lookup Title. More...
 
static _lookupDescription ($a_obj_id)
 Lookup Description. More...
 
static _lookupSelfEvaluation ($a_obj_id)
 Lookup self evaluation. More...
 
static _lookupStatus ($a_obj_id)
 Lookup Status. More...
 
static _lookupType ($a_obj_id)
 Lookup Type. More...
 
static _writeTitle ($a_obj_id, $a_title)
 Write Title. More...
 
static _writeDescription ($a_obj_id, $a_description)
 Write Description. More...
 
static _writeOrderNr ($a_obj_id, $a_nr)
 Write Order Nr. More...
 
static putInTree ($a_obj, $a_parent_id="", $a_target_node_id="")
 Put this object into the skill tree. More...
 
static getTree ($a_slm_obj_id)
 Get scorm module editing tree. More...
 
static uniqueTypesCheck ($a_items)
 Check for unique types. More...
 
static clipboardCut ($a_tree_id, $a_ids)
 Cut and copy a set of skills/skill categories into the clipboard. More...
 
static clipboardCopy ($a_tree_id, $a_ids)
 Copy a set of skills/skill categories into the clipboard. More...
 
static insertItemsFromClip ($a_type, $a_obj_id)
 Insert basic skills from clipboard. More...
 
static clearClipboard ()
 Remove all skill items from clipboard. More...
 
static pasteTree ( $a_item_id, $a_parent_id, $a_target, $a_insert_time, &$a_copied_nodes, $a_as_copy=false, $a_add_suffix=false)
 Paste item (tree) from clipboard to skill tree. More...
 
static isInTree ($a_id)
 Is id in tree? More...
 
static getAllSelfEvaluationNodes ()
 Get all self evaluation nodes. More...
 
static getTopTemplates ()
 Get top skill templates and template categories. More...
 
static getSelectableSkills ()
 Get selectable skills. More...
 
static saveChildsOrder ($a_par_id, $a_childs_order, $a_templates=false)
 Save childs order. More...
 
static getIconPath ($a_obj_id, $a_type, $a_size="", $a_status=0)
 Get icon path. More...
 
static findSkills ($a_term)
 Find skills. More...
 
static getAllCSkillIdsForNodeIds (array $a_node_ids)
 Get all possible common skill IDs for node IDs. More...
 

Data Fields

const STATUS_PUBLISH = 0
 
const STATUS_DRAFT = 1
 
const STATUS_OUTDATED = 2
 
 $type
 
 $id
 
 $title
 
 $description
 

Protected Member Functions

 setCreationDate ($a_val)
 Set creation date. More...
 

Static Protected Member Functions

static _lookup ($a_obj_id, $a_field)
 Lookup Title. More...
 

Protected Attributes

 $db
 

Detailed Description

A node in the skill tree.

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.ilSkillTreeNode.php.

Constructor & Destructor Documentation

◆ __construct()

ilSkillTreeNode::__construct (   $a_id = 0)
Parameters
intnode id

Definition at line 33 of file class.ilSkillTreeNode.php.

References $DIC, and read().

34  {
35  global $DIC;
36 
37  $this->db = $DIC->database();
38  $this->id = $a_id;
39 
40  $this->skill_tree = new ilSkillTree();
41 
42  if ($a_id != 0) {
43  $this->read();
44  }
45  }
Skill tree.
read()
Read Data of Node.
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

Member Function Documentation

◆ _lookup()

static ilSkillTreeNode::_lookup (   $a_obj_id,
  $a_field 
)
staticprotected

Lookup Title.

Parameters
intNode ID
Returns
string Title

Definition at line 282 of file class.ilSkillTreeNode.php.

References $DIC, $ilDB, and $query.

283  {
284  global $DIC;
285 
286  $ilDB = $DIC->database();
287 
288  $query = "SELECT $a_field FROM skl_tree_node WHERE obj_id = " .
289  $ilDB->quote($a_obj_id, "integer");
290  $obj_set = $ilDB->query($query);
291  $obj_rec = $ilDB->fetchAssoc($obj_set);
292 
293  return $obj_rec[$a_field];
294  }
$query
global $ilDB
$DIC
Definition: xapitoken.php:46

◆ _lookupDescription()

static ilSkillTreeNode::_lookupDescription (   $a_obj_id)
static

Lookup Description.

Parameters
intnode ID
Returns
string description

Definition at line 321 of file class.ilSkillTreeNode.php.

References $DIC, and $ilDB.

Referenced by ilPersonalSkillsGUI\getSkillCategoryDescription(), and ilSkillTemplateReferenceGUI\initForm().

322  {
323  global $DIC;
324 
325  $ilDB = $DIC->database();
326 
327  return self::_lookup($a_obj_id, "description");
328  }
global $ilDB
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ _lookupSelfEvaluation()

static ilSkillTreeNode::_lookupSelfEvaluation (   $a_obj_id)
static

Lookup self evaluation.

Parameters
intnode ID
Returns
boolean selectable? (self evaluation=

Definition at line 336 of file class.ilSkillTreeNode.php.

References $DIC, and $ilDB.

Referenced by ilPersonalSkillExplorerGUI\buildSelectableTree(), ilSkillTreeExplorerGUI\getNodeContent(), ilSkillTemplateTreeExplorerGUI\getNodeContent(), and ilPersonalSkillExplorerGUI\isNodeClickable().

337  {
338  global $DIC;
339 
340  $ilDB = $DIC->database();
341 
342  return self::_lookup($a_obj_id, "self_eval");
343  }
global $ilDB
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ _lookupStatus()

static ilSkillTreeNode::_lookupStatus (   $a_obj_id)
static

Lookup Status.

Parameters
int$a_obj_idnode ID
Returns
int status

Definition at line 351 of file class.ilSkillTreeNode.php.

References $DIC, and $ilDB.

Referenced by ilPersonalSkillExplorerGUI\buildSelectableTree(), ilSkillCatTableGUI\fillRow(), ilSkillTemplateTreeExplorerGUI\getChildsOfNode(), ilVirtualSkillTree\getChildsOfNode(), and ilSkillTreeNodeGUI\setTitleIcon().

352  {
353  global $DIC;
354 
355  $ilDB = $DIC->database();
356 
357  return self::_lookup($a_obj_id, "status");
358  }
global $ilDB
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ _lookupTitle()

static ilSkillTreeNode::_lookupTitle (   $a_obj_id,
  $a_tref_id = 0 
)
static

Lookup Title.

Parameters
intnode ID
Returns
string title

Definition at line 302 of file class.ilSkillTreeNode.php.

References $DIC, $ilDB, and ilSkillTemplateReference\_lookupTemplateId().

Referenced by ilSurveySkillThresholdsTableGUI\__construct(), ilSkillUsageTableGUI\__construct(), ilPersonalSkillsGUI\assignMaterials(), clipboardCopy(), ilTestSkillLevelThresholdsTableGUI\completeCompetenceTitles(), ilSkillProfileGUI\confirmLevelAssignmentRemoval(), ilContSkillAdminGUI\confirmRemoveSelectedSkill(), ilSkillSelfEvaluationGUI\confirmSelfEvaluationDeletion(), ilPersonalSkillsGUI\confirmSkillRemove(), ilSelfEvaluationTableGUI\fillRow(), ilSurveySkillTableGUI\fillRow(), ilSurveySkillAssignmentTableGUI\fillRow(), ilContSkillMemberTableGUI\fillRow(), ilSurveySkill\getAllAssignedSkillsAsOptions(), ilSkillLearningHistoryProvider\getEntries(), ilTestSkillLevelThresholdImportFails\getFailedImportsMessage(), ilPersonalSkillsGUI\getGapAnalysisHTML(), ilSkillTreeExplorerGUI\getNodeContent(), ilSkillTemplateTreeExplorerGUI\getNodeContent(), ilPersonalSkill\getSelectedUserSkills(), ilSurveySkillTableGUI\getSkills(), ilContSkillTableGUI\getSkills(), ilContSkillAdminGUI\initCompetenceAssignmentForm(), ilObjPortfolioGUI\initCreatePortfolioFromTemplateForm(), ilAssQuestionSkillAssignment\loadAdditionalSkillData(), ilPersonalSkillsGUI\renderSkillHTML(), ilPortfolioPageGUI\renderSkillsTeaser(), ilPersonalSkillsGUI\selfEvaluation(), ilSkillNotifications\sendMail(), and ilSkillTemplateReferenceGUI\setTabs().

303  {
304  global $DIC;
305 
306  $ilDB = $DIC->database();
307 
308  include_once("./Services/Skill/classes/class.ilSkillTemplateReference.php");
309  if ($a_tref_id > 0 && ilSkillTemplateReference::_lookupTemplateId($a_tref_id) == $a_obj_id) {
310  return self::_lookup($a_tref_id, "title");
311  }
312  return self::_lookup($a_obj_id, "title");
313  }
static _lookupTemplateId($a_obj_id)
Lookup template ID.
global $ilDB
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupType()

static ilSkillTreeNode::_lookupType (   $a_obj_id)
static

◆ _writeDescription()

static ilSkillTreeNode::_writeDescription (   $a_obj_id,
  $a_description 
)
static

Write Description.

Parameters
intNode ID
stringDescription

Definition at line 425 of file class.ilSkillTreeNode.php.

References $DIC, $ilDB, and $query.

426  {
427  global $DIC;
428 
429  $ilDB = $DIC->database();
430 
431  $query = "UPDATE skl_tree_node SET " .
432  " description = " . $ilDB->quote($a_description, "clob") .
433  " WHERE obj_id = " . $ilDB->quote($a_obj_id, "integer");
434 
435  $ilDB->manipulate($query);
436  }
$query
global $ilDB
$DIC
Definition: xapitoken.php:46

◆ _writeOrderNr()

static ilSkillTreeNode::_writeOrderNr (   $a_obj_id,
  $a_nr 
)
static

Write Order Nr.

Parameters
intNode ID
stringOrder Nr

Definition at line 444 of file class.ilSkillTreeNode.php.

References $DIC, $ilDB, and $query.

Referenced by saveChildsOrder().

445  {
446  global $DIC;
447 
448  $ilDB = $DIC->database();
449 
450  $query = "UPDATE skl_tree_node SET " .
451  " order_nr = " . $ilDB->quote($a_nr, "integer") .
452  " WHERE obj_id = " . $ilDB->quote($a_obj_id, "integer");
453  $ilDB->manipulate($query);
454  }
$query
global $ilDB
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ _writeTitle()

static ilSkillTreeNode::_writeTitle (   $a_obj_id,
  $a_title 
)
static

Write Title.

Parameters
intNode ID
stringTitle

Definition at line 406 of file class.ilSkillTreeNode.php.

References $DIC, $ilDB, and $query.

Referenced by ilObjSkillManagementGUI\saveAllTemplateTitles(), and ilObjSkillManagementGUI\saveAllTitles().

407  {
408  global $DIC;
409 
410  $ilDB = $DIC->database();
411 
412  $query = "UPDATE skl_tree_node SET " .
413  " title = " . $ilDB->quote($a_title, "text") .
414  " WHERE obj_id = " . $ilDB->quote($a_obj_id, "integer");
415 
416  $ilDB->manipulate($query);
417  }
$query
global $ilDB
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ clearClipboard()

static ilSkillTreeNode::clearClipboard ( )
static

Remove all skill items from clipboard.

Parameters

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

References $DIC, $ilUser, and ilEditClipboard\clear().

739  {
740  global $DIC;
741 
742  $ilUser = $DIC->user();
743 
744  $ilUser->clipboardDeleteObjectsOfType("skll");
745  $ilUser->clipboardDeleteObjectsOfType("scat");
746  $ilUser->clipboardDeleteObjectsOfType("sktr");
747  $ilUser->clipboardDeleteObjectsOfType("sktp");
748  $ilUser->clipboardDeleteObjectsOfType("sctp");
749  include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
751  }
$ilUser
Definition: imgupload.php:18
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ clipboardCopy()

static ilSkillTreeNode::clipboardCopy (   $a_tree_id,
  $a_ids 
)
static

Copy a set of skills/skill categories into the clipboard.

Definition at line 635 of file class.ilSkillTreeNode.php.

References $DIC, $id, $ilUser, _lookupTitle(), and _lookupType().

Referenced by clipboardCut(), and ilSkillTreeNodeGUI\copyItems().

636  {
637  global $DIC;
638 
639  $ilUser = $DIC->user();
640 
641  self::clearClipboard();
642  include_once("./Services/Skill/classes/class.ilSkillTree.php");
643  $tree = new ilSkillTree();
644 
645  // put them into the clipboard
646  $time = date("Y-m-d H:i:s", time());
647  foreach ($a_ids as $id) {
648  $curnode = "";
649  if ($tree->isInTree($id)) {
650  $curnode = $tree->getNodeData($id);
651  $subnodes = $tree->getSubTree($curnode);
652  foreach ($subnodes as $subnode) {
653  if ($subnode["child"] != $id) {
654  $ilUser->addObjectToClipboard(
655  $subnode["child"],
656  $subnode["type"],
657  $subnode["title"],
658  $subnode["parent"],
659  $time,
660  $subnode["lft"]
661  );
662  }
663  }
664  }
665  $order = ($curnode["lft"] > 0)
666  ? $curnode["lft"]
667  : (int) ($order + 1);
668  $ilUser->addObjectToClipboard(
669  $id,
672  0,
673  $time,
674  $order
675  );
676  }
677  }
Skill tree.
static _lookupType($a_obj_id)
Lookup Type.
$ilUser
Definition: imgupload.php:18
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clipboardCut()

static ilSkillTreeNode::clipboardCut (   $a_tree_id,
  $a_ids 
)
static

Cut and copy a set of skills/skill categories into the clipboard.

Definition at line 594 of file class.ilSkillTreeNode.php.

References $id, and clipboardCopy().

Referenced by ilSkillTreeNodeGUI\cutItems().

595  {
596  self::clearClipboard();
597  include_once("./Services/Skill/classes/class.ilSkillTree.php");
598  $tree = new ilSkillTree();
599 
600  if (!is_array($a_ids)) {
601  return false;
602  } else {
603  // get all "top" ids, i.e. remove ids, that have a selected parent
604  foreach ($a_ids as $id) {
605  $path = $tree->getPathId($id);
606  $take = true;
607  foreach ($path as $path_id) {
608  if ($path_id != $id && in_array($path_id, $a_ids)) {
609  $take = false;
610  }
611  }
612  if ($take) {
613  $cut_ids[] = $id;
614  }
615  }
616  }
617 
618  ilSkillTreeNode::clipboardCopy($a_tree_id, $cut_ids);
619 
620  // remove the objects from the tree
621  // note: we are getting skills/categories which are *not* in the tree
622  // we do not delete any pages/chapters here
623  foreach ($cut_ids as $id) {
624  $curnode = $tree->getNodeData($id);
625  if ($tree->isInTree($id)) {
626  $tree->deleteTree($curnode);
627  }
628  }
629  }
Skill tree.
static clipboardCopy($a_tree_id, $a_ids)
Copy a set of skills/skill categories into the clipboard.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

ilSkillTreeNode::create ( )

Create Node.

Parameters
booleanUpload Mode

Definition at line 461 of file class.ilSkillTreeNode.php.

References $db, $id, $ilDB, $query, getDescription(), getImportId(), getOrderNr(), getSelfEvaluation(), getStatus(), getTitle(), getType(), and setId().

462  {
463  $ilDB = $this->db;
464 
465  // insert object data
466  $id = $ilDB->nextId("skl_tree_node");
467  $query = "INSERT INTO skl_tree_node (obj_id, title, description, type, create_date, self_eval, order_nr, status, creation_date, import_id) " .
468  "VALUES (" .
469  $ilDB->quote($id, "integer") . "," .
470  $ilDB->quote($this->getTitle(), "text") . "," .
471  $ilDB->quote($this->getDescription(), "clob") . "," .
472  $ilDB->quote($this->getType(), "text") . ", " .
473  $ilDB->now() . ", " .
474  $ilDB->quote((int) $this->getSelfEvaluation(), "integer") . ", " .
475  $ilDB->quote((int) $this->getOrderNr(), "integer") . ", " .
476  $ilDB->quote((int) $this->getStatus(), "integer") . ", " .
477  $ilDB->now() . ", " .
478  $ilDB->quote($this->getImportId(), "text") .
479  ")";
480  $ilDB->manipulate($query);
481  $this->setId($id);
482  }
getDescription()
Get description.
setId($a_id)
Set Node ID.
getSelfEvaluation()
Get self evaluation.
getImportId()
Get import id.
getOrderNr()
Get order nr.
$query
global $ilDB
+ Here is the call graph for this function:

◆ delete()

ilSkillTreeNode::delete ( )

Delete Node.

Definition at line 506 of file class.ilSkillTreeNode.php.

References $db, $ilDB, $query, and getId().

507  {
508  $ilDB = $this->db;
509 
510  $query = "DELETE FROM skl_tree_node WHERE obj_id= " .
511  $ilDB->quote($this->getId(), "integer");
512  $ilDB->manipulate($query);
513  }
$query
global $ilDB
+ Here is the call graph for this function:

◆ findSkills()

static ilSkillTreeNode::findSkills (   $a_term)
static

Find skills.

Parameters

Definition at line 987 of file class.ilSkillTreeNode.php.

References Vendor\Package\$c, $DIC, $ilDB, $res, ilSkillTemplateReference\_lookupTemplateId(), and ilSkillTemplateReference\_lookupTrefIdsForTopTemplateId().

Referenced by ilPublicUserProfileGUI\getAutocompleteResult().

988  {
989  global $DIC;
990 
991  $ilDB = $DIC->database();
992 
993  $res = array();
994  $candidates = array();
995 
996  $skill_tree = new ilSkillTree();
997 
998  $sql = "SELECT * " .
999  " FROM skl_tree_node" .
1000  " WHERE " . $ilDB->like("title", "text", "%" . $a_term . "%");
1001  $sql .= " ORDER BY title";
1002  $set = $ilDB->query($sql);
1003  include_once("./Services/Skill/classes/class.ilSkillTemplateReference.php");
1004  while ($row = $ilDB->fetchAssoc($set)) {
1005  if (in_array($row["type"], array("sctp", "sktp"))) {
1006  // need to get "top template" first! (if it is already the top level, do not use it!)
1007  $path = $skill_tree->getSkillTreePath($row["obj_id"]);
1008  if ($path[1]["child"] != $row["obj_id"]) {
1010  foreach ($trefs as $tref) {
1011  $candidates[] = array("tref_id" => $tref, "skill_id" => $row["obj_id"], "title" => $row["title"]);
1012  }
1013  }
1014  } elseif ($row["type"] == "sktr") {
1015  // works
1016  $candidates[] = array("tref_id" => $row["obj_id"], "skill_id" => ilSkillTemplateReference::_lookupTemplateId($row["obj_id"]), "title" => $row["title"]);
1017  } else {
1018  // works
1019  $candidates[] = array("tref_id" => 0, "skill_id" => $row["obj_id"], "title" => $row["title"]);
1020  }
1021  }
1022 
1023  foreach ($candidates as $c) {
1024  // if we get a path array, and the array has items try to use the data
1025  $path = $skill_tree->getSkillTreePath($c["skill_id"], $c["tref_id"]);
1026  $use = false;
1027  if (is_array($path) && count($path) > 0) {
1028  $use = true;
1029  }
1030 
1031  // if any inactive/outdated -> do not use the data
1032  if (is_array($path)) {
1033  foreach ($path as $p) {
1034  if ($p["status"] > 0) {
1035  $use = false;
1036  }
1037  }
1038  }
1039  if ($use) {
1040  if (!in_array($c["title"], $res)) {
1041  $res[] = $c["title"];
1042  }
1043  }
1044  }
1045 
1046 
1047  return $res;
1048  }
Skill tree.
foreach($_POST as $key=> $value) $res
static _lookupTemplateId($a_obj_id)
Lookup template ID.
static _lookupTrefIdsForTopTemplateId($a_template_id)
Lookup tref ids for template id.
global $ilDB
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAllCSkillIdsForNodeIds()

static ilSkillTreeNode::getAllCSkillIdsForNodeIds ( array  $a_node_ids)
static

Get all possible common skill IDs for node IDs.

Parameters
array$a_node_idsarray of node ids
Returns
array array of skill ids

Definition at line 1056 of file class.ilSkillTreeNode.php.

References $id, ilSkillTemplateReference\_lookupTemplateId(), ilSkillTemplateReference\_lookupTrefIdsForTemplateId(), and _lookupType().

Referenced by ilSkillTreeNodeGUI\isInUse().

1057  {
1058  include_once("./Services/Skill/classes/class.ilSkillTemplateReference.php");
1059  $cskill_ids = array();
1060  foreach ($a_node_ids as $id) {
1061  if (in_array(self::_lookupType($id), array("skll", "scat", "sktr"))) {
1062  $skill_id = $id;
1063  $tref_id = 0;
1064  if (ilSkillTreeNode::_lookupType($id) == "sktr") {
1066  $tref_id = $id;
1067  }
1068  $cskill_ids[] = array("skill_id" => $skill_id, "tref_id" => $tref_id);
1069  }
1070  if (in_array(ilSkillTreeNode::_lookupType($id), array("sktp", "sctp"))) {
1071  foreach (ilSkillTemplateReference::_lookupTrefIdsForTemplateId($id) as $tref_id) {
1072  $cskill_ids[] = array("skill_id" => $id, "tref_id" => $tref_id);
1073  }
1074  }
1075  // for cats, skills and template references, get "real" usages
1076  // for skill and category templates check usage in references
1077  }
1078  return $cskill_ids;
1079  }
static _lookupTrefIdsForTemplateId($a_tid)
Get all tref ids for a template id.
static _lookupType($a_obj_id)
Lookup Type.
static _lookupTemplateId($a_obj_id)
Lookup template ID.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAllSelfEvaluationNodes()

static ilSkillTreeNode::getAllSelfEvaluationNodes ( )
static

Get all self evaluation nodes.

Parameters

Definition at line 848 of file class.ilSkillTreeNode.php.

References $DIC, and $ilDB.

Referenced by ilSkillSelfEvaluationGUI\listSelfEvaluations().

849  {
850  global $DIC;
851 
852  $ilDB = $DIC->database();
853 
854  $set = $ilDB->query(
855  "SELECT obj_id, title FROM skl_tree_node WHERE " .
856  " self_eval = " . $ilDB->quote(true, "integer") . " ORDER BY TITLE "
857  );
858  $nodes = array();
859  while ($rec = $ilDB->fetchAssoc($set)) {
860  $nodes[$rec["obj_id"]] = $rec["title"];
861  }
862  return $nodes;
863  }
global $ilDB
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ getAllStatus()

static ilSkillTreeNode::getAllStatus ( )
static

Get all status.

Returns
array array of status, key is value, value is lang text

Definition at line 212 of file class.ilSkillTreeNode.php.

References $DIC, and $lng.

Referenced by ilSkillTreeNodeGUI\addStatusInput().

213  {
214  global $DIC;
215 
216  $lng = $DIC->language();
217 
218  return array(
219  self::STATUS_DRAFT => $lng->txt("skmg_status_draft"),
220  self::STATUS_PUBLISH => $lng->txt("skmg_status_publish"),
221  self::STATUS_OUTDATED => $lng->txt("skmg_status_outdated")
222  );
223  }
$lng
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ getCreationDate()

ilSkillTreeNode::getCreationDate ( )

Get creation date.

Returns
string creation date

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

203  {
204  return $this->creation_date;
205  }

◆ getDescription()

ilSkillTreeNode::getDescription ( )

Get description.

Returns
string description

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

References $description.

Referenced by ilBasicSkillTemplate\copy(), ilSkillTemplateCategory\copy(), ilSkillCategory\copy(), ilBasicSkill\copy(), ilSkillTemplateReference\copy(), create(), and update().

83  {
84  return $this->description;
85  }
+ Here is the caller graph for this function:

◆ getIconPath()

static ilSkillTreeNode::getIconPath (   $a_obj_id,
  $a_type,
  $a_size = "",
  $a_status = 0 
)
static

Get icon path.

Parameters
int$a_obj_idnode id
string$a_typenode type
string$a_sizesize
int$a_statusstatus
Returns
string icon path

Definition at line 955 of file class.ilSkillTreeNode.php.

References $a_type, $type, ilSkillTemplateReference\_lookupTemplateId(), _lookupType(), ilUtil\getImagePath(), and ILIAS_VERSION.

Referenced by ilSkillCatTableGUI\fillRow(), ilSkillTreeExplorerGUI\getNodeIcon(), ilSkillTemplateTreeExplorerGUI\getNodeIcon(), ilBasicSkillTemplateGUI\setLevelHead(), and ilSkillTreeNodeGUI\setTitleIcon().

956  {
957  if ($a_status == self::STATUS_DRAFT && $a_type == "sctp") {
958  $a_type = "scat";
959  }
960  if ($a_status == self::STATUS_DRAFT && $a_type == "sktp") {
961  $a_type = "skll";
962  }
963 
964  $off = ($a_status == self::STATUS_DRAFT)
965  ? "_off"
966  : "";
967 
968  $a_name = "icon_" . $a_type . $a_size . $off . ".svg";
969  if ($a_type == "sktr") {
970  include_once("./Services/Skill/classes/class.ilSkillTemplateReference.php");
973  if ($type == "sctp") {
974  $a_name = "icon_sctr" . $a_size . $off . ".svg";
975  }
976  }
977  $vers = "vers=" . str_replace(array(".", " "), "-", ILIAS_VERSION);
978  return ilUtil::getImagePath($a_name) . "?" . $vers;
979  }
const ILIAS_VERSION
static _lookupType($a_obj_id)
Lookup Type.
$a_type
Definition: workflow.php:92
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _lookupTemplateId($a_obj_id)
Lookup template ID.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getId()

ilSkillTreeNode::getId ( )

Get Node ID.

Parameters
intNode ID

Definition at line 122 of file class.ilSkillTreeNode.php.

References $id.

Referenced by ilBasicSkill\addLevel(), delete(), ilBasicSkill\getLastLevelPerObject(), ilBasicSkill\getLastUpdatePerObject(), ilBasicSkill\getMaxLevelPerObject(), ilBasicSkill\getMaxLevelPerType(), and update().

123  {
124  return $this->id;
125  }
+ Here is the caller graph for this function:

◆ getImportId()

ilSkillTreeNode::getImportId ( )

Get import id.

Returns
string import id

Definition at line 182 of file class.ilSkillTreeNode.php.

Referenced by create(), and update().

183  {
184  return $this->import_id;
185  }
+ Here is the caller graph for this function:

◆ getOrderNr()

ilSkillTreeNode::getOrderNr ( )

Get order nr.

Returns
int order nr

Definition at line 162 of file class.ilSkillTreeNode.php.

Referenced by ilBasicSkillTemplate\copy(), ilSkillTemplateCategory\copy(), ilSkillCategory\copy(), ilBasicSkill\copy(), ilSkillTemplateReference\copy(), create(), and update().

163  {
164  return $this->order_nr;
165  }
+ Here is the caller graph for this function:

◆ getSelectableSkills()

static ilSkillTreeNode::getSelectableSkills ( )
static

Get selectable skills.

Parameters

Definition at line 885 of file class.ilSkillTreeNode.php.

References $DIC, and $ilDB.

886  {
887  global $DIC;
888 
889  $ilDB = $DIC->database();
890 
891  $set = $ilDB->query(
892  "SELECT * FROM skl_tree_node " .
893  " WHERE self_eval = " . $ilDB->quote(1, "integer")
894  );
895 
896  $sel_skills = array();
897  while ($rec = $ilDB->fetchAssoc($set)) {
898  $sel_skills[] = $rec;
899  }
900 
901  return $sel_skills;
902  }
global $ilDB
$DIC
Definition: xapitoken.php:46

◆ getSelfEvaluation()

ilSkillTreeNode::getSelfEvaluation ( )

Get self evaluation.

Returns
boolean self evaluation

Definition at line 142 of file class.ilSkillTreeNode.php.

Referenced by ilSkillCategory\copy(), ilBasicSkill\copy(), ilSkillTemplateReference\copy(), create(), and update().

143  {
144  return $this->self_eval;
145  }
+ Here is the caller graph for this function:

◆ getStatus()

ilSkillTreeNode::getStatus ( )

Get status.

Returns
int status

Definition at line 395 of file class.ilSkillTreeNode.php.

Referenced by create(), and update().

396  {
397  return $this->status;
398  }
+ Here is the caller graph for this function:

◆ getStatusInfo()

static ilSkillTreeNode::getStatusInfo (   $a_status)
static

Get status info.

Parameters
int$a_statusstatus
Returns
string info text

Definition at line 231 of file class.ilSkillTreeNode.php.

References $DIC, and $lng.

Referenced by ilSkillTreeNodeGUI\addStatusInput().

232  {
233  global $DIC;
234 
235  $lng = $DIC->language();
236 
237  switch ($a_status) {
238  case self::STATUS_PUBLISH: return $lng->txt("skmg_status_publish_info");
239  case self::STATUS_DRAFT: return $lng->txt("skmg_status_draft_info");
240  case self::STATUS_OUTDATED: return $lng->txt("skmg_status_outdated_info");
241  }
242  return "";
243  }
$lng
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ getTitle()

ilSkillTreeNode::getTitle ( )

Get title.

Returns
string title

Definition at line 62 of file class.ilSkillTreeNode.php.

References $title.

Referenced by ilBasicSkillTemplate\copy(), ilSkillTemplateCategory\copy(), ilSkillCategory\copy(), ilBasicSkill\copy(), ilSkillTemplateReference\copy(), create(), ilBasicSkill\getTitleForCertificate(), and update().

63  {
64  return $this->title;
65  }
+ Here is the caller graph for this function:

◆ getTopTemplates()

static ilSkillTreeNode::getTopTemplates ( )
static

Get top skill templates and template categories.

Parameters

Definition at line 871 of file class.ilSkillTreeNode.php.

Referenced by ilSkillTemplateReferenceGUI\initForm().

872  {
873  $tr = new ilSkillTree();
874  $childs = $tr->getChildsByTypeFilter($tr->getRootId(), array("sktp", "sctp"));
875 
876  return $childs;
877  }
Skill tree.
+ Here is the caller graph for this function:

◆ getTree()

static ilSkillTreeNode::getTree (   $a_slm_obj_id)
static

Get scorm module editing tree.

Parameters
intscorm module object id
Returns
object tree object

Definition at line 565 of file class.ilSkillTreeNode.php.

566  {
567  $tree = new ilSkillTree();
568 
569  return $tree;
570  }
Skill tree.

◆ getType()

ilSkillTreeNode::getType ( )

Get type.

Returns
string Type

Definition at line 102 of file class.ilSkillTreeNode.php.

References $type.

Referenced by ilBasicSkillTemplate\copy(), ilSkillTemplateCategory\copy(), ilSkillCategory\copy(), ilBasicSkill\copy(), ilSkillTemplateReference\copy(), and create().

103  {
104  return $this->type;
105  }
+ Here is the caller graph for this function:

◆ insertItemsFromClip()

static ilSkillTreeNode::insertItemsFromClip (   $a_type,
  $a_obj_id 
)
static

Insert basic skills from clipboard.

Definition at line 683 of file class.ilSkillTreeNode.php.

References $a_type, $DIC, $ilCtrl, $ilUser, ilEditClipboard\getAction(), IL_LAST_NODE, pasteTree(), and saveChildsOrder().

Referenced by ilSkillTreeNodeGUI\insertBasicSkillClip(), ilSkillTreeNodeGUI\insertSkillCategoryClip(), ilSkillTreeNodeGUI\insertSkillTemplateClip(), ilSkillTreeNodeGUI\insertTemplateCategoryClip(), and ilSkillTreeNodeGUI\insertTemplateReferenceClip().

684  {
685  global $DIC;
686 
687  $ilCtrl = $DIC->ctrl();
688  $ilUser = $DIC->user();
689 
690  // @todo: move this to a service since it can be used here, too
691  include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
692 
693  include_once("./Services/Skill/classes/class.ilSkillTree.php");
694  $tree = new ilSkillTree();
695 
696  $parent_id = $a_obj_id;
697  $target = IL_LAST_NODE;
698 
699  // cut and paste
700  $skills = $ilUser->getClipboardObjects($a_type); // this will get all skills _regardless_ of level
701  $copied_nodes = array();
702  foreach ($skills as $skill) {
703  // if skill was already copied as part of tree - do not copy it again
704  if (!in_array($skill["id"], array_keys($copied_nodes))) {
706  $skill["id"],
707  $parent_id,
708  $target,
709  $skill["insert_time"],
710  $copied_nodes,
711  (ilEditClipboard::getAction() == "copy"),
712  true
713  );
714  // $target = $cid;
715  }
716  }
717 
718  // if (ilEditClipboard::getAction() == "cut")
719  // {
720  self::clearClipboard();
721  // }
722 
724  $a_obj_id,
725  array(),
726  in_array($a_type, array("sktp", "sctp"))
727  );
728 
729  return $copied_nodes;
730  }
Skill tree.
global $ilCtrl
Definition: ilias.php:18
$a_type
Definition: workflow.php:92
$ilUser
Definition: imgupload.php:18
static saveChildsOrder($a_par_id, $a_childs_order, $a_templates=false)
Save childs order.
const IL_LAST_NODE
Definition: class.ilTree.php:4
$DIC
Definition: xapitoken.php:46
static pasteTree( $a_item_id, $a_parent_id, $a_target, $a_insert_time, &$a_copied_nodes, $a_as_copy=false, $a_add_suffix=false)
Paste item (tree) from clipboard to skill tree.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isInTree()

static ilSkillTreeNode::isInTree (   $a_id)
static

Is id in tree?

Parameters

Definition at line 833 of file class.ilSkillTreeNode.php.

Referenced by ilBasicSkill\getSkillForLevelId().

834  {
835  $skill_tree = new ilSkillTree();
836  if ($skill_tree->isInTree($a_id)) {
837  return true;
838  }
839  return false;
840  }
Skill tree.
+ Here is the caller graph for this function:

◆ pasteTree()

static ilSkillTreeNode::pasteTree (   $a_item_id,
  $a_parent_id,
  $a_target,
  $a_insert_time,
$a_copied_nodes,
  $a_as_copy = false,
  $a_add_suffix = false 
)
static

Paste item (tree) from clipboard to skill tree.

Definition at line 757 of file class.ilSkillTreeNode.php.

References $DIC, $ilLog, $ilUser, $lng, _lookupType(), IL_LAST_NODE, and putInTree().

Referenced by insertItemsFromClip().

765  {
766  global $DIC;
767 
768  $ilUser = $DIC->user();
769  $ilLog = $DIC["ilLog"];
770  $lng = $DIC->language();
771 
772  $item_type = ilSkillTreeNode::_lookupType($a_item_id);
773 
774  if ($item_type == "scat") {
775  include_once("./Services/Skill/classes/class.ilSkillCategory.php");
776  $item = new ilSkillCategory($a_item_id);
777  } elseif ($item_type == "skll") {
778  include_once("./Services/Skill/classes/class.ilBasicSkill.php");
779  $item = new ilBasicSkill($a_item_id);
780  } elseif ($item_type == "sktr") {
781  include_once("./Services/Skill/classes/class.ilSkillTemplateReference.php");
782  $item = new ilSkillTemplateReference($a_item_id);
783  } elseif ($item_type == "sktp") {
784  include_once("./Services/Skill/classes/class.ilBasicSkillTemplate.php");
785  $item = new ilBasicSkillTemplate($a_item_id);
786  } elseif ($item_type == "sctp") {
787  include_once("./Services/Skill/classes/class.ilSkillTemplateCategory.php");
788  $item = new ilSkillTemplateCategory($a_item_id);
789  }
790 
791  $ilLog->write("Getting from clipboard type " . $item_type . ", " .
792  "Item ID: " . $a_item_id);
793 
794  if ($a_as_copy) {
795  $target_item = $item->copy();
796  if ($a_add_suffix) {
797  $target_item->setTitle($target_item->getTitle() . " " . $lng->txt("copy_of_suffix"));
798  $target_item->update();
799  }
800  $a_copied_nodes[$item->getId()] = $target_item->getId();
801  } else {
802  $target_item = $item;
803  }
804 
805  $ilLog->write("Putting into skill tree type " . $target_item->getType() .
806  "Item ID: " . $target_item->getId() . ", Parent: " . $a_parent_id . ", " .
807  "Target: " . $a_target);
808 
809  ilSkillTreeNode::putInTree($target_item, $a_parent_id, $a_target);
810 
811  $childs = $ilUser->getClipboardChilds($item->getId(), $a_insert_time);
812 
813  foreach ($childs as $child) {
815  $child["id"],
816  $target_item->getId(),
817  IL_LAST_NODE,
818  $a_insert_time,
819  $a_copied_nodes,
820  $a_as_copy
821  );
822  }
823 
824  return $target_item->getId();
825  }
static putInTree($a_obj, $a_parent_id="", $a_target_node_id="")
Put this object into the skill tree.
static _lookupType($a_obj_id)
Lookup Type.
$lng
$ilUser
Definition: imgupload.php:18
const IL_LAST_NODE
Definition: class.ilTree.php:4
$DIC
Definition: xapitoken.php:46
Basic Skill.
static pasteTree( $a_item_id, $a_parent_id, $a_target, $a_insert_time, &$a_copied_nodes, $a_as_copy=false, $a_add_suffix=false)
Paste item (tree) from clipboard to skill tree.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ putInTree()

static ilSkillTreeNode::putInTree (   $a_obj,
  $a_parent_id = "",
  $a_target_node_id = "" 
)
static

Put this object into the skill tree.

Definition at line 518 of file class.ilSkillTreeNode.php.

References IL_FIRST_NODE.

Referenced by ilSkillDataSet\importRecord(), pasteTree(), ilBasicSkillGUI\saveItem(), ilSkillCategoryGUI\saveItem(), ilSkillTemplateReferenceGUI\saveItem(), ilBasicSkillTemplateGUI\saveItem(), and ilSkillTemplateCategoryGUI\saveItem().

519  {
520  $skill_tree = new ilSkillTree();
521 
522  // determine parent
523  $parent_id = ($a_parent_id != "")
524  ? $a_parent_id
525  : $skill_tree->getRootId();
526 
527  // make a check, whether the type of object is allowed under
528  // the parent
529  $allowed = array(
530  "skrt" => array("skll", "scat", "sktr", "sktp", "sctp"),
531  "scat" => array("skll", "scat", "sktr"),
532  "sctp" => array("sktp", "sctp"));
533  $par_type = self::_lookupType($parent_id);
534  if (!is_array($allowed[$par_type]) ||
535  !in_array($a_obj->getType(), $allowed[$par_type])) {
536  return;
537  }
538 
539  // determine target
540  if ($a_target_node_id != "") {
541  $target = $a_target_node_id;
542  } else {
543  // determine last child that serves as predecessor
544  $childs = $skill_tree->getChilds($parent_id);
545 
546  if (count($childs) == 0) {
547  $target = IL_FIRST_NODE;
548  } else {
549  $target = $childs[count($childs) - 1]["obj_id"];
550  }
551  }
552 
553  if ($skill_tree->isInTree($parent_id) && !$skill_tree->isInTree($a_obj->getId())) {
554  $skill_tree->insertNode($a_obj->getId(), $parent_id, $target);
555  }
556  }
Skill tree.
const IL_FIRST_NODE
Definition: class.ilTree.php:5
+ Here is the caller graph for this function:

◆ read()

ilSkillTreeNode::read ( )

Read Data of Node.

Definition at line 248 of file class.ilSkillTreeNode.php.

References $db, $ilDB, $query, setCreationDate(), setDescription(), setImportId(), setOrderNr(), setSelfEvaluation(), setStatus(), setTitle(), and setType().

Referenced by __construct().

249  {
250  $ilDB = $this->db;
251 
252  if (!isset($this->data_record)) {
253  $query = "SELECT * FROM skl_tree_node WHERE obj_id = " .
254  $ilDB->quote($this->id, "integer");
255  $obj_set = $ilDB->query($query);
256  $this->data_record = $ilDB->fetchAssoc($obj_set);
257  }
258  $this->setType($this->data_record["type"]);
259  $this->setTitle($this->data_record["title"]);
260  $this->setDescription($this->data_record["description"]);
261  $this->setOrderNr($this->data_record["order_nr"]);
262  $this->setSelfEvaluation($this->data_record["self_eval"]);
263  $this->setStatus($this->data_record["status"]);
264  $this->setImportId($this->data_record["import_id"]);
265  $this->setCreationDate($this->data_record["creation_date"]);
266  }
setType($a_type)
Set type.
setTitle($a_title)
Set title.
setImportId($a_val)
Set import id.
setSelfEvaluation($a_val)
Set self evaluation.
$query
setCreationDate($a_val)
Set creation date.
setOrderNr($a_val)
Set order nr.
setDescription($a_description)
Set description.
global $ilDB
setStatus($a_val)
Set status.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveChildsOrder()

static ilSkillTreeNode::saveChildsOrder (   $a_par_id,
  $a_childs_order,
  $a_templates = false 
)
static

Save childs order.

Parameters

Definition at line 910 of file class.ilSkillTreeNode.php.

References Vendor\Package\$c, _writeOrderNr(), and ilUtil\sortArray().

Referenced by ilSkillTreeNodeGUI\confirmedDelete(), ilSkillTreeNodeGUI\cutItems(), insertItemsFromClip(), ilSkillTreeNodeGUI\save(), and ilSkillTreeNodeGUI\saveOrder().

911  {
912  include_once("./Services/Skill/classes/class.ilSkillTree.php");
913  $skill_tree = new ilSkillTree();
914 
915  if ($a_par_id != $skill_tree->readRootId()) {
916  $childs = $skill_tree->getChilds($a_par_id);
917  } else {
918  if ($a_templates) {
919  $childs = $skill_tree->getChildsByTypeFilter(
920  $a_par_id,
921  array("skrt", "sktp", "sctp")
922  );
923  } else {
924  $childs = $skill_tree->getChildsByTypeFilter(
925  $a_par_id,
926  array("skrt", "skll", "scat", "sktr")
927  );
928  }
929  }
930 
931  foreach ($childs as $k => $c) {
932  if (isset($a_childs_order[$c["child"]])) {
933  $childs[$k]["order_nr"] = (int) $a_childs_order[$c["child"]];
934  }
935  }
936 
937  $childs = ilUtil::sortArray($childs, "order_nr", "asc", true);
938 
939  $cnt = 10;
940  foreach ($childs as $c) {
941  ilSkillTreeNode::_writeOrderNr($c["child"], $cnt);
942  $cnt += 10;
943  }
944  }
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
Skill tree.
static _writeOrderNr($a_obj_id, $a_nr)
Write Order Nr.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCreationDate()

ilSkillTreeNode::setCreationDate (   $a_val)
protected

Set creation date.

Parameters
string$a_valcreation date

Definition at line 192 of file class.ilSkillTreeNode.php.

Referenced by read().

193  {
194  $this->creation_date = $a_val;
195  }
+ Here is the caller graph for this function:

◆ setDataRecord()

ilSkillTreeNode::setDataRecord (   $a_record)

this method should only be called by class ilSCORM2004NodeFactory

Definition at line 271 of file class.ilSkillTreeNode.php.

272  {
273  $this->data_record = $a_record;
274  }

◆ setDescription()

ilSkillTreeNode::setDescription (   $a_description)

Set description.

Parameters
string$a_descriptiondescription

Definition at line 72 of file class.ilSkillTreeNode.php.

Referenced by read().

73  {
74  $this->description = $a_description;
75  }
+ Here is the caller graph for this function:

◆ setId()

ilSkillTreeNode::setId (   $a_id)

Set Node ID.

Parameters
intNode ID

Definition at line 112 of file class.ilSkillTreeNode.php.

Referenced by create().

113  {
114  $this->id = $a_id;
115  }
+ Here is the caller graph for this function:

◆ setImportId()

ilSkillTreeNode::setImportId (   $a_val)

Set import id.

Parameters
string$a_valimport id

Definition at line 172 of file class.ilSkillTreeNode.php.

Referenced by read().

173  {
174  $this->import_id = $a_val;
175  }
+ Here is the caller graph for this function:

◆ setOrderNr()

ilSkillTreeNode::setOrderNr (   $a_val)

Set order nr.

Parameters
int$a_valorder nr

Definition at line 152 of file class.ilSkillTreeNode.php.

Referenced by read().

153  {
154  $this->order_nr = $a_val;
155  }
+ Here is the caller graph for this function:

◆ setSelfEvaluation()

ilSkillTreeNode::setSelfEvaluation (   $a_val)

Set self evaluation.

Parameters
booleanself evaluation

Definition at line 132 of file class.ilSkillTreeNode.php.

Referenced by read().

133  {
134  $this->self_eval = $a_val;
135  }
+ Here is the caller graph for this function:

◆ setStatus()

ilSkillTreeNode::setStatus (   $a_val)

Set status.

Parameters
boolean$a_valstatus

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

Referenced by read().

386  {
387  $this->status = $a_val;
388  }
+ Here is the caller graph for this function:

◆ setTitle()

ilSkillTreeNode::setTitle (   $a_title)

Set title.

Parameters
string$a_titletitle

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

Referenced by read().

53  {
54  $this->title = $a_title;
55  }
+ Here is the caller graph for this function:

◆ setType()

ilSkillTreeNode::setType (   $a_type)

Set type.

Parameters
stringType

Definition at line 92 of file class.ilSkillTreeNode.php.

References $a_type.

Referenced by ilBasicSkillTemplate\__construct(), ilSkillRoot\__construct(), ilSkillTemplateCategory\__construct(), ilSkillCategory\__construct(), ilSkillTemplateReference\__construct(), ilBasicSkill\__construct(), and read().

93  {
94  $this->type = $a_type;
95  }
$a_type
Definition: workflow.php:92
+ Here is the caller graph for this function:

◆ uniqueTypesCheck()

static ilSkillTreeNode::uniqueTypesCheck (   $a_items)
static

Check for unique types.

Definition at line 575 of file class.ilSkillTreeNode.php.

References $type, and _lookupType().

Referenced by ilSkillTreeNodeGUI\copyItems(), and ilSkillTreeNodeGUI\cutItems().

576  {
577  $types = array();
578  if (is_array($a_items)) {
579  foreach ($a_items as $item) {
581  $types[$type] = $type;
582  }
583  }
584 
585  if (count($types) > 1) {
586  return false;
587  }
588  return true;
589  }
static _lookupType($a_obj_id)
Lookup Type.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilSkillTreeNode::update ( )

Update Node.

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

References $db, $ilDB, $query, getDescription(), getId(), getImportId(), getOrderNr(), getSelfEvaluation(), getStatus(), and getTitle().

488  {
489  $ilDB = $this->db;
490 
491  $query = "UPDATE skl_tree_node SET " .
492  " title = " . $ilDB->quote($this->getTitle(), "text") .
493  " ,description = " . $ilDB->quote($this->getDescription(), "clob") .
494  " ,self_eval = " . $ilDB->quote((int) $this->getSelfEvaluation(), "integer") .
495  " ,order_nr = " . $ilDB->quote((int) $this->getOrderNr(), "integer") .
496  " ,status = " . $ilDB->quote((int) $this->getStatus(), "integer") .
497  " ,import_id = " . $ilDB->quote($this->getImportId(), "text") .
498  " WHERE obj_id = " . $ilDB->quote($this->getId(), "integer");
499 
500  $ilDB->manipulate($query);
501  }
getDescription()
Get description.
getSelfEvaluation()
Get self evaluation.
getImportId()
Get import id.
getOrderNr()
Get order nr.
$query
global $ilDB
+ Here is the call graph for this function:

Field Documentation

◆ $db

ilSkillTreeNode::$db
protected

Definition at line 20 of file class.ilSkillTreeNode.php.

Referenced by create(), delete(), read(), and update().

◆ $description

ilSkillTreeNode::$description

Definition at line 28 of file class.ilSkillTreeNode.php.

Referenced by getDescription().

◆ $id

ilSkillTreeNode::$id

◆ $title

ilSkillTreeNode::$title

Definition at line 27 of file class.ilSkillTreeNode.php.

Referenced by getTitle().

◆ $type

ilSkillTreeNode::$type

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

Referenced by getIconPath(), getType(), and uniqueTypesCheck().

◆ STATUS_DRAFT

◆ STATUS_OUTDATED

const ilSkillTreeNode::STATUS_OUTDATED = 2

◆ STATUS_PUBLISH

const ilSkillTreeNode::STATUS_PUBLISH = 0

Definition at line 22 of file class.ilSkillTreeNode.php.


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