ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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
5include_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;
29
33 public function __construct($a_id = 0)
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 }
46
52 public function setTitle($a_title)
53 {
54 $this->title = $a_title;
55 }
56
62 public function getTitle()
63 {
64 return $this->title;
65 }
66
72 public function setDescription($a_description)
73 {
74 $this->description = $a_description;
75 }
76
82 public function getDescription()
83 {
84 return $this->description;
85 }
86
92 public function setType($a_type)
93 {
94 $this->type = $a_type;
95 }
96
102 public function getType()
103 {
104 return $this->type;
105 }
106
112 public function setId($a_id)
113 {
114 $this->id = $a_id;
115 }
116
122 public function getId()
123 {
124 return $this->id;
125 }
126
132 public function setSelfEvaluation($a_val)
133 {
134 $this->self_eval = $a_val;
135 }
136
142 public function getSelfEvaluation()
143 {
144 return $this->self_eval;
145 }
146
152 public function setOrderNr($a_val)
153 {
154 $this->order_nr = $a_val;
155 }
156
162 public function getOrderNr()
163 {
164 return $this->order_nr;
165 }
166
172 public function setImportId($a_val)
173 {
174 $this->import_id = $a_val;
175 }
176
182 public function getImportId()
183 {
184 return $this->import_id;
185 }
186
192 protected function setCreationDate($a_val)
193 {
194 $this->creation_date = $a_val;
195 }
196
202 public function getCreationDate()
203 {
204 return $this->creation_date;
205 }
206
212 public static function getAllStatus()
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 }
224
231 public static function getStatusInfo($a_status)
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 }
244
248 public function read()
249 {
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 }
267
271 public function setDataRecord($a_record)
272 {
273 $this->data_record = $a_record;
274 }
275
282 protected static function _lookup($a_obj_id, $a_field)
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 }
295
302 public static function _lookupTitle($a_obj_id, $a_tref_id = 0)
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 }
314
321 public static function _lookupDescription($a_obj_id)
322 {
323 global $DIC;
324
325 $ilDB = $DIC->database();
326
327 return self::_lookup($a_obj_id, "description");
328 }
329
336 public static function _lookupSelfEvaluation($a_obj_id)
337 {
338 global $DIC;
339
340 $ilDB = $DIC->database();
341
342 return self::_lookup($a_obj_id, "self_eval");
343 }
344
351 public static function _lookupStatus($a_obj_id)
352 {
353 global $DIC;
354
355 $ilDB = $DIC->database();
356
357 return self::_lookup($a_obj_id, "status");
358 }
359
366 public static function _lookupType($a_obj_id)
367 {
368 global $DIC;
369
370 $ilDB = $DIC->database();
371
372 $query = "SELECT * FROM skl_tree_node WHERE obj_id = " .
373 $ilDB->quote($a_obj_id, "integer");
374 $obj_set = $ilDB->query($query);
375 $obj_rec = $ilDB->fetchAssoc($obj_set);
376
377 return $obj_rec["type"];
378 }
379
385 public function setStatus($a_val)
386 {
387 $this->status = $a_val;
388 }
389
395 public function getStatus()
396 {
397 return $this->status;
398 }
399
406 public static function _writeTitle($a_obj_id, $a_title)
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 }
418
425 public static function _writeDescription($a_obj_id, $a_description)
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 }
437
444 public static function _writeOrderNr($a_obj_id, $a_nr)
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 }
455
461 public function create()
462 {
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 }
483
487 public function update()
488 {
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 }
502
506 public function delete()
507 {
509
510 $query = "DELETE FROM skl_tree_node WHERE obj_id= " .
511 $ilDB->quote($this->getId(), "integer");
512 $ilDB->manipulate($query);
513 }
514
518 public static function putInTree($a_obj, $a_parent_id = "", $a_target_node_id = "")
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 }
557
565 public static function getTree($a_slm_obj_id)
566 {
567 $tree = new ilSkillTree();
568
569 return $tree;
570 }
571
575 public static function uniqueTypesCheck($a_items)
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 }
590
594 public static function clipboardCut($a_tree_id, $a_ids)
595 {
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 }
630
631
635 public static function clipboardCopy($a_tree_id, $a_ids)
636 {
637 global $DIC;
638
639 $ilUser = $DIC->user();
640
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 }
678
679
683 public static function insertItemsFromClip($a_type, $a_obj_id)
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 // {
721 // }
722
724 $a_obj_id,
725 array(),
726 in_array($a_type, array("sktp", "sctp"))
727 );
728
729 return $copied_nodes;
730 }
731
738 public static function clearClipboard()
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 }
752
753
757 public static function pasteTree(
758 $a_item_id,
759 $a_parent_id,
760 $a_target,
761 $a_insert_time,
762 &$a_copied_nodes,
763 $a_as_copy = false,
764 $a_add_suffix = false
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(),
818 $a_insert_time,
819 $a_copied_nodes,
820 $a_as_copy
821 );
822 }
823
824 return $target_item->getId();
825 }
826
833 public static function isInTree($a_id)
834 {
835 $skill_tree = new ilSkillTree();
836 if ($skill_tree->isInTree($a_id)) {
837 return true;
838 }
839 return false;
840 }
841
848 public static function getAllSelfEvaluationNodes()
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 }
864
871 public static function getTopTemplates()
872 {
873 $tr = new ilSkillTree();
874 $childs = $tr->getChildsByTypeFilter($tr->getRootId(), array("sktp", "sctp"));
875
876 return $childs;
877 }
878
885 public static function getSelectableSkills()
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 }
903
910 public static function saveChildsOrder($a_par_id, $a_childs_order, $a_templates = false)
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 }
945
955 public static function getIconPath($a_obj_id, $a_type, $a_size = "", $a_status = 0)
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 }
980
987 public static function findSkills($a_term)
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 }
1049
1056 public static function getAllCSkillIdsForNodeIds(array $a_node_ids)
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"))) {
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 }
1080}
An exception for terminatinating execution or to throw for unit testing.
const IL_LAST_NODE
Definition: class.ilTree.php:4
const IL_FIRST_NODE
Definition: class.ilTree.php:5
static _lookupTrefIdsForTemplateId($a_tid)
Get all tref ids for a template id.
static _lookupTrefIdsForTopTemplateId($a_template_id)
Lookup tref ids for template id.
static _lookupTemplateId($a_obj_id)
Lookup template ID.
A node in the skill tree.
static isInTree($a_id)
Is id in tree?
static _writeTitle($a_obj_id, $a_title)
Write Title.
static getIconPath($a_obj_id, $a_type, $a_size="", $a_status=0)
Get icon path.
static putInTree($a_obj, $a_parent_id="", $a_target_node_id="")
Put this object into the skill tree.
static uniqueTypesCheck($a_items)
Check for unique types.
setTitle($a_title)
Set title.
getDescription()
Get description.
static getStatusInfo($a_status)
Get status info.
static _lookupStatus($a_obj_id)
Lookup Status.
static saveChildsOrder($a_par_id, $a_childs_order, $a_templates=false)
Save childs order.
static insertItemsFromClip($a_type, $a_obj_id)
Insert basic skills from clipboard.
static getAllStatus()
Get all status.
static findSkills($a_term)
Find skills.
static getTopTemplates()
Get top skill templates and template categories.
static clipboardCopy($a_tree_id, $a_ids)
Copy a set of skills/skill categories into the clipboard.
setCreationDate($a_val)
Set creation date.
setOrderNr($a_val)
Set order nr.
static _lookupSelfEvaluation($a_obj_id)
Lookup self evaluation.
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
static _writeDescription($a_obj_id, $a_description)
Write Description.
setDescription($a_description)
Set description.
static clearClipboard()
Remove all skill items from clipboard.
read()
Read Data of Node.
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.
setType($a_type)
Set type.
static _lookup($a_obj_id, $a_field)
Lookup Title.
static getTree($a_slm_obj_id)
Get scorm module editing tree.
setId($a_id)
Set Node ID.
static clipboardCut($a_tree_id, $a_ids)
Cut and copy a set of skills/skill categories into the clipboard.
static getAllSelfEvaluationNodes()
Get all self evaluation nodes.
getOrderNr()
Get order nr.
static getSelectableSkills()
Get selectable skills.
static _writeOrderNr($a_obj_id, $a_nr)
Write Order Nr.
setDataRecord($a_record)
this method should only be called by class ilSCORM2004NodeFactory
setStatus($a_val)
Set status.
setSelfEvaluation($a_val)
Set self evaluation.
static _lookupDescription($a_obj_id)
Lookup Description.
getImportId()
Get import id.
static getAllCSkillIdsForNodeIds(array $a_node_ids)
Get all possible common skill IDs for node IDs.
static _lookupType($a_obj_id)
Lookup Type.
getSelfEvaluation()
Get self evaluation.
setImportId($a_val)
Set import id.
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
global $ilCtrl
Definition: ilias.php:18
const ILIAS_VERSION
$query
$lng
foreach($_POST as $key=> $value) $res
global $ilDB
$ilUser
Definition: imgupload.php:18
$a_type
Definition: workflow.php:92
$DIC
Definition: xapitoken.php:46