ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilSkillTreeNode.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 include_once("./Services/Skill/classes/class.ilSkillTree.php");
6 
16 {
20  protected $db;
21 
22  const STATUS_PUBLISH = 0;
23  const STATUS_DRAFT = 1;
24  const STATUS_OUTDATED = 2;
25  public $type;
26  public $id;
27  public $title;
28 
32  public function __construct($a_id = 0)
33  {
34  global $DIC;
35 
36  $this->db = $DIC->database();
37  $this->id = $a_id;
38 
39  $this->skill_tree = new ilSkillTree();
40 
41  if ($a_id != 0) {
42  $this->read();
43  }
44  }
45 
51  public function setTitle($a_title)
52  {
53  $this->title = $a_title;
54  }
55 
61  public function getTitle()
62  {
63  return $this->title;
64  }
65 
71  public function setType($a_type)
72  {
73  $this->type = $a_type;
74  }
75 
81  public function getType()
82  {
83  return $this->type;
84  }
85 
91  public function setId($a_id)
92  {
93  $this->id = $a_id;
94  }
95 
101  public function getId()
102  {
103  return $this->id;
104  }
105 
111  public function setSelfEvaluation($a_val)
112  {
113  $this->self_eval = $a_val;
114  }
115 
121  public function getSelfEvaluation()
122  {
123  return $this->self_eval;
124  }
125 
131  public function setOrderNr($a_val)
132  {
133  $this->order_nr = $a_val;
134  }
135 
141  public function getOrderNr()
142  {
143  return $this->order_nr;
144  }
145 
151  public function setImportId($a_val)
152  {
153  $this->import_id = $a_val;
154  }
155 
161  public function getImportId()
162  {
163  return $this->import_id;
164  }
165 
171  protected function setCreationDate($a_val)
172  {
173  $this->creation_date = $a_val;
174  }
175 
181  public function getCreationDate()
182  {
183  return $this->creation_date;
184  }
185 
191  public static function getAllStatus()
192  {
193  global $DIC;
194 
195  $lng = $DIC->language();
196 
197  return array(
198  self::STATUS_DRAFT => $lng->txt("skmg_status_draft"),
199  self::STATUS_PUBLISH => $lng->txt("skmg_status_publish"),
200  self::STATUS_OUTDATED => $lng->txt("skmg_status_outdated")
201  );
202  }
203 
210  public static function getStatusInfo($a_status)
211  {
212  global $DIC;
213 
214  $lng = $DIC->language();
215 
216  switch ($a_status) {
217  case self::STATUS_PUBLISH: return $lng->txt("skmg_status_publish_info");
218  case self::STATUS_DRAFT: return $lng->txt("skmg_status_draft_info");
219  case self::STATUS_OUTDATED: return $lng->txt("skmg_status_outdated_info");
220  }
221  return "";
222  }
223 
227  public function read()
228  {
229  $ilDB = $this->db;
230 
231  if (!isset($this->data_record)) {
232  $query = "SELECT * FROM skl_tree_node WHERE obj_id = " .
233  $ilDB->quote($this->id, "integer");
234  $obj_set = $ilDB->query($query);
235  $this->data_record = $ilDB->fetchAssoc($obj_set);
236  }
237  $this->setType($this->data_record["type"]);
238  $this->setTitle($this->data_record["title"]);
239  $this->setOrderNr($this->data_record["order_nr"]);
240  $this->setSelfEvaluation($this->data_record["self_eval"]);
241  $this->setStatus($this->data_record["status"]);
242  $this->setImportId($this->data_record["import_id"]);
243  $this->setCreationDate($this->data_record["creation_date"]);
244  }
245 
249  public function setDataRecord($a_record)
250  {
251  $this->data_record = $a_record;
252  }
253 
260  protected static function _lookup($a_obj_id, $a_field)
261  {
262  global $DIC;
263 
264  $ilDB = $DIC->database();
265 
266  $query = "SELECT $a_field FROM skl_tree_node WHERE obj_id = " .
267  $ilDB->quote($a_obj_id, "integer");
268  $obj_set = $ilDB->query($query);
269  $obj_rec = $ilDB->fetchAssoc($obj_set);
270 
271  return $obj_rec[$a_field];
272  }
273 
280  public static function _lookupTitle($a_obj_id, $a_tref_id = 0)
281  {
282  global $DIC;
283 
284  $ilDB = $DIC->database();
285 
286  include_once("./Services/Skill/classes/class.ilSkillTemplateReference.php");
287  if ($a_tref_id > 0 && ilSkillTemplateReference::_lookupTemplateId($a_tref_id) == $a_obj_id) {
288  return self::_lookup($a_tref_id, "title");
289  }
290  return self::_lookup($a_obj_id, "title");
291  }
292 
299  public static function _lookupSelfEvaluation($a_obj_id)
300  {
301  global $DIC;
302 
303  $ilDB = $DIC->database();
304 
305  return self::_lookup($a_obj_id, "self_eval");
306  }
307 
314  public static function _lookupStatus($a_obj_id)
315  {
316  global $DIC;
317 
318  $ilDB = $DIC->database();
319 
320  return self::_lookup($a_obj_id, "status");
321  }
322 
329  public static function _lookupType($a_obj_id)
330  {
331  global $DIC;
332 
333  $ilDB = $DIC->database();
334 
335  $query = "SELECT * FROM skl_tree_node WHERE obj_id = " .
336  $ilDB->quote($a_obj_id, "integer");
337  $obj_set = $ilDB->query($query);
338  $obj_rec = $ilDB->fetchAssoc($obj_set);
339 
340  return $obj_rec["type"];
341  }
342 
348  public function setStatus($a_val)
349  {
350  $this->status = $a_val;
351  }
352 
358  public function getStatus()
359  {
360  return $this->status;
361  }
362 
369  public static function _writeTitle($a_obj_id, $a_title)
370  {
371  global $DIC;
372 
373  $ilDB = $DIC->database();
374 
375  $query = "UPDATE skl_tree_node SET " .
376  " title = " . $ilDB->quote($a_title, "text") .
377  " WHERE obj_id = " . $ilDB->quote($a_obj_id, "integer");
378 
379  $ilDB->manipulate($query);
380  }
381 
388  public static function _writeOrderNr($a_obj_id, $a_nr)
389  {
390  global $DIC;
391 
392  $ilDB = $DIC->database();
393 
394  $query = "UPDATE skl_tree_node SET " .
395  " order_nr = " . $ilDB->quote($a_nr, "integer") .
396  " WHERE obj_id = " . $ilDB->quote($a_obj_id, "integer");
397  $ilDB->manipulate($query);
398  }
399 
405  public function create()
406  {
407  $ilDB = $this->db;
408 
409  // insert object data
410  $id = $ilDB->nextId("skl_tree_node");
411  $query = "INSERT INTO skl_tree_node (obj_id, title, type, create_date, self_eval, order_nr, status, creation_date, import_id) " .
412  "VALUES (" .
413  $ilDB->quote($id, "integer") . "," .
414  $ilDB->quote($this->getTitle(), "text") . "," .
415  $ilDB->quote($this->getType(), "text") . ", " .
416  $ilDB->now() . ", " .
417  $ilDB->quote((int) $this->getSelfEvaluation(), "integer") . ", " .
418  $ilDB->quote((int) $this->getOrderNr(), "integer") . ", " .
419  $ilDB->quote((int) $this->getStatus(), "integer") . ", " .
420  $ilDB->now() . ", " .
421  $ilDB->quote($this->getImportId(), "text") .
422  ")";
423  $ilDB->manipulate($query);
424  $this->setId($id);
425  }
426 
430  public function update()
431  {
432  $ilDB = $this->db;
433 
434  $query = "UPDATE skl_tree_node SET " .
435  " title = " . $ilDB->quote($this->getTitle(), "text") .
436  " ,self_eval = " . $ilDB->quote((int) $this->getSelfEvaluation(), "integer") .
437  " ,order_nr = " . $ilDB->quote((int) $this->getOrderNr(), "integer") .
438  " ,status = " . $ilDB->quote((int) $this->getStatus(), "integer") .
439  " ,import_id = " . $ilDB->quote($this->getImportId(), "text") .
440  " WHERE obj_id = " . $ilDB->quote($this->getId(), "integer");
441 
442  $ilDB->manipulate($query);
443  }
444 
448  public function delete()
449  {
450  $ilDB = $this->db;
451 
452  $query = "DELETE FROM skl_tree_node WHERE obj_id= " .
453  $ilDB->quote($this->getId(), "integer");
454  $ilDB->manipulate($query);
455  }
456 
460  public static function putInTree($a_obj, $a_parent_id = "", $a_target_node_id = "")
461  {
462  $skill_tree = new ilSkillTree();
463 
464  // determine parent
465  $parent_id = ($a_parent_id != "")
466  ? $a_parent_id
467  : $skill_tree->getRootId();
468 
469  // make a check, whether the type of object is allowed under
470  // the parent
471  $allowed = array(
472  "skrt" => array("skll", "scat", "sktr", "sktp", "sctp"),
473  "scat" => array("skll", "scat", "sktr"),
474  "sctp" => array("sktp", "sctp"));
475  $par_type = self::_lookupType($parent_id);
476  if (!is_array($allowed[$par_type]) ||
477  !in_array($a_obj->getType(), $allowed[$par_type])) {
478  return;
479  }
480 
481  // determine target
482  if ($a_target_node_id != "") {
483  $target = $a_target_node_id;
484  } else {
485  // determine last child that serves as predecessor
486  $childs = $skill_tree->getChilds($parent_id);
487 
488  if (count($childs) == 0) {
490  } else {
491  $target = $childs[count($childs) - 1]["obj_id"];
492  }
493  }
494 
495  if ($skill_tree->isInTree($parent_id) && !$skill_tree->isInTree($a_obj->getId())) {
496  $skill_tree->insertNode($a_obj->getId(), $parent_id, $target);
497  }
498  }
499 
507  public static function getTree($a_slm_obj_id)
508  {
509  $tree = new ilSkillTree();
510 
511  return $tree;
512  }
513 
517  public static function uniqueTypesCheck($a_items)
518  {
519  $types = array();
520  if (is_array($a_items)) {
521  foreach ($a_items as $item) {
523  $types[$type] = $type;
524  }
525  }
526 
527  if (count($types) > 1) {
528  return false;
529  }
530  return true;
531  }
532 
536  public static function clipboardCut($a_tree_id, $a_ids)
537  {
538  self::clearClipboard();
539  include_once("./Services/Skill/classes/class.ilSkillTree.php");
540  $tree = new ilSkillTree();
541 
542  if (!is_array($a_ids)) {
543  return false;
544  } else {
545  // get all "top" ids, i.e. remove ids, that have a selected parent
546  foreach ($a_ids as $id) {
547  $path = $tree->getPathId($id);
548  $take = true;
549  foreach ($path as $path_id) {
550  if ($path_id != $id && in_array($path_id, $a_ids)) {
551  $take = false;
552  }
553  }
554  if ($take) {
555  $cut_ids[] = $id;
556  }
557  }
558  }
559 
560  ilSkillTreeNode::clipboardCopy($a_tree_id, $cut_ids);
561 
562  // remove the objects from the tree
563  // note: we are getting skills/categories which are *not* in the tree
564  // we do not delete any pages/chapters here
565  foreach ($cut_ids as $id) {
566  $curnode = $tree->getNodeData($id);
567  if ($tree->isInTree($id)) {
568  $tree->deleteTree($curnode);
569  }
570  }
571  }
572 
573 
577  public static function clipboardCopy($a_tree_id, $a_ids)
578  {
579  global $DIC;
580 
581  $ilUser = $DIC->user();
582 
583  self::clearClipboard();
584  include_once("./Services/Skill/classes/class.ilSkillTree.php");
585  $tree = new ilSkillTree();
586 
587  // put them into the clipboard
588  $time = date("Y-m-d H:i:s", time());
589  foreach ($a_ids as $id) {
590  $curnode = "";
591  if ($tree->isInTree($id)) {
592  $curnode = $tree->getNodeData($id);
593  $subnodes = $tree->getSubTree($curnode);
594  foreach ($subnodes as $subnode) {
595  if ($subnode["child"] != $id) {
596  $ilUser->addObjectToClipboard(
597  $subnode["child"],
598  $subnode["type"],
599  $subnode["title"],
600  $subnode["parent"],
601  $time,
602  $subnode["lft"]
603  );
604  }
605  }
606  }
607  $order = ($curnode["lft"] > 0)
608  ? $curnode["lft"]
609  : (int) ($order + 1);
610  $ilUser->addObjectToClipboard(
611  $id,
614  0,
615  $time,
616  $order
617  );
618  }
619  }
620 
621 
625  public static function insertItemsFromClip($a_type, $a_obj_id)
626  {
627  global $DIC;
628 
629  $ilCtrl = $DIC->ctrl();
630  $ilUser = $DIC->user();
631 
632  // @todo: move this to a service since it can be used here, too
633  include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
634 
635  include_once("./Services/Skill/classes/class.ilSkillTree.php");
636  $tree = new ilSkillTree();
637 
638  $parent_id = $a_obj_id;
640 
641  // cut and paste
642  $skills = $ilUser->getClipboardObjects($a_type); // this will get all skills _regardless_ of level
643  $copied_nodes = array();
644  foreach ($skills as $skill) {
645  // if skill was already copied as part of tree - do not copy it again
646  if (!in_array($skill["id"], array_keys($copied_nodes))) {
648  $skill["id"],
649  $parent_id,
650  $target,
651  $skill["insert_time"],
652  $copied_nodes,
653  (ilEditClipboard::getAction() == "copy"),
654  true
655  );
656  // $target = $cid;
657  }
658  }
659 
660  // if (ilEditClipboard::getAction() == "cut")
661  // {
662  self::clearClipboard();
663  // }
664 
666  $a_obj_id,
667  array(),
668  in_array($a_type, array("sktp", "sctp"))
669  );
670 
671  return $copied_nodes;
672  }
673 
680  public static function clearClipboard()
681  {
682  global $DIC;
683 
684  $ilUser = $DIC->user();
685 
686  $ilUser->clipboardDeleteObjectsOfType("skll");
687  $ilUser->clipboardDeleteObjectsOfType("scat");
688  $ilUser->clipboardDeleteObjectsOfType("sktr");
689  $ilUser->clipboardDeleteObjectsOfType("sktp");
690  $ilUser->clipboardDeleteObjectsOfType("sctp");
691  include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
693  }
694 
695 
699  public static function pasteTree(
700  $a_item_id,
701  $a_parent_id,
702  $a_target,
703  $a_insert_time,
704  &$a_copied_nodes,
705  $a_as_copy = false,
706  $a_add_suffix = false
707  ) {
708  global $DIC;
709 
710  $ilUser = $DIC->user();
711  $ilLog = $DIC["ilLog"];
712  $lng = $DIC->language();
713 
714  $item_type = ilSkillTreeNode::_lookupType($a_item_id);
715 
716  if ($item_type == "scat") {
717  include_once("./Services/Skill/classes/class.ilSkillCategory.php");
718  $item = new ilSkillCategory($a_item_id);
719  } elseif ($item_type == "skll") {
720  include_once("./Services/Skill/classes/class.ilBasicSkill.php");
721  $item = new ilBasicSkill($a_item_id);
722  } elseif ($item_type == "sktr") {
723  include_once("./Services/Skill/classes/class.ilSkillTemplateReference.php");
724  $item = new ilSkillTemplateReference($a_item_id);
725  } elseif ($item_type == "sktp") {
726  include_once("./Services/Skill/classes/class.ilBasicSkillTemplate.php");
727  $item = new ilBasicSkillTemplate($a_item_id);
728  } elseif ($item_type == "sctp") {
729  include_once("./Services/Skill/classes/class.ilSkillTemplateCategory.php");
730  $item = new ilSkillTemplateCategory($a_item_id);
731  }
732 
733  $ilLog->write("Getting from clipboard type " . $item_type . ", " .
734  "Item ID: " . $a_item_id);
735 
736  if ($a_as_copy) {
737  $target_item = $item->copy();
738  if ($a_add_suffix) {
739  $target_item->setTitle($target_item->getTitle() . " " . $lng->txt("copy_of_suffix"));
740  $target_item->update();
741  }
742  $a_copied_nodes[$item->getId()] = $target_item->getId();
743  } else {
744  $target_item = $item;
745  }
746 
747  $ilLog->write("Putting into skill tree type " . $target_item->getType() .
748  "Item ID: " . $target_item->getId() . ", Parent: " . $a_parent_id . ", " .
749  "Target: " . $a_target);
750 
751  ilSkillTreeNode::putInTree($target_item, $a_parent_id, $a_target);
752 
753  $childs = $ilUser->getClipboardChilds($item->getId(), $a_insert_time);
754 
755  foreach ($childs as $child) {
757  $child["id"],
758  $target_item->getId(),
759  IL_LAST_NODE,
760  $a_insert_time,
761  $a_copied_nodes,
762  $a_as_copy
763  );
764  }
765 
766  return $target_item->getId();
767  }
768 
775  public static function isInTree($a_id)
776  {
777  $skill_tree = new ilSkillTree();
778  if ($skill_tree->isInTree($a_id)) {
779  return true;
780  }
781  return false;
782  }
783 
790  public static function getAllSelfEvaluationNodes()
791  {
792  global $DIC;
793 
794  $ilDB = $DIC->database();
795 
796  $set = $ilDB->query(
797  "SELECT obj_id, title FROM skl_tree_node WHERE " .
798  " self_eval = " . $ilDB->quote(true, "integer") . " ORDER BY TITLE "
799  );
800  $nodes = array();
801  while ($rec = $ilDB->fetchAssoc($set)) {
802  $nodes[$rec["obj_id"]] = $rec["title"];
803  }
804  return $nodes;
805  }
806 
813  public static function getTopTemplates()
814  {
815  $tr = new ilSkillTree();
816  $childs = $tr->getChildsByTypeFilter($tr->getRootId(), array("sktp", "sctp"));
817 
818  return $childs;
819  }
820 
827  public static function getSelectableSkills()
828  {
829  global $DIC;
830 
831  $ilDB = $DIC->database();
832 
833  $set = $ilDB->query(
834  "SELECT * FROM skl_tree_node " .
835  " WHERE self_eval = " . $ilDB->quote(1, "integer")
836  );
837 
838  $sel_skills = array();
839  while ($rec = $ilDB->fetchAssoc($set)) {
840  $sel_skills[] = $rec;
841  }
842 
843  return $sel_skills;
844  }
845 
852  public static function saveChildsOrder($a_par_id, $a_childs_order, $a_templates = false)
853  {
854  include_once("./Services/Skill/classes/class.ilSkillTree.php");
855  $skill_tree = new ilSkillTree();
856 
857  if ($a_par_id != $skill_tree->readRootId()) {
858  $childs = $skill_tree->getChilds($a_par_id);
859  } else {
860  if ($a_templates) {
861  $childs = $skill_tree->getChildsByTypeFilter(
862  $a_par_id,
863  array("skrt", "sktp", "sctp")
864  );
865  } else {
866  $childs = $skill_tree->getChildsByTypeFilter(
867  $a_par_id,
868  array("skrt", "skll", "scat", "sktr")
869  );
870  }
871  }
872 
873  foreach ($childs as $k => $c) {
874  if (isset($a_childs_order[$c["child"]])) {
875  $childs[$k]["order_nr"] = (int) $a_childs_order[$c["child"]];
876  }
877  }
878 
879  $childs = ilUtil::sortArray($childs, "order_nr", "asc", true);
880 
881  $cnt = 10;
882  foreach ($childs as $c) {
883  ilSkillTreeNode::_writeOrderNr($c["child"], $cnt);
884  $cnt += 10;
885  }
886  }
887 
897  public static function getIconPath($a_obj_id, $a_type, $a_size = "", $a_status = 0)
898  {
899  if ($a_status == self::STATUS_DRAFT && $a_type == "sctp") {
900  $a_type = "scat";
901  }
902  if ($a_status == self::STATUS_DRAFT && $a_type == "sktp") {
903  $a_type = "skll";
904  }
905 
906  $off = ($a_status == self::STATUS_DRAFT)
907  ? "_off"
908  : "";
909 
910  $a_name = "icon_" . $a_type . $a_size . $off . ".svg";
911  if ($a_type == "sktr") {
912  include_once("./Services/Skill/classes/class.ilSkillTemplateReference.php");
915  if ($type == "sctp") {
916  $a_name = "icon_sctr" . $a_size . $off . ".svg";
917  }
918  }
919  $vers = "vers=" . str_replace(array(".", " "), "-", ILIAS_VERSION);
920  return ilUtil::getImagePath($a_name) . "?" . $vers;
921  }
922 
929  public static function findSkills($a_term)
930  {
931  global $DIC;
932 
933  $ilDB = $DIC->database();
934 
935  $res = array();
936  $candidates = array();
937 
938  $skill_tree = new ilSkillTree();
939 
940  $sql = "SELECT * " .
941  " FROM skl_tree_node" .
942  " WHERE " . $ilDB->like("title", "text", "%" . $a_term . "%");
943  $sql .= " ORDER BY title";
944  $set = $ilDB->query($sql);
945  include_once("./Services/Skill/classes/class.ilSkillTemplateReference.php");
946  while ($row = $ilDB->fetchAssoc($set)) {
947  if (in_array($row["type"], array("sctp", "sktp"))) {
948  // need to get "top template" first! (if it is already the top level, do not use it!)
949  $path = $skill_tree->getSkillTreePath($row["obj_id"]);
950  if ($path[1]["child"] != $row["obj_id"]) {
952  foreach ($trefs as $tref) {
953  $candidates[] = array("tref_id" => $tref, "skill_id" => $row["obj_id"], "title" => $row["title"]);
954  }
955  }
956  } elseif ($row["type"] == "sktr") {
957  // works
958  $candidates[] = array("tref_id" => $row["obj_id"], "skill_id" => ilSkillTemplateReference::_lookupTemplateId($row["obj_id"]), "title" => $row["title"]);
959  } else {
960  // works
961  $candidates[] = array("tref_id" => 0, "skill_id" => $row["obj_id"], "title" => $row["title"]);
962  }
963  }
964 
965  foreach ($candidates as $c) {
966  // if we get a path array, and the array has items try to use the data
967  $path = $skill_tree->getSkillTreePath($c["skill_id"], $c["tref_id"]);
968  $use = false;
969  if (is_array($path) && count($path) > 0) {
970  $use = true;
971  }
972 
973  // if any inactive/outdated -> do not use the data
974  if (is_array($path)) {
975  foreach ($path as $p) {
976  if ($p["status"] > 0) {
977  $use = false;
978  }
979  }
980  }
981  if ($use) {
982  if (!in_array($c["title"], $res)) {
983  $res[] = $c["title"];
984  }
985  }
986  }
987 
988 
989  return $res;
990  }
991 
998  public static function getAllCSkillIdsForNodeIds(array $a_node_ids)
999  {
1000  include_once("./Services/Skill/classes/class.ilSkillTemplateReference.php");
1001  $cskill_ids = array();
1002  foreach ($a_node_ids as $id) {
1003  if (in_array(self::_lookupType($id), array("skll", "scat", "sktr"))) {
1004  $skill_id = $id;
1005  $tref_id = 0;
1006  if (ilSkillTreeNode::_lookupType($id) == "sktr") {
1008  $tref_id = $id;
1009  }
1010  $cskill_ids[] = array("skill_id" => $skill_id, "tref_id" => $tref_id);
1011  }
1012  if (in_array(ilSkillTreeNode::_lookupType($id), array("sktp", "sctp"))) {
1013  foreach (ilSkillTemplateReference::_lookupTrefIdsForTemplateId($id) as $tref_id) {
1014  $cskill_ids[] = array("skill_id" => $id, "tref_id" => $tref_id);
1015  }
1016  }
1017  // for cats, skills and template references, get "real" usages
1018  // for skill and category templates check usage in references
1019  }
1020  return $cskill_ids;
1021  }
1022 }
static getAllCSkillIdsForNodeIds(array $a_node_ids)
Get all possible common skill IDs for node IDs.
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static clearClipboard()
Remove all skill items from clipboard.
$path
Definition: aliased.php:25
setType($a_type)
Set type.
static clipboardCut($a_tree_id, $a_ids)
Cut and copy a set of skills/skill categories into the clipboard.
const ILIAS_VERSION
static _writeTitle($a_obj_id, $a_title)
Write Title.
static getAllStatus()
Get all status.
global $DIC
Definition: saml.php:7
Skill tree.
setTitle($a_title)
Set title.
static _lookupSelfEvaluation($a_obj_id)
Lookup self evaluation.
static getIconPath($a_obj_id, $a_type, $a_size="", $a_status=0)
Get icon path.
static _lookupTrefIdsForTemplateId($a_tid)
Get all tref ids for a template id.
static putInTree($a_obj, $a_parent_id="", $a_target_node_id="")
Put this object into the skill tree.
setDataRecord($a_record)
this method should only be called by class ilSCORM2004NodeFactory
static getAllSelfEvaluationNodes()
Get all self evaluation nodes.
read()
Read Data of Node.
setImportId($a_val)
Set import id.
static _lookup($a_obj_id, $a_field)
Lookup Title.
setId($a_id)
Set Node ID.
static getSelectableSkills()
Get selectable skills.
static getTree($a_slm_obj_id)
Get scorm module editing tree.
static insertItemsFromClip($a_type, $a_obj_id)
Insert basic skills from clipboard.
getSelfEvaluation()
Get self evaluation.
setSelfEvaluation($a_val)
Set self evaluation.
getImportId()
Get import id.
static _lookupType($a_obj_id)
Lookup Type.
global $ilCtrl
Definition: ilias.php:18
$time
Definition: cron.php:21
$a_type
Definition: workflow.php:92
getOrderNr()
Get order nr.
static uniqueTypesCheck($a_items)
Check for unique types.
static findSkills($a_term)
Find skills.
foreach($_POST as $key=> $value) $res
static isInTree($a_id)
Is id in tree?
$lng
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
const IL_FIRST_NODE
Definition: class.ilTree.php:5
$ilUser
Definition: imgupload.php:18
static _lookupTemplateId($a_obj_id)
Lookup template ID.
static clipboardCopy($a_tree_id, $a_ids)
Copy a set of skills/skill categories into the clipboard.
$query
setCreationDate($a_val)
Set creation date.
$row
static saveChildsOrder($a_par_id, $a_childs_order, $a_templates=false)
Save childs order.
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
static getStatusInfo($a_status)
Get status info.
const IL_LAST_NODE
Definition: class.ilTree.php:4
setOrderNr($a_val)
Set order nr.
static _lookupTrefIdsForTopTemplateId($a_template_id)
Lookup tref ids for template id.
A node in the skill tree.
global $ilDB
setStatus($a_val)
Set status.
static _lookupStatus($a_obj_id)
Lookup Status.
Basic Skill.
static _writeOrderNr($a_obj_id, $a_nr)
Write Order Nr.
$target
Definition: test.php:19
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.
getCreationDate()
Get creation date.
static getTopTemplates()
Get top skill templates and template categories.