ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 {
17  const STATUS_PUBLISH = 0;
18  const STATUS_DRAFT = 1;
19  const STATUS_OUTDATED = 2;
20  var $type;
21  var $id;
22  var $title;
23 
27  function __construct($a_id = 0)
28  {
29  $this->id = $a_id;
30 
31  $this->skill_tree = new ilSkillTree();
32 
33  if($a_id != 0)
34  {
35  $this->read();
36  }
37  }
38 
44  function setTitle($a_title)
45  {
46  $this->title = $a_title;
47  }
48 
54  function getTitle()
55  {
56  return $this->title;
57  }
58 
64  function setType($a_type)
65  {
66  $this->type = $a_type;
67  }
68 
74  function getType()
75  {
76  return $this->type;
77  }
78 
84  function setId($a_id)
85  {
86  $this->id = $a_id;
87  }
88 
94  function getId()
95  {
96  return $this->id;
97  }
98 
104  function setSelfEvaluation($a_val)
105  {
106  $this->self_eval = $a_val;
107  }
108 
114  function getSelfEvaluation()
115  {
116  return $this->self_eval;
117  }
118 
124  function setOrderNr($a_val)
125  {
126  $this->order_nr = $a_val;
127  }
128 
134  function getOrderNr()
135  {
136  return $this->order_nr;
137  }
138 
144  public function setImportId($a_val)
145  {
146  $this->import_id = $a_val;
147  }
148 
154  public function getImportId()
155  {
156  return $this->import_id;
157  }
158 
164  protected function setCreationDate($a_val)
165  {
166  $this->creation_date = $a_val;
167  }
168 
174  public function getCreationDate()
175  {
176  return $this->creation_date;
177  }
178 
184  static function getAllStatus()
185  {
186  global $lng;
187 
188  return array(
189  self::STATUS_DRAFT => $lng->txt("skmg_status_draft"),
190  self::STATUS_PUBLISH => $lng->txt("skmg_status_publish"),
191  self::STATUS_OUTDATED => $lng->txt("skmg_status_outdated")
192  );
193  }
194 
201  static function getStatusInfo($a_status)
202  {
203  global $lng;
204 
205  switch($a_status)
206  {
207  case self::STATUS_PUBLISH: return $lng->txt("skmg_status_publish_info");
208  case self::STATUS_DRAFT: return $lng->txt("skmg_status_draft_info");
209  case self::STATUS_OUTDATED: return $lng->txt("skmg_status_outdated_info");
210  }
211  return "";
212  }
213 
217  function read()
218  {
219  global $ilBench, $ilDB;
220 
221  if(!isset($this->data_record))
222  {
223  $query = "SELECT * FROM skl_tree_node WHERE obj_id = ".
224  $ilDB->quote($this->id, "integer");
225  $obj_set = $ilDB->query($query);
226  $this->data_record = $ilDB->fetchAssoc($obj_set);
227  }
228  $this->setType($this->data_record["type"]);
229  $this->setTitle($this->data_record["title"]);
230  $this->setOrderNr($this->data_record["order_nr"]);
231  $this->setSelfEvaluation($this->data_record["self_eval"]);
232  $this->setStatus($this->data_record["status"]);
233  $this->setImportId($this->data_record["import_id"]);
234  $this->setCreationDate($this->data_record["creation_date"]);
235  }
236 
240  function setDataRecord($a_record)
241  {
242  $this->data_record = $a_record;
243  }
244 
251  protected static function _lookup($a_obj_id, $a_field)
252  {
253  global $ilDB;
254 
255  $query = "SELECT $a_field FROM skl_tree_node WHERE obj_id = ".
256  $ilDB->quote($a_obj_id, "integer");
257  $obj_set = $ilDB->query($query);
258  $obj_rec = $ilDB->fetchAssoc($obj_set);
259 
260  return $obj_rec[$a_field];
261  }
262 
269  static function _lookupTitle($a_obj_id, $a_tref_id = 0)
270  {
271  global $ilDB;
272 
273  include_once("./Services/Skill/classes/class.ilSkillTemplateReference.php");
274  if ($a_tref_id > 0 && ilSkillTemplateReference::_lookupTemplateId($a_tref_id) == $a_obj_id)
275  {
276  return self::_lookup($a_tref_id, "title");
277  }
278  return self::_lookup($a_obj_id, "title");
279  }
280 
287  static function _lookupSelfEvaluation($a_obj_id)
288  {
289  global $ilDB;
290 
291  return self::_lookup($a_obj_id, "self_eval");
292  }
293 
300  static function _lookupStatus($a_obj_id)
301  {
302  global $ilDB;
303 
304  return self::_lookup($a_obj_id, "status");
305  }
306 
313  static function _lookupType($a_obj_id)
314  {
315  global $ilDB;
316 
317  $query = "SELECT * FROM skl_tree_node WHERE obj_id = ".
318  $ilDB->quote($a_obj_id, "integer");
319  $obj_set = $ilDB->query($query);
320  $obj_rec = $ilDB->fetchAssoc($obj_set);
321 
322  return $obj_rec["type"];
323  }
324 
330  function setStatus($a_val)
331  {
332  $this->status = $a_val;
333  }
334 
340  function getStatus()
341  {
342  return $this->status;
343  }
344 
351  static function _writeTitle($a_obj_id, $a_title)
352  {
353  global $ilDB;
354 
355  $query = "UPDATE skl_tree_node SET ".
356  " title = ".$ilDB->quote($a_title, "text").
357  " WHERE obj_id = ".$ilDB->quote($a_obj_id, "integer");
358 
359  $ilDB->manipulate($query);
360  }
361 
368  static function _writeOrderNr($a_obj_id, $a_nr)
369  {
370  global $ilDB;
371 
372  $query = "UPDATE skl_tree_node SET ".
373  " order_nr = ".$ilDB->quote($a_nr, "integer").
374  " WHERE obj_id = ".$ilDB->quote($a_obj_id, "integer");
375  $ilDB->manipulate($query);
376  }
377 
383  function create()
384  {
385  global $ilDB;
386 
387  // insert object data
388  $id = $ilDB->nextId("skl_tree_node");
389  $query = "INSERT INTO skl_tree_node (obj_id, title, type, create_date, self_eval, order_nr, status, creation_date, import_id) ".
390  "VALUES (".
391  $ilDB->quote($id, "integer").",".
392  $ilDB->quote($this->getTitle(), "text").",".
393  $ilDB->quote($this->getType(), "text").", ".
394  $ilDB->now().", ".
395  $ilDB->quote((int) $this->getSelfEvaluation(), "integer").", ".
396  $ilDB->quote((int) $this->getOrderNr(), "integer").", ".
397  $ilDB->quote((int) $this->getStatus(), "integer").", ".
398  $ilDB->now().", ".
399  $ilDB->quote($this->getImportId(), "text").
400  ")";
401  $ilDB->manipulate($query);
402  $this->setId($id);
403  }
404 
408  function update()
409  {
410  global $ilDB;
411 
412  $query = "UPDATE skl_tree_node SET ".
413  " title = ".$ilDB->quote($this->getTitle(), "text").
414  " ,self_eval = ".$ilDB->quote((int) $this->getSelfEvaluation(), "integer").
415  " ,order_nr = ".$ilDB->quote((int) $this->getOrderNr(), "integer").
416  " ,status = ".$ilDB->quote((int) $this->getStatus(), "integer").
417  " ,import_id = ".$ilDB->quote($this->getImportId(), "text").
418  " WHERE obj_id = ".$ilDB->quote($this->getId(), "integer");
419 
420  $ilDB->manipulate($query);
421  }
422 
426  function delete()
427  {
428  global $ilDB;
429 
430  $query = "DELETE FROM skl_tree_node WHERE obj_id= ".
431  $ilDB->quote($this->getId(), "integer");
432  $ilDB->manipulate($query);
433  }
434 
438  static function putInTree($a_obj, $a_parent_id = "", $a_target_node_id = "")
439  {
440  $skill_tree = new ilSkillTree();
441 
442  // determine parent
443  $parent_id = ($a_parent_id != "")
444  ? $a_parent_id
445  : $skill_tree->getRootId();
446 
447  // make a check, whether the type of object is allowed under
448  // the parent
449  $allowed = array(
450  "skrt" => array("skll", "scat", "sktr", "sktp", "sctp"),
451  "scat" => array("skll", "scat", "sktr"),
452  "sctp" => array("sktp", "sctp"));
453  $par_type = self::_lookupType($parent_id);
454  if (!is_array($allowed[$par_type]) ||
455  !in_array($a_obj->getType(), $allowed[$par_type]))
456  {
457  return;
458  }
459 
460  // determine target
461  if ($a_target_node_id != "")
462  {
463  $target = $a_target_node_id;
464  }
465  else
466  {
467  // determine last child that serves as predecessor
468  $childs = $skill_tree->getChilds($parent_id);
469 
470  if (count($childs) == 0)
471  {
473  }
474  else
475  {
476  $target = $childs[count($childs) - 1]["obj_id"];
477  }
478  }
479 
480  if ($skill_tree->isInTree($parent_id) && !$skill_tree->isInTree($a_obj->getId()))
481  {
482  $skill_tree->insertNode($a_obj->getId(), $parent_id, $target);
483  }
484  }
485 
493  static function getTree($a_slm_obj_id)
494  {
495  $tree = new ilSkillTree();
496 
497  return $tree;
498  }
499 
503  static function uniqueTypesCheck($a_items)
504  {
505  $types = array();
506  if (is_array($a_items))
507  {
508  foreach($a_items as $item)
509  {
510  $type = ilSkillTreeNode::_lookupType($item);
511  $types[$type] = $type;
512  }
513  }
514 
515  if (count($types) > 1)
516  {
517  return false;
518  }
519  return true;
520  }
521 
525  static function clipboardCut($a_tree_id, $a_ids)
526  {
527  self::clearClipboard();
528  include_once("./Services/Skill/classes/class.ilSkillTree.php");
529  $tree = new ilSkillTree();
530 
531  if (!is_array($a_ids))
532  {
533  return false;
534  }
535  else
536  {
537  // get all "top" ids, i.e. remove ids, that have a selected parent
538  foreach($a_ids as $id)
539  {
540  $path = $tree->getPathId($id);
541  $take = true;
542  foreach($path as $path_id)
543  {
544  if ($path_id != $id && in_array($path_id, $a_ids))
545  {
546  $take = false;
547  }
548  }
549  if ($take)
550  {
551  $cut_ids[] = $id;
552  }
553  }
554  }
555 
556  ilSkillTreeNode::clipboardCopy($a_tree_id, $cut_ids);
557 
558  // remove the objects from the tree
559  // note: we are getting skills/categories which are *not* in the tree
560  // we do not delete any pages/chapters here
561  foreach ($cut_ids as $id)
562  {
563  $curnode = $tree->getNodeData($id);
564  if ($tree->isInTree($id))
565  {
566  $tree->deleteTree($curnode);
567  }
568  }
569 
570  }
571 
572 
576  static function clipboardCopy($a_tree_id, $a_ids)
577  {
578  global $ilUser;
579 
580  self::clearClipboard();
581  include_once("./Services/Skill/classes/class.ilSkillTree.php");
582  $tree = new ilSkillTree();
583 
584  // put them into the clipboard
585  $time = date("Y-m-d H:i:s", time());
586  foreach ($a_ids as $id)
587  {
588  $curnode = "";
589  if ($tree->isInTree($id))
590  {
591  $curnode = $tree->getNodeData($id);
592  $subnodes = $tree->getSubTree($curnode);
593  foreach($subnodes as $subnode)
594  {
595  if ($subnode["child"] != $id)
596  {
597  $ilUser->addObjectToClipboard($subnode["child"],
598  $subnode["type"], $subnode["title"],
599  $subnode["parent"], $time, $subnode["lft"]);
600  }
601  }
602  }
603  $order = ($curnode["lft"] > 0)
604  ? $curnode["lft"]
605  : (int) ($order + 1);
606  $ilUser->addObjectToClipboard($id,
608  $order);
609  }
610  }
611 
612 
616  static function insertItemsFromClip($a_type, $a_obj_id)
617  {
618  global $ilCtrl, $ilUser;
619 
620  // @todo: move this to a service since it can be used here, too
621  include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
622 
623  include_once("./Services/Skill/classes/class.ilSkillTree.php");
624  $tree = new ilSkillTree();
625 
626  $parent_id = $a_obj_id;
628 
629  // cut and paste
630  $skills = $ilUser->getClipboardObjects($a_type); // this will get all skills _regardless_ of level
631  $copied_nodes = array();
632  foreach ($skills as $skill)
633  {
634  // if skill was already copied as part of tree - do not copy it again
635  if(!in_array($skill["id"], array_keys($copied_nodes)))
636  {
637  $cid = ilSkillTreeNode::pasteTree($skill["id"], $parent_id, $target,
638  $skill["insert_time"], $copied_nodes,
639  (ilEditClipboard::getAction() == "copy"), true);
640 // $target = $cid;
641  }
642  }
643 
644 // if (ilEditClipboard::getAction() == "cut")
645 // {
646  self::clearClipboard();
647 // }
648 
650  in_array($a_type, array("sktp", "sctp")));
651 
652  return $copied_nodes;
653  }
654 
661  static function clearClipboard()
662  {
663  global $ilUser;
664 
665  $ilUser->clipboardDeleteObjectsOfType("skll");
666  $ilUser->clipboardDeleteObjectsOfType("scat");
667  $ilUser->clipboardDeleteObjectsOfType("sktr");
668  $ilUser->clipboardDeleteObjectsOfType("sktp");
669  $ilUser->clipboardDeleteObjectsOfType("sctp");
670  include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
672  }
673 
674 
678  static function pasteTree($a_item_id, $a_parent_id, $a_target, $a_insert_time,
679  &$a_copied_nodes, $a_as_copy = false, $a_add_suffix = false)
680  {
681  global $ilUser, $ilias, $ilLog, $lng;
682 
683  $item_type = ilSkillTreeNode::_lookupType($a_item_id);
684 
685  if ($item_type == "scat")
686  {
687  include_once("./Services/Skill/classes/class.ilSkillCategory.php");
688  $item = new ilSkillCategory($a_item_id);
689  }
690  else if ($item_type == "skll")
691  {
692  include_once("./Services/Skill/classes/class.ilBasicSkill.php");
693  $item = new ilBasicSkill($a_item_id);
694  }
695  else if ($item_type == "sktr")
696  {
697  include_once("./Services/Skill/classes/class.ilSkillTemplateReference.php");
698  $item = new ilSkillTemplateReference($a_item_id);
699  }
700  else if ($item_type == "sktp")
701  {
702  include_once("./Services/Skill/classes/class.ilBasicSkillTemplate.php");
703  $item = new ilBasicSkillTemplate($a_item_id);
704  }
705  else if ($item_type == "sctp")
706  {
707  include_once("./Services/Skill/classes/class.ilSkillTemplateCategory.php");
708  $item = new ilSkillTemplateCategory($a_item_id);
709  }
710 
711  $ilLog->write("Getting from clipboard type ".$item_type.", ".
712  "Item ID: ".$a_item_id);
713 
714  if ($a_as_copy)
715  {
716  $target_item = $item->copy();
717  if($a_add_suffix)
718  {
719  $target_item->setTitle($target_item->getTitle()." ".$lng->txt("copy_of_suffix"));
720  $target_item->update();
721  }
722  $a_copied_nodes[$item->getId()] = $target_item->getId();
723  }
724  else
725  {
726  $target_item = $item;
727  }
728 
729  $ilLog->write("Putting into skill tree type ".$target_item->getType().
730  "Item ID: ".$target_item->getId().", Parent: ".$a_parent_id.", ".
731  "Target: ".$a_target);
732 
733  ilSkillTreeNode::putInTree($target_item, $a_parent_id, $a_target);
734 
735  $childs = $ilUser->getClipboardChilds($item->getId(), $a_insert_time);
736 
737  foreach($childs as $child)
738  {
739  ilSkillTreeNode::pasteTree($child["id"], $target_item->getId(),
740  IL_LAST_NODE, $a_insert_time, $a_copied_nodes, $a_as_copy);
741  }
742 
743  return $target_item->getId();
744  }
745 
752  static function isInTree($a_id)
753  {
754  $skill_tree = new ilSkillTree();
755  if ($skill_tree->isInTree($a_id))
756  {
757  return true;
758  }
759  return false;
760  }
761 
768  static function getAllSelfEvaluationNodes()
769  {
770  global $ilDB;
771 
772  $set = $ilDB->query("SELECT obj_id, title FROM skl_tree_node WHERE ".
773  " self_eval = ".$ilDB->quote(true, "integer")." ORDER BY TITLE "
774  );
775  $nodes = array();
776  while ($rec = $ilDB->fetchAssoc($set))
777  {
778  $nodes[$rec["obj_id"]] = $rec["title"];
779  }
780  return $nodes;
781  }
782 
789  static function getTopTemplates()
790  {
791  $tr = new ilSkillTree();
792  $childs = $tr->getChildsByTypeFilter($tr->getRootId(), array("sktp", "sctp"));
793 
794  return $childs;
795  }
796 
803  static function getSelectableSkills()
804  {
805  global $ilDB;
806 
807  $set = $ilDB->query("SELECT * FROM skl_tree_node ".
808  " WHERE self_eval = ".$ilDB->quote(1, "integer")
809  );
810 
811  $sel_skills = array();
812  while ($rec = $ilDB->fetchAssoc($set))
813  {
814  $sel_skills[] = $rec;
815  }
816 
817  return $sel_skills;
818  }
819 
826  static function saveChildsOrder($a_par_id, $a_childs_order, $a_templates = false)
827  {
828  include_once("./Services/Skill/classes/class.ilSkillTree.php");
829  $skill_tree = new ilSkillTree();
830 
831  if ($a_par_id != $skill_tree->readRootId())
832  {
833  $childs = $skill_tree->getChilds($a_par_id);
834  }
835  else
836  {
837  if ($a_templates)
838  {
839  $childs = $skill_tree->getChildsByTypeFilter($a_par_id,
840  array("skrt", "sktp", "sctp"));
841  }
842  else
843  {
844  $childs = $skill_tree->getChildsByTypeFilter($a_par_id,
845  array("skrt", "skll", "scat", "sktr"));
846  }
847  }
848 
849  foreach ($childs as $k => $c)
850  {
851  if (isset($a_childs_order[$c["child"]]))
852  {
853  $childs[$k]["order_nr"] = (int) $a_childs_order[$c["child"]];
854  }
855  }
856 
857  $childs = ilUtil::sortArray($childs, "order_nr", "asc", true);
858 
859  $cnt = 10;
860  foreach ($childs as $c)
861  {
862  ilSkillTreeNode::_writeOrderNr($c["child"], $cnt);
863  $cnt += 10;
864  }
865  }
866 
876  static function getIconPath($a_obj_id, $a_type, $a_size = "", $a_status = 0)
877  {
878  if ($a_status == self::STATUS_DRAFT && $a_type == "sctp")
879  {
880  $a_type = "scat";
881  }
882  if ($a_status == self::STATUS_DRAFT && $a_type == "sktp")
883  {
884  $a_type = "skll";
885  }
886 
887  $off = ($a_status == self::STATUS_DRAFT)
888  ? "_off"
889  : "";
890 
891  $a_name = "icon_".$a_type.$a_size.$off.".svg";
892  if ($a_type == "sktr")
893  {
894  include_once("./Services/Skill/classes/class.ilSkillTemplateReference.php");
896  $type = ilSkillTreeNode::_lookupType($tid);
897  if ($type == "sctp")
898  {
899  $a_name = "icon_sctr".$a_size.$off.".svg";
900  }
901  }
902  $vers = "vers=".str_replace(array(".", " "), "-", ILIAS_VERSION);
903  return ilUtil::getImagePath($a_name)."?".$vers;
904  }
905 
912  public static function findSkills($a_term)
913  {
914  global $ilDB;
915 
916  $res = array();
917  $candidates = array();
918 
919  $skill_tree = new ilSkillTree();
920 
921  $sql = "SELECT * ".
922  " FROM skl_tree_node".
923  " WHERE ".$ilDB->like("title", "text", "%".$a_term."%");
924  $sql .= " ORDER BY title";
925  $set = $ilDB->query($sql);
926  include_once("./Services/Skill/classes/class.ilSkillTemplateReference.php");
927  while($row = $ilDB->fetchAssoc($set))
928  {
929  if (in_array($row["type"], array("sctp", "sktp")))
930  {
931  // need to get "top template" first! (if it is already the top level, do not use it!)
932  $path = $skill_tree->getSkillTreePath($row["obj_id"]);
933  if ($path[1]["child"] != $row["obj_id"])
934  {
936  foreach ($trefs as $tref)
937  {
938  $candidates[] = array("tref_id" => $tref, "skill_id" => $row["obj_id"], "title" => $row["title"]);
939  }
940  }
941  }
942  else if ($row["type"] == "sktr")
943  {
944  // works
945  $candidates[] = array("tref_id" => $row["obj_id"], "skill_id" => ilSkillTemplateReference::_lookupTemplateId($row["obj_id"]), "title" => $row["title"]);
946  }
947  else
948  {
949  // works
950  $candidates[] = array("tref_id" => 0, "skill_id" => $row["obj_id"], "title" => $row["title"]);
951  }
952  }
953 
954  foreach ($candidates as $c)
955  {
956  // if we get a path array, and the array has items try to use the data
957  $path = $skill_tree->getSkillTreePath($c["skill_id"], $c["tref_id"]);
958  $use = false;
959  if (is_array($path) && count($path) > 0)
960  {
961  $use = true;
962  }
963 
964  // if any inactive/outdated -> do not use the data
965  if (is_array($path))
966  {
967  foreach ($path as $p)
968  {
969  if ($p["status"] > 0)
970  {
971  $use = false;
972  }
973  }
974  }
975  if ($use)
976  {
977  if (!in_array($c["title"], $res))
978  {
979  $res[] = $c["title"];
980  }
981  }
982  }
983 
984 
985  return $res;
986  }
987 
994  static function getAllCSkillIdsForNodeIds(array $a_node_ids)
995  {
996  include_once("./Services/Skill/classes/class.ilSkillTemplateReference.php");
997  $cskill_ids = array();
998  foreach($a_node_ids as $id)
999  {
1000  if (in_array(self::_lookupType($id), array("skll", "scat", "sktr")))
1001  {
1002  $skill_id = $id;
1003  $tref_id = 0;
1004  if (ilSkillTreeNode::_lookupType($id) == "sktr")
1005  {
1007  $tref_id = $id;
1008  }
1009  $cskill_ids[] = array("skill_id" => $skill_id, "tref_id" => $tref_id);
1010  }
1011  if (in_array(ilSkillTreeNode::_lookupType($id), array("sktp", "sctp")))
1012  {
1014  {
1015  $cskill_ids[] = array("skill_id" => $id, "tref_id" => $tref_id);
1016  }
1017  }
1018  // for cats, skills and template references, get "real" usages
1019  // for skill and category templates check usage in references
1020  }
1021  return $cskill_ids;
1022  }
1023 
1024 
1025 
1026 }
1027 ?>
static getAllCSkillIdsForNodeIds(array $a_node_ids)
Get all possible common skill IDs for node IDs.
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.
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.
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
getImportId()
Get import id.
static _lookupType($a_obj_id)
Lookup Type.
global $ilCtrl
Definition: ilias.php:18
$a_type
Definition: workflow.php:93
getOrderNr()
Get order nr.
static uniqueTypesCheck($a_items)
Check for unique types.
static findSkills($a_term)
Find skills.
static isInTree($a_id)
Is id in tree?
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
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
$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.
setCreationDate($a_val)
Set creation date.
Create styles array
The data for the language used.
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.
global $lng
Definition: privfeed.php:17
A node in the skill tree.
global $ilBench
Definition: ilias.php:18
global $ilDB
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
setStatus($a_val)
Set status.
static _lookupStatus($a_obj_id)
Lookup Status.
Basic Skill.
static _writeOrderNr($a_obj_id, $a_nr)
Write Order Nr.
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.