ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilLMObject.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
4
16{
17 const CHAPTER_TITLE = "st_title";
18 const PAGE_TITLE = "pg_title";
19 const NO_HEADER = "none";
20
24 protected $user;
25
26 public $lm_id;
27 public $type;
28 public $id;
29 public $meta_data;
30 public $data_record; // assoc array of lm_data record
32 public $title;
35 public $active = true;
36 protected static $data_records = array();
37
41 protected $db;
42
46 public function __construct($a_content_obj, $a_id = 0)
47 {
48 global $DIC;
49 $this->user = $DIC->user();
50
51 $this->db = $DIC->database();
52
53 $this->id = $a_id;
54 $this->setContentObject($a_content_obj);
55 $this->setLMId($a_content_obj->getId());
56 if ($a_id != 0) {
57 $this->read();
58 }
59 }
60
73 public function MDUpdateListener($a_element)
74 {
75 switch ($a_element) {
76 case 'General':
77
78 // Update Title and description
79 $md = new ilMD($this->getLMId(), $this->getId(), $this->getType());
80 $md_gen = $md->getGeneral();
81
82 ilLMObject::_writeTitle($this->getId(), $md_gen->getTitle());
83
84 foreach ($md_gen->getDescriptionIds() as $id) {
85 $md_des = $md_gen->getDescription($id);
86 // ilLMObject::_writeDescription($this->getId(),$md_des->getDescription());
87 break;
88 }
89 break;
90
91 case 'Educational':
92 $obj_lp = ilObjectLP::getInstance($this->getLMId());
93 if (in_array(
94 $obj_lp->getCurrentMode(),
96 )) {
98 }
99 break;
100
101 default:
102 }
103 return true;
104 }
105
106
110 public static function _lookupNID($a_lm_id, $a_lm_obj_id, $a_type)
111 {
112 $md = new ilMD($a_lm_id, $a_lm_obj_id, $a_type);
113 $md_gen = $md->getGeneral();
114 if (is_object($md_gen)) {
115 foreach ($md_gen->getIdentifierIds() as $id) {
116 $md_id = $md_gen->getIdentifier($id);
117 if ($md_id->getCatalog() == "ILIAS_NID") {
118 return $md_id->getEntry();
119 }
120 }
121 }
122
123 return false;
124 }
125
126
130 public function createMetaData()
131 {
133
134 $md_creator = new ilMDCreator($this->getLMId(), $this->getId(), $this->getType());
135 $md_creator->setTitle($this->getTitle());
136 $md_creator->setTitleLanguage($ilUser->getPref('language'));
137 $md_creator->setDescription($this->getDescription());
138 $md_creator->setDescriptionLanguage($ilUser->getPref('language'));
139 $md_creator->setKeywordLanguage($ilUser->getPref('language'));
140 $md_creator->setLanguage($ilUser->getPref('language'));
141 $md_creator->create();
142
143 return true;
144 }
145
149 public function updateMetaData()
150 {
151 $md = new ilMD($this->getLMId(), $this->getId(), $this->getType());
152 $md_gen = $md->getGeneral();
153 $md_gen->setTitle($this->getTitle());
154
155 // sets first description (maybe not appropriate)
156 $md_des_ids = $md_gen->getDescriptionIds();
157 if (count($md_des_ids) > 0) {
158 $md_des = $md_gen->getDescription($md_des_ids[0]);
159 // $md_des->setDescription($this->getDescription());
160 $md_des->update();
161 }
162 $md_gen->update();
163 }
164
165
169 public function deleteMetaData()
170 {
171 // Delete meta data
172 $md = new ilMD($this->getLMId(), $this->getId(), $this->getType());
173 $md->deleteAll();
174 }
175
176
177
181 public function setDataRecord($a_record)
182 {
183 $this->data_record = $a_record;
184 }
185
186 public function read()
187 {
189
190 if (!isset($this->data_record)) {
191 $query = "SELECT * FROM lm_data WHERE obj_id = " .
192 $ilDB->quote($this->id, "integer");
193 $obj_set = $ilDB->query($query);
194 $this->data_record = $ilDB->fetchAssoc($obj_set);
195 }
196
197 $this->type = $this->data_record["type"];
198 $this->setImportId($this->data_record["import_id"]);
199 $this->setTitle($this->data_record["title"]);
200 $this->setShortTitle($this->data_record["short_title"]);
201 $this->setLayout($this->data_record["layout"]);
202 }
203
204
211 public static function preloadDataByLM($a_lm_id)
212 {
213 global $DIC;
214
215 $ilDB = $DIC->database();
216
217 $set = $ilDB->query(
218 "SELECT * FROM lm_data " .
219 " WHERE lm_id = " . $ilDB->quote($a_lm_id, "integer")
220 );
221 while ($rec = $ilDB->fetchAssoc($set)) {
222 self::$data_records[$rec["obj_id"]] = $rec;
223 }
224 return count(self::$data_records);
225 }
226
227
233 public function setTitle($a_title)
234 {
235 $this->title = $a_title;
236 }
237
243 public function getTitle()
244 {
245 return $this->title;
246 }
247
253 public function setShortTitle($a_title)
254 {
255 $this->short_title = $a_title;
256 }
257
263 public function getShortTitle()
264 {
265 return $this->short_title;
266 }
267
268
274 protected static function _lookup($a_obj_id, $a_field)
275 {
276 global $DIC;
277
278 $ilDB = $DIC->database();
279
280 if (isset(self::$data_records[$a_obj_id])) {
281 return self::$data_records[$a_obj_id][$a_field];
282 }
283
284 $query = "SELECT " . $a_field . " FROM lm_data WHERE obj_id = " .
285 $ilDB->quote($a_obj_id, "integer");
286 $obj_set = $ilDB->query($query);
287 $obj_rec = $ilDB->fetchAssoc($obj_set);
288
289 return $obj_rec[$a_field];
290 }
291
298 public static function _lookupTitle($a_obj_id)
299 {
300 return self::_lookup($a_obj_id, "title");
301 }
302
309 public static function _lookupShortTitle($a_obj_id)
310 {
311 return self::_lookup($a_obj_id, "short_title");
312 }
313
320 public static function _lookupType($a_obj_id, $a_lm_id = 0)
321 {
322 global $DIC;
323
324 $ilDB = $DIC->database();
325
326 if (isset(self::$data_records[$a_obj_id])) {
327 if ($a_lm_id == 0 || self::$data_records[$a_obj_id]["lm_id"] == $a_lm_id) {
328 return self::$data_records[$a_obj_id]["type"];
329 }
330 }
331
332 if ($a_lm_id) {
333 $and = ' AND lm_id = ' . $ilDB->quote($a_lm_id, 'integer');
334 }
335
336 $query = "SELECT type FROM lm_data WHERE obj_id = " . $ilDB->quote($a_obj_id, "integer") . $and;
337 $obj_set = $ilDB->query($query);
338 $obj_rec = $ilDB->fetchAssoc($obj_set);
339
340 return $obj_rec["type"];
341 }
342
343
344 public static function _writeTitle($a_obj_id, $a_title)
345 {
346 global $DIC;
347
348 $ilDB = $DIC->database();
349
350 $query = "UPDATE lm_data SET " .
351 " title = " . $ilDB->quote($a_title, "text") .
352 " WHERE obj_id = " . $ilDB->quote($a_obj_id, "integer");
353 $ilDB->manipulate($query);
354 }
355
356
357 public function setDescription($a_description)
358 {
359 $this->description = $a_description;
360 }
361
362 public function getDescription()
363 {
364 return $this->description;
365 }
366
367 public function setType($a_type)
368 {
369 $this->type = $a_type;
370 }
371
372 public function getType()
373 {
374 return $this->type;
375 }
376
377 public function setLMId($a_lm_id)
378 {
379 $this->lm_id = $a_lm_id;
380 }
381
382 public function getLMId()
383 {
384 return $this->lm_id;
385 }
386
387 public function setContentObject(&$a_content_obj)
388 {
389 $this->content_object = $a_content_obj;
390 }
391
392 public function &getContentObject()
393 {
395 }
396
397 public function setId($a_id)
398 {
399 $this->id = $a_id;
400 }
401
402 public function getId()
403 {
404 return $this->id;
405 }
406
407 public function getImportId()
408 {
409 return $this->import_id;
410 }
411
412 public function setImportId($a_id)
413 {
414 $this->import_id = $a_id;
415 }
416
422 public function setLayout($a_val)
423 {
424 $this->layout = $a_val;
425 }
426
432 public function getLayout()
433 {
434 return $this->layout;
435 }
436
444 public static function _writeImportId($a_id, $a_import_id)
445 {
446 global $DIC;
447
448 $ilDB = $DIC->database();
449
450 $q = "UPDATE lm_data " .
451 "SET " .
452 "import_id = " . $ilDB->quote($a_import_id, "text") . "," .
453 "last_update = " . $ilDB->now() . " " .
454 "WHERE obj_id = " . $ilDB->quote($a_id, "integer");
455
456 $ilDB->manipulate($q);
457 }
458
459 public function create($a_upload = false)
460 {
462
463 // insert object data
464 $this->setId($ilDB->nextId("lm_data"));
465 $query = "INSERT INTO lm_data (obj_id, title, type, layout, lm_id, import_id, short_title, create_date) " .
466 "VALUES (" .
467 $ilDB->quote($this->getId(), "integer") . "," .
468 $ilDB->quote($this->getTitle(), "text") . "," .
469 $ilDB->quote($this->getType(), "text") . ", " .
470 $ilDB->quote($this->getLayout(), "text") . ", " .
471 $ilDB->quote($this->getLMId(), "integer") . "," .
472 $ilDB->quote($this->getImportId(), "text") . "," .
473 $ilDB->quote($this->getShortTitle(), "text") .
474 ", " . $ilDB->now() . ")";
475 $ilDB->manipulate($query);
476
477 // create history entry
479 $this->getId(),
480 "create",
481 "",
482 $this->content_object->getType() . ":" . $this->getType()
483 );
484
485 if (!$a_upload) {
486 $this->createMetaData();
487 }
488 }
489
493 public function update()
494 {
496
497 $this->updateMetaData();
498
499 $query = "UPDATE lm_data SET " .
500 " lm_id = " . $ilDB->quote($this->getLMId(), "integer") .
501 " ,title = " . $ilDB->quote($this->getTitle(), "text") .
502 " ,short_title = " . $ilDB->quote($this->getShortTitle(), "text") .
503 " ,layout = " . $ilDB->quote($this->getLayout(), "text") .
504 " WHERE obj_id = " . $ilDB->quote($this->getId(), "integer");
505
506 $ilDB->manipulate($query);
507 }
508
509
518 public static function _writePublicAccessStatus($a_pages, $a_cont_obj_id)
519 {
520 global $DIC;
521
522 $ilDB = $DIC->database();
523 $ilLog = $DIC["ilLog"];
524 $ilErr = $DIC["ilErr"];
525
526 if (!is_array($a_pages)) {
527 $a_pages = array(0);
528 /*$message = sprintf('ilLMObject::_writePublicAccessStatus(): Invalid parameter! $a_pages must be an array');
529 $ilLog->write($message,$ilLog->WARNING);
530 $ilErr->raiseError($message,$ilErr->MESSAGE);
531 return false;*/
532 }
533
534 if (empty($a_cont_obj_id)) {
535 $message = sprintf('ilLMObject::_writePublicAccessStatus(): Invalid parameter! $a_cont_obj_id is empty');
536 $ilLog->write($message, $ilLog->WARNING);
537 $ilErr->raiseError($message, $ilErr->MESSAGE);
538 return false;
539 }
540
541 // update structure entries: if at least one page of a chapter is public set chapter to public too
542 $lm_tree = new ilTree($a_cont_obj_id);
543 $lm_tree->setTableNames('lm_tree', 'lm_data');
544 $lm_tree->setTreeTablePK("lm_id");
545 $lm_tree->readRootId();
546
547 // get all st entries of cont_obj
548 $q = "SELECT obj_id FROM lm_data " .
549 "WHERE lm_id = " . $ilDB->quote($a_cont_obj_id, "integer") . " " .
550 "AND type = 'st'";
551 $r = $ilDB->query($q);
552
553 // add chapters with a public page to a_pages
554 while ($row = $ilDB->fetchAssoc($r)) {
555 $childs = $lm_tree->getChilds($row["obj_id"]);
556
557 foreach ($childs as $page) {
558 if ($page["type"] == "pg" and in_array($page["obj_id"], $a_pages)) {
559 array_push($a_pages, $row["obj_id"]);
560 break;
561 }
562 }
563 }
564
565 // update public access status of all pages of cont_obj
566 $q = "UPDATE lm_data SET " .
567 "public_access = CASE " .
568 "WHEN " . $ilDB->in("obj_id", $a_pages, false, "integer") . " " .
569 "THEN " . $ilDB->quote("y", "text") .
570 "ELSE " . $ilDB->quote("n", "text") .
571 "END " .
572 "WHERE lm_id = " . $ilDB->quote($a_cont_obj_id, "integer") . " " .
573 "AND " . $ilDB->in("type", array("pg", "st"), false, "text");
574 $ilDB->manipulate($q);
575
576 return true;
577 }
578
579 public static function _isPagePublic($a_node_id, $a_check_public_mode = false)
580 {
581 global $DIC;
582
583 $ilDB = $DIC->database();
584 $ilLog = $DIC["ilLog"];
585
586 if (empty($a_node_id)) {
587 $message = sprintf('ilLMObject::_isPagePublic(): Invalid parameter! $a_node_id is empty');
588 $ilLog->write($message, $ilLog->WARNING);
589 return false;
590 }
591
592 if ($a_check_public_mode === true) {
593 $lm_id = ilLMObject::_lookupContObjId($a_node_id);
594
595 $q = "SELECT public_access_mode FROM content_object WHERE id = " .
596 $ilDB->quote($lm_id, "integer");
597 $r = $ilDB->query($q);
598 $row = $ilDB->fetchAssoc($r);
599
600 if ($row["public_access_mode"] == "complete") {
601 return true;
602 }
603 }
604
605 $q = "SELECT public_access FROM lm_data WHERE obj_id=" .
606 $ilDB->quote($a_node_id, "integer");
607 $r = $ilDB->query($q);
608 $row = $ilDB->fetchAssoc($r);
609
610 return ilUtil::yn2tf($row["public_access"]);
611 }
612
616 public function delete($a_delete_meta_data = true)
617 {
619
620 $query = "DELETE FROM lm_data WHERE obj_id = " .
621 $ilDB->quote($this->getId(), "integer");
622 $ilDB->manipulate($query);
623
624 $this->deleteMetaData();
625 }
626
638 public static function _getIdForImportId($a_import_id)
639 {
640 global $DIC;
641
642 $ilDB = $DIC->database();
643
644 $q = "SELECT obj_id FROM lm_data WHERE import_id = " .
645 $ilDB->quote($a_import_id, "text") . " " .
646 " ORDER BY create_date DESC";
647 $obj_set = $ilDB->query($q);
648 while ($obj_rec = $ilDB->fetchAssoc($obj_set)) {
649 $lm_id = ilLMObject::_lookupContObjID($obj_rec["obj_id"]);
650
651 // link only in learning module, that is not trashed
652 $ref_ids = ilObject::_getAllReferences($lm_id); // will be 0 if import of lm is in progress (new import)
653 if (count($ref_ids) == 0 || ilObject::_hasUntrashedReference($lm_id) ||
655 return $obj_rec["obj_id"];
656 }
657 }
658
659 return 0;
660 }
661
671 public static function _getAllObjectsForImportId($a_import_id, $a_in_lm = 0)
672 {
673 global $DIC;
674
675 $ilDB = $DIC->database();
676
677 $where = ($a_in_lm > 0)
678 ? " AND lm_id = " . $ilDB->quote($a_in_lm, "integer") . " "
679 : "";
680
681 $q = "SELECT * FROM lm_data WHERE import_id = " .
682 $ilDB->quote($a_import_id, "text") . " " .
683 $where .
684 " ORDER BY create_date DESC";
685 $obj_set = $ilDB->query($q);
686
687 $items = array();
688 while ($obj_rec = $ilDB->fetchAssoc($obj_set)) {
689 // check, whether lm is not trashed
690 if (ilObject::_hasUntrashedReference($obj_rec["lm_id"])) {
691 $items[] = $obj_rec;
692 }
693 }
694
695 return $items;
696 }
697
705 public static function _exists($a_id)
706 {
707 global $DIC;
708
709 $ilDB = $DIC->database();
710
711 if (is_int(strpos($a_id, "_"))) {
713 }
714
715 $q = "SELECT * FROM lm_data WHERE obj_id = " .
716 $ilDB->quote($a_id, "integer");
717 $obj_set = $ilDB->query($q);
718 if ($obj_rec = $ilDB->fetchAssoc($obj_set)) {
719 return true;
720 } else {
721 return false;
722 }
723 }
724
728 public static function getObjectList($lm_id, $type = "")
729 {
730 global $DIC;
731
732 $ilDB = $DIC->database();
733
734 $type_str = ($type != "")
735 ? "AND type = " . $ilDB->quote($type, "text") . " "
736 : "";
737
738 $query = "SELECT * FROM lm_data " .
739 "WHERE lm_id= " . $ilDB->quote($lm_id, "integer") . " " .
740 $type_str . " " .
741 "ORDER BY title";
742 $obj_set = $ilDB->query($query);
743 $obj_list = array();
744 while ($obj_rec = $ilDB->fetchAssoc($obj_set)) {
745 $obj_list[] = array("obj_id" => $obj_rec["obj_id"],
746 "title" => $obj_rec["title"],
747 "import_id" => $obj_rec["import_id"],
748 "type" => $obj_rec["type"]);
749 }
750 return $obj_list;
751 }
752
753
757 public static function _deleteAllObjectData(&$a_cobj)
758 {
759 global $DIC;
760
761 $ilDB = $DIC->database();
762
763 $query = "SELECT * FROM lm_data " .
764 "WHERE lm_id= " . $ilDB->quote($a_cobj->getId(), "integer");
765 $obj_set = $ilDB->query($query);
766
767 while ($obj_rec = $ilDB->fetchAssoc($obj_set)) {
768 $lm_obj = ilLMObjectFactory::getInstance($a_cobj, $obj_rec["obj_id"], false);
769
770 if (is_object($lm_obj)) {
771 $lm_obj->delete(true);
772 }
773 }
774
775 return true;
776 }
777
781 public static function _lookupContObjID($a_id)
782 {
783 global $DIC;
784
785 $ilDB = $DIC->database();
786
787 if (isset(self::$data_records[$a_id])) {
788 return self::$data_records[$a_id]["lm_id"];
789 }
790
791 $query = "SELECT lm_id FROM lm_data WHERE obj_id = " .
792 $ilDB->quote($a_id, "integer");
793 $obj_set = $ilDB->query($query);
794 $obj_rec = $ilDB->fetchAssoc($obj_set);
795
796 return $obj_rec["lm_id"];
797 }
798
802 public static function putInTree($a_obj, $a_parent_id = "", $a_target_node_id = "")
803 {
804 global $DIC;
805
806 $ilLog = $DIC["ilLog"];
807
808 $tree = new ilTree($a_obj->getContentObject()->getId());
809 $tree->setTableNames('lm_tree', 'lm_data');
810 $tree->setTreeTablePK("lm_id");
811
812 // determine parent
813 $parent_id = ($a_parent_id != "")
814 ? $a_parent_id
815 : $tree->getRootId();
816
817 // determine target
818 if ($a_target_node_id != "") {
819 $target = $a_target_node_id;
820 } else {
821 // determine last child that serves as predecessor
822 if ($a_obj->getType() == "st") {
823 $s_types = array("st", "pg");
824 $childs = $tree->getChildsByTypeFilter($parent_id, $s_types);
825 } else {
826 $s_types = "pg";
827 $childs = $tree->getChildsByType($parent_id, $s_types);
828 }
829
830 if (count($childs) == 0) {
831 $target = IL_FIRST_NODE;
832 } else {
833 $target = $childs[count($childs) - 1]["obj_id"];
834 }
835 }
836
837 if ($tree->isInTree($parent_id) && !$tree->isInTree($a_obj->getId())) {
838 $ilLog->write("LMObject::putInTree: insertNode, ID: " . $a_obj->getId() .
839 "Parent ID: " . $parent_id . ", Target: " . $target);
840
841 $tree->insertNode($a_obj->getId(), $parent_id, $target);
842 }
843 }
844
852 public static function getTree($a_cont_obj_id)
853 {
854 $tree = new ilTree($a_cont_obj_id);
855 $tree->setTableNames('lm_tree', 'lm_data');
856 $tree->setTreeTablePK("lm_id");
857 $tree->readRootId();
858
859 return $tree;
860 }
861
865 public static function clipboardCut($a_cont_obj_id, $a_ids)
866 {
867 $tree = ilLMObject::getTree($a_cont_obj_id);
868
869 if (!is_array($a_ids)) {
870 return false;
871 } else {
872 // get all "top" ids, i.e. remove ids, that have a selected parent
873 foreach ($a_ids as $id) {
874 $path = $tree->getPathId($id);
875 $take = true;
876 foreach ($path as $path_id) {
877 if ($path_id != $id && in_array($path_id, $a_ids)) {
878 $take = false;
879 }
880 }
881 if ($take) {
882 $cut_ids[] = $id;
883 }
884 }
885 }
886
887 ilLMObject::clipboardCopy($a_cont_obj_id, $cut_ids);
888
889 // remove the objects from the tree
890 // note: we are getting chapters which are *not* in the tree
891 // we do not delete any pages/chapters here
892 foreach ($cut_ids as $id) {
893 $curnode = $tree->getNodeData($id);
894 if ($tree->isInTree($id)) {
895 $tree->deleteTree($curnode);
896 }
897 }
898 }
899
903 public static function clipboardCopy($a_cont_obj_id, $a_ids)
904 {
905 global $DIC;
906
907 $ilUser = $DIC->user();
908
909 $tree = ilLMObject::getTree($a_cont_obj_id);
910
911 $ilUser->clipboardDeleteObjectsOfType("pg");
912 $ilUser->clipboardDeleteObjectsOfType("st");
913
914 // put them into the clipboard
915 $time = date("Y-m-d H:i:s", time());
916 $order = 0;
917 foreach ($a_ids as $id) {
918 $curnode = array();
919 if ($tree->isInTree($id)) {
920 $curnode = $tree->getNodeData($id);
921 $subnodes = $tree->getSubTree($curnode);
922 foreach ($subnodes as $subnode) {
923 if ($subnode["child"] != $id) {
924 $ilUser->addObjectToClipboard(
925 $subnode["child"],
926 $subnode["type"],
927 $subnode["title"],
928 $subnode["parent"],
929 $time,
930 $subnode["lft"]
931 );
932 }
933 }
934 }
935 $order = ($curnode["lft"] > 0)
936 ? $curnode["lft"]
937 : (int) ($order + 1);
938 $ilUser->addObjectToClipboard(
939 $id,
942 0,
943 $time,
944 $order
945 );
946 }
947 }
948
952 public static function pasteTree(
953 $a_target_lm,
954 $a_item_id,
955 $a_parent_id,
956 $a_target,
957 $a_insert_time,
958 &$a_copied_nodes,
959 $a_as_copy = false,
960 $a_source_lm = null
961 ) {
962 global $DIC;
963
964 $ilUser = $DIC->user();
965 $ilLog = $DIC["ilLog"];
966
967 $item_lm_id = ilLMObject::_lookupContObjID($a_item_id);
968 $item_type = ilLMObject::_lookupType($a_item_id);
969 $lm_obj = ilObjectFactory::getInstanceByObjId($item_lm_id);
970 if ($item_type == "st") {
971 $item = new ilStructureObject($lm_obj, $a_item_id);
972 } elseif ($item_type == "pg") {
973 $item = new ilLMPageObject($lm_obj, $a_item_id);
974 }
975
976 $ilLog->write("Getting from clipboard type " . $item_type . ", " .
977 "Item ID: " . $a_item_id . ", of original LM: " . $item_lm_id);
978
979 if ($item_lm_id != $a_target_lm->getId() && !$a_as_copy) {
980 // @todo: check whether st is NOT in tree
981
982 // "move" metadata to new lm
983 $md = new ilMD($item_lm_id, $item->getId(), $item->getType());
984 $new_md = $md->cloneMD($a_target_lm->getId(), $item->getId(), $item->getType());
985
986 // update lm object
987 $item->setLMId($a_target_lm->getId());
988 $item->setContentObject($a_target_lm);
989 $item->update();
990
991 // delete old meta data set
992 $md->deleteAll();
993
994 if ($item_type == "pg") {
995 $page = $item->getPageObject();
996 $page->buildDom();
997 $page->setParentId($a_target_lm->getId());
998 $page->update();
999 }
1000 }
1001
1002 if ($a_as_copy) {
1003 $target_item = $item->copy($a_target_lm);
1004 $a_copied_nodes[$item->getId()] = $target_item->getId();
1005 } else {
1006 $target_item = $item;
1007 }
1008
1009 $ilLog->write("Putting into tree type " . $target_item->getType() .
1010 "Item ID: " . $target_item->getId() . ", Parent: " . $a_parent_id . ", " .
1011 "Target: " . $a_target . ", Item LM:" . $target_item->getContentObject()->getId());
1012
1013 ilLMObject::putInTree($target_item, $a_parent_id, $a_target);
1014
1015 if ($a_source_lm == null) {
1016 $childs = $ilUser->getClipboardChilds($item->getId(), $a_insert_time);
1017 } else {
1018 $childs = $a_source_lm->lm_tree->getChilds($item->getId());
1019 foreach ($childs as $k => $child) {
1020 $childs[$k]["id"] = $childs[$k]["child"];
1021 }
1022 }
1023
1024 foreach ($childs as $child) {
1026 $a_target_lm,
1027 $child["id"],
1028 $target_item->getId(),
1030 $a_insert_time,
1031 $a_copied_nodes,
1032 $a_as_copy,
1033 $a_source_lm
1034 );
1035 }
1036
1037 return $target_item->getId();
1038 // @todo: write history (see pastePage)
1039 }
1040
1046 public static function saveTitles($a_lm, $a_titles, $a_lang = "-")
1047 {
1048 if ($a_lang == "") {
1049 $a_lang = "-";
1050 }
1051 if (is_array($a_titles)) {
1052 foreach ($a_titles as $id => $title) {
1053 // see #20375
1055 if ($a_lang == "-") {
1056 $lmobj = ilLMObjectFactory::getInstance($a_lm, $id, false);
1057 if (is_object($lmobj)) {
1058 // Update Title and description
1059 $md = new ilMD($a_lm->getId(), $id, $lmobj->getType());
1060 $md_gen = $md->getGeneral();
1061 if (is_object($md_gen)) { // see bug #0015843
1062 $md_gen->setTitle($title);
1063 $md_gen->update();
1064 $md->update();
1065 }
1067 }
1068 } else {
1069 $lmobjtrans = new ilLMObjTranslation($id, $a_lang);
1070 $lmobjtrans->setTitle($title);
1071 $lmobjtrans->save();
1072 }
1073 }
1074 }
1075 }
1076
1080 public static function updateInternalLinks($a_copied_nodes, $a_parent_type = "lm")
1081 {
1082 $all_fixes = array();
1083 foreach ($a_copied_nodes as $original_id => $copied_id) {
1084 $copied_type = ilLMObject::_lookupType($copied_id);
1085 $copy_lm = ilLMObject::_lookupContObjID($copied_id);
1086
1087 if ($copied_type == "pg") {
1088 foreach (ilPageObject::lookupTranslations($a_parent_type, $copied_id) as $l) {
1089 //
1090 // 1. Outgoing links from the copied page.
1091 //
1092 //$targets = ilInternalLink::_getTargetsOfSource($a_parent_type.":pg", $copied_id);
1093 $tpg = new ilLMPage($copied_id, 0, $l);
1094 $tpg->buildDom();
1095 $il = $tpg->getInternalLinks();
1096 $targets = array();
1097 foreach ($il as $l) {
1098 $targets[] = array("type" => ilInternalLink::_extractTypeOfTarget($l["Target"]),
1099 "id" => (int) ilInternalLink::_extractObjIdOfTarget($l["Target"]),
1100 "inst" => (int) ilInternalLink::_extractInstOfTarget($l["Target"]));
1101 }
1102 $fix = array();
1103 foreach ($targets as $target) {
1104 if (($target["inst"] == 0 || $target["inst"] = IL_INST_ID) &&
1105 ($target["type"] == "pg" || $target["type"] == "st")) {
1106 // first check, whether target is also within the copied set
1107 if ($a_copied_nodes[$target["id"]] > 0) {
1108 $fix[$target["id"]] = $a_copied_nodes[$target["id"]];
1109 } else {
1110 // now check, if a copy if the target is already in the same lm
1111
1112 // only if target is not already in the same lm!
1113 $trg_lm = ilLMObject::_lookupContObjID($target["id"]);
1114 if ($trg_lm != $copy_lm) {
1115 $lm_data = ilLMObject::_getAllObjectsForImportId("il__" . $target["type"] . "_" . $target["id"]);
1116 $found = false;
1117
1118 foreach ($lm_data as $item) {
1119 if (!$found && ($item["lm_id"] == $copy_lm)) {
1120 $fix[$target["id"]] = $item["obj_id"];
1121 $found = true;
1122 }
1123 }
1124 }
1125 }
1126 }
1127 }
1128
1129 // outgoing links to be fixed
1130 if (count($fix) > 0) {
1131 //echo "<br>--".$copied_id;
1132 //var_dump($fix);
1133 $t = ilObject::_lookupType($copy_lm);
1134 if (is_array($all_fixes[$t . ":" . $copied_id])) {
1135 $all_fixes[$t . ":" . $copied_id] += $fix;
1136 } else {
1137 $all_fixes[$t . ":" . $copied_id] = $fix;
1138 }
1139 }
1140 }
1141 }
1142
1143 if ($copied_type == "pg" ||
1144 $copied_type == "st") {
1145
1146 //
1147 // 2. Incoming links to the original pages
1148 //
1149 // A->B A2 (A+B currently copied)
1150 // A->C B2
1151 // B->A
1152 // C->A C2->A (C already copied)
1153 $original_lm = ilLMObject::_lookupContObjID($original_id);
1154 $original_type = ilObject::_lookupType($original_lm);
1155
1156 if ($original_lm != $copy_lm) {
1157
1158 // This gets sources that link to A+B (so we have C here)
1159 // (this also does already the trick when instance map areas are given in C)
1160 // int_link, where target_type, target_id, target_inst -> ok
1162 $copied_type,
1163 $original_id,
1164 0
1165 );
1166
1167 // mobs linking to $original_id
1168 // map_area, where link_type, target -> ok
1169 $mobs = ilMapArea::_getMobsForTarget("int", "il__" . $copied_type .
1170 "_" . $original_id);
1171
1172 // pages using these mobs
1173 foreach ($mobs as $mob) {
1174 // mob_usage, where id -> ok
1175 // mep_item, where foreign_id, type -> ok
1176 // mep_tree, where child -> already existed
1177 // il_news_item, where mob_id -> ok
1178 // map_area, where link_type, target -> aready existed
1179 // media_item, where id -> already existed
1180 // personal_clipboard, where item_id, type -> ok
1181 $usages = ilObjMediaObject::lookupUsages($mob);
1182 foreach ($usages as $usage) {
1183 if ($usage["type"] == "lm:pg" | $usage["type"] == "lm:st") {
1184 $sources[] = $usage;
1185 }
1186 }
1187 }
1188 $fix = array();
1189 foreach ($sources as $source) {
1190 $stype = explode(":", $source["type"]);
1191 $source_type = $stype[1];
1192
1193 if ($source_type == "pg" || $source_type == "st") {
1194 // first of all: source must be in original lm
1195 $src_lm = ilLMObject::_lookupContObjID($source["id"]);
1196
1197 if ($src_lm == $original_lm) {
1198 // check, if a copy if the source is already in the same lm
1199 // now we look for the latest copy of C in LM2
1201 "il__" . $source_type . "_" . $source["id"],
1202 $copy_lm
1203 );
1204 $found = false;
1205 foreach ($lm_data as $item) {
1206 if (!$found) {
1207 $fix[$item["obj_id"]][$original_id] = $copied_id;
1208 $found = true;
1209 }
1210 }
1211 }
1212 }
1213 }
1214 // outgoing links to be fixed
1215 if (count($fix) > 0) {
1216 foreach ($fix as $page_id => $fix_array) {
1217 $t = ilObject::_lookupType($copy_lm);
1218 if (is_array($all_fixes[$t . ":" . $page_id])) {
1219 $all_fixes[$t . ":" . $page_id] += $fix_array;
1220 } else {
1221 $all_fixes[$t . ":" . $page_id] = $fix_array;
1222 }
1223 }
1224 }
1225 }
1226 }
1227 }
1228
1229 foreach ($all_fixes as $pg => $fixes) {
1230 $pg = explode(":", $pg);
1231 foreach (ilPageObject::lookupTranslations($pg[0], $pg[1]) as $l) {
1232 $page = ilPageObjectFactory::getInstance($pg[0], $pg[1], 0, $l);
1233 if ($page->moveIntLinks($fixes)) {
1234 $page->update(true, true);
1235 }
1236 }
1237 }
1238 }
1239
1243 public static function uniqueTypesCheck($a_items)
1244 {
1245 $types = array();
1246 if (is_array($a_items)) {
1247 foreach ($a_items as $item) {
1249 $types[$type] = $type;
1250 }
1251 }
1252
1253 if (count($types) > 1) {
1254 return false;
1255 }
1256 return true;
1257 }
1258
1265 public static function writeLayout($a_obj_id, $a_layout, $a_lm = null)
1266 {
1267 global $DIC;
1268
1269 $ilDB = $DIC->database();
1270
1271 $t = ilLMObject::_lookupType($a_obj_id);
1272
1273 if ($t == "pg") {
1274 $query = "UPDATE lm_data SET " .
1275 " layout = " . $ilDB->quote($a_layout, "text") .
1276 " WHERE obj_id = " . $ilDB->quote($a_obj_id, "integer");
1277 $ilDB->manipulate($query);
1278 } elseif ($t == "st" && is_object($a_lm)) {
1279 $node = $a_lm->getLMTree()->getNodeData($a_obj_id);
1280 $child_nodes = $a_lm->getLMTree()->getSubTree($node);
1281 if (is_array($child_nodes) && count($child_nodes) > 0) {
1282 foreach ($child_nodes as $c) {
1283 if ($c["type"] == "pg") {
1284 $query = "UPDATE lm_data SET " .
1285 " layout = " . $ilDB->quote($a_layout, "text") .
1286 " WHERE obj_id = " . $ilDB->quote($c["child"], "integer");
1287 $ilDB->manipulate($query);
1288 }
1289 }
1290 }
1291 }
1292 }
1293
1299 public static function lookupLayout($a_obj_id)
1300 {
1301 global $DIC;
1302
1303 $ilDB = $DIC->database();
1304
1305 $query = "SELECT layout FROM lm_data WHERE obj_id = " .
1306 $ilDB->quote($a_obj_id, "integer");
1307 $obj_set = $ilDB->query($query);
1308 $obj_rec = $ilDB->fetchAssoc($obj_set);
1309
1310 return $obj_rec["layout"];
1311 }
1312
1319 public static function getPagesOfChapter($a_lm_id, $a_chap_id)
1320 {
1321 // update structure entries: if at least one page of a chapter is public set chapter to public too
1322 $lm_tree = new ilTree($a_lm_id);
1323 $lm_tree->setTableNames('lm_tree', 'lm_data');
1324 $lm_tree->setTreeTablePK("lm_id");
1325 $lm_tree->readRootId();
1326
1327 $childs = $lm_tree->getChildsByType($a_chap_id, "pg");
1328
1329 return $childs;
1330 }
1331
1338 public static function _getAllLMObjectsOfLM($a_lm_id, $a_type = "")
1339 {
1340 global $DIC;
1341
1342 $ilDB = $DIC->database();
1343
1344 $and = ($a_type != "")
1345 ? " AND type = " . $ilDB->quote($a_type, "text")
1346 : "";
1347
1348 $set = $ilDB->query("SELECT obj_id FROM lm_data " .
1349 " WHERE lm_id = " . $ilDB->quote($a_lm_id, "integer") . $and);
1350 $obj_ids = array();
1351 while ($rec = $ilDB->fetchAssoc($set)) {
1352 $obj_ids[] = $rec["obj_id"];
1353 }
1354
1355 return $obj_ids;
1356 }
1357
1358
1362
1369 public static function saveExportId($a_lm_id, $a_lmobj_id, $a_exp_id, $a_type = "pg")
1370 {
1371 global $DIC;
1372
1373 $ilDB = $DIC->database();
1374
1375 if (trim($a_exp_id) == "") {
1376 // delete export ids, if existing
1378 $a_lm_id,
1379 $a_lmobj_id,
1380 $a_type
1381 );
1382
1383 foreach ($entries as $id => $e) {
1384 if ($e["catalog"] == "ILIAS_NID") {
1385 $identifier = new ilMDIdentifier();
1386 $identifier->setMetaId($id);
1387 $identifier->delete();
1388 }
1389 }
1390 } else {
1391 // update existing entry
1393 $a_lm_id,
1394 $a_lmobj_id,
1395 $a_type
1396 );
1397
1398 $updated = false;
1399 foreach ($entries as $id => $e) {
1400 if ($e["catalog"] == "ILIAS_NID") {
1401 $identifier = new ilMDIdentifier();
1402 $identifier->setMetaId($id);
1403 $identifier->read();
1404 $identifier->setEntry($a_exp_id);
1405 $identifier->update();
1406 $updated = true;
1407 }
1408 }
1409
1410 // nothing updated? create a new one
1411 if (!$updated) {
1412 $md = new ilMD($a_lm_id, $a_lmobj_id, $a_type);
1413 $md_gen = $md->getGeneral();
1414 $identifier = $md_gen->addIdentifier();
1415 $identifier->setEntry($a_exp_id);
1416 $identifier->setCatalog("ILIAS_NID");
1417 $identifier->save();
1418 }
1419 }
1420 }
1421
1428 public static function getExportId($a_lm_id, $a_lmobj_id, $a_type = "pg")
1429 {
1430 // look for export id
1432 $a_lm_id,
1433 $a_lmobj_id,
1434 $a_type
1435 );
1436
1437 foreach ($entries as $e) {
1438 if ($e["catalog"] == "ILIAS_NID") {
1439 return $e["entry"];
1440 }
1441 }
1442 }
1443
1450 public function existsExportID($a_lm_id, $a_exp_id, $a_type = "pg")
1451 {
1452 return ilMDIdentifier::existsIdInRbacObject($a_lm_id, $a_type, "ILIAS_NID", $a_exp_id);
1453 }
1454
1458 public static function getDuplicateExportIDs($a_lm_id, $a_type = "pg")
1459 {
1460 $entries = ilMDIdentifier::_getEntriesForRbacObj($a_lm_id, $a_type);
1461 $res = array();
1462 foreach ($entries as $e) {
1463 if ($e["catalog"] == "ILIAS_NID") {
1464 if (ilLMObject::_exists($e["obj_id"])) {
1465 $res[trim($e["entry"])]++;
1466 }
1467 }
1468 }
1469 return $res;
1470 }
1471
1478 public function getExportIDInfo($a_lm_id, $a_exp_id, $a_type = "pg")
1479 {
1480 $data = ilMDIdentifier::readIdData($a_lm_id, $a_type, "ILIAS_NID", $a_exp_id);
1481 return $data;
1482 }
1483
1490 public static function _getPresentationTitle(
1491 $a_node,
1492 $a_mode = self::PAGE_TITLE,
1493 $a_include_numbers = false,
1494 $a_time_scheduled_activation = false,
1495 $a_force_content = false,
1496 $a_lm_id = 0,
1497 $a_lang = "-"
1498 ) {
1499 if ($a_lang == "") {
1500 $a_lang = "-";
1501 }
1502
1503 if ($a_node["type"] == "st") {
1505 $a_node["child"],
1506 self::CHAPTER_TITLE,
1507 $a_include_numbers,
1508 $a_time_scheduled_activation,
1509 $a_force_content,
1510 $a_lm_id,
1511 $a_lang
1512 );
1513 } else {
1515 $a_node["child"],
1516 $a_mode,
1517 $a_include_numbers,
1518 $a_time_scheduled_activation,
1519 $a_force_content,
1520 $a_lm_id,
1521 $a_lang
1522 );
1523 }
1524 }
1525
1532 public static function getShortTitles($a_lm_id, $a_lang = "-")
1533 {
1534 global $DIC;
1535
1536 $db = $DIC->database();
1537
1538 $title_data = array();
1539 if ($a_lang == "-") {
1540 $set = $db->query("SELECT t.child, d.obj_id, d.title, d.short_title FROM lm_data d LEFT JOIN lm_tree t ON (d.obj_id = t.child) WHERE d.lm_id = " .
1541 $db->quote($a_lm_id, "integer") . " ORDER BY t.lft, d.title");
1542 } else {
1543 $set = $db->query("SELECT t.child, d.obj_id, tr.title, tr.short_title, d.title default_title, d.short_title default_short_title FROM lm_data d " .
1544 " LEFT JOIN lm_tree t ON (d.obj_id = t.child) " .
1545 " LEFT JOIN lm_data_transl tr ON (tr.id = d.obj_id AND tr.lang=" . $db->quote($a_lang, "text") . ") WHERE d.lm_id = " .
1546 $db->quote($a_lm_id, "integer") . " ORDER BY t.lft, d.title");
1547 }
1548 while ($rec = $db->fetchAssoc($set)) {
1549 $title_data[] = $rec;
1550 }
1551 return $title_data;
1552 }
1553
1560 public static function writeShortTitle($a_id, $a_short_title, $a_lang = "-")
1561 {
1562 global $DIC;
1563
1564 $db = $DIC->database();
1565
1566 if ($a_lang != "-" && $a_lang != "") {
1567 $trans = new ilLMObjTranslation($a_id, $a_lang);
1568 $trans->setShortTitle($a_short_title);
1569 $trans->save();
1570 } else {
1571 $db->manipulate(
1572 "UPDATE lm_data SET " .
1573 " short_title = " . $db->quote($a_short_title, "text") .
1574 " WHERE obj_id = " . $db->quote($a_id, "integer")
1575 );
1576 }
1577 }
1578}
user()
Definition: user.php:4
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 removeProhibitedCharacters($a_text)
Remove prohibited characters see #19159.
static _createEntry( $a_obj_id, $a_action, $a_info_params="", $a_obj_type="", $a_user_comment="", $a_update_last=false)
Creates a new history entry for an object.
Translation information on lm object.
static getInstance(&$a_content_obj, $a_id=0, $a_halt=true)
Class ilLMObject.
static getExportId($a_lm_id, $a_lmobj_id, $a_type="pg")
Get export ID.
static getDuplicateExportIDs($a_lm_id, $a_type="pg")
Get duplicate export IDs (count export ID usages)
static _lookupType($a_obj_id, $a_lm_id=0)
Lookup type.
static getObjectList($lm_id, $type="")
static
static clipboardCopy($a_cont_obj_id, $a_ids)
Copy a set of chapters/pages into the clipboard.
static _getIdForImportId($a_import_id)
get current object id for import id (static)
setTitle($a_title)
set title of lm object
create($a_upload=false)
static _lookupShortTitle($a_obj_id)
Lookup short title.
static _lookup($a_obj_id, $a_field)
Lookup title.
static _lookupContObjID($a_id)
get learning module / digibook id for lm object
static clipboardCut($a_cont_obj_id, $a_ids)
Copy a set of chapters/pages into the clipboard.
existsExportID($a_lm_id, $a_exp_id, $a_type="pg")
Does export ID exist in lm?
setLMId($a_lm_id)
setContentObject(&$a_content_obj)
static saveTitles($a_lm, $a_titles, $a_lang="-")
Save titles for lm objects.
getLayout()
Get layout.
static _isPagePublic($a_node_id, $a_check_public_mode=false)
getExportIDInfo($a_lm_id, $a_exp_id, $a_type="pg")
Does export ID exist in lm?
static saveExportId($a_lm_id, $a_lmobj_id, $a_exp_id, $a_type="pg")
Save export id.
static getPagesOfChapter($a_lm_id, $a_chap_id)
Get pages of chapter.
static uniqueTypesCheck($a_items)
Check for unique types (all pages or all chapters)
static preloadDataByLM($a_lm_id)
Preload data records by lm.
static _getAllLMObjectsOfLM($a_lm_id, $a_type="")
Get all objects of learning module.
static updateInternalLinks($a_copied_nodes, $a_parent_type="lm")
Update internal links, after multiple pages have been copied.
static $data_records
deleteMetaData()
delete meta data entry
getTitle()
get title of lm object
setDataRecord($a_record)
this method should only be called by class ilLMObjectFactory
static _lookupTitle($a_obj_id)
Lookup title.
setType($a_type)
static _writePublicAccessStatus($a_pages, $a_cont_obj_id)
update public access flags in lm_data for all pages of a content object@access public
static lookupLayout($a_obj_id)
Lookup type.
static _getPresentationTitle( $a_node, $a_mode=self::PAGE_TITLE, $a_include_numbers=false, $a_time_scheduled_activation=false, $a_force_content=false, $a_lm_id=0, $a_lang="-")
Get affective title.
setDescription($a_description)
static putInTree($a_obj, $a_parent_id="", $a_target_node_id="")
put this object into content object tree
getShortTitle()
get short title of lm object
createMetaData()
create meta data entry
static _lookupNID($a_lm_id, $a_lm_obj_id, $a_type)
lookup named identifier (ILIAS_NID)
static _writeImportId($a_id, $a_import_id)
write import id to db (static)
static _deleteAllObjectData(&$a_cobj)
delete all objects of content object (digi book / learning module)
update()
update complete object
static _exists($a_id)
checks wether a lm content object with specified id exists or not
static _writeTitle($a_obj_id, $a_title)
static writeLayout($a_obj_id, $a_layout, $a_lm=null)
Write layout setting.
MDUpdateListener($a_element)
Meta data update listener.
static pasteTree( $a_target_lm, $a_item_id, $a_parent_id, $a_target, $a_insert_time, &$a_copied_nodes, $a_as_copy=false, $a_source_lm=null)
Paste item (tree) from clipboard to current lm.
static getShortTitles($a_lm_id, $a_lang="-")
Get short titles.
setShortTitle($a_title)
set short title of lm object
static getTree($a_cont_obj_id)
Get learningmodule tree.
static writeShortTitle($a_id, $a_short_title, $a_lang="-")
Write short title.
setLayout($a_val)
Set layout.
updateMetaData()
update meta data entry
static _getAllObjectsForImportId($a_import_id, $a_in_lm=0)
Get all items for an import ID.
__construct($a_content_obj, $a_id=0)
Class ilLMPageObject.
static _getPresentationTitle( $a_pg_id, $a_mode=self::CHAPTER_TITLE, $a_include_numbers=false, $a_time_scheduled_activation=false, $a_force_content=false, $a_lm_id=0, $a_lang="-", $a_include_short=false)
presentation title doesn't have to be page title, it may be chapter title + page title or chapter tit...
Extension of ilPageObject for learning modules.
static _refreshStatus($a_obj_id, $a_users=null)
Set dirty.
static _getEntriesForRbacObj($a_rbac_id, $a_obj_type="")
Get IDs for an rbac object.
static _getEntriesForObj($a_rbac_id, $a_obj_id, $a_obj_type)
Get IDs for an object.
static existsIdInRbacObject($a_rbac_id, $a_obj_type, $a_catalog, $a_entry)
Does id entry exist in rbac object?
static readIdData($a_rbac_id, $a_obj_type, $a_catalog, $a_entry)
Does id entry exist in rbac object?
static _getMobsForTarget($a_type, $a_target)
Get areas for a certain target.
static isHelpLM($a_lm_id)
Check if LM is a help LM.
static lookupUsages($a_id, $a_include_history=true)
Lookup usages of media object.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static getInstance($a_obj_id)
static _getAllReferences($a_id)
get all reference ids of object
static _hasUntrashedReference($a_obj_id)
checks wether an object has at least one reference that is not in trash
static _lookupType($a_id, $a_reference=false)
lookup object type
static getInstance($a_parent_type, $a_id=0, $a_old_nr=0, $a_lang="-")
Get page object instance.
static lookupTranslations($a_parent_type, $a_id)
Lookup translations.
Class ilStructreObject.
static _getPresentationTitle( $a_st_id, $a_mode=self::CHAPTER_TITLE, $a_include_numbers=false, $a_time_scheduled_activation=false, $a_force_content=false, $a_lm_id=0, $a_lang="-", $a_include_short=false)
get presentation title
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
static yn2tf($a_yn)
convert "y"/"n" to true/false
$c
Definition: cli.php:37
const IL_INST_ID
Definition: constants.php:38
global $DIC
Definition: goto.php:24
$mobs
Definition: imgupload.php:54
$ilUser
Definition: imgupload.php:18
$source
Definition: metadata.php:76
$query
$ilErr
Definition: raiseError.php:18
foreach($_POST as $key=> $value) $res
global $ilDB
$data
Definition: storeScorm.php:23
$message
Definition: xapiexit.php:14