ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilSCORM2004Node.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2011 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 
6 require_once("./Services/MetaData/classes/class.ilMDLanguageItem.php");
7 
19 {
20  var $slm_id;
21  var $type;
22  var $id;
24 
28  function ilSCORM2004Node($a_slm_object, $a_id = 0)
29  {
30  $this->id = $a_id;
31  $this->setSLMObject($a_slm_object);
32  $this->setSLMId($a_slm_object->getId());
33 
34  include_once("./Modules/Scorm2004/classes/class.ilSCORM2004Tree.php");
35  $this->tree = new ilSCORM2004Tree($a_slm_object->getId());
36  /*$this->tree = new ilTree($a_slm_object->getId());
37  $this->tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
38  $this->tree->setTreeTablePK("slm_id");*/
39 
40  if($a_id != 0)
41  {
42  $this->read();
43  }
44  }
45 
51  function setTitle($a_title)
52  {
53  $this->title = $a_title;
54  }
55 
61  function getTitle()
62  {
63  return $this->title;
64  }
65 
71  function setDescription($a_description)
72  {
73  $this->description = $a_description;
74  }
75 
81  function getDescription()
82  {
83  return $this->description;
84  }
85 
91  function setType($a_type)
92  {
93  $this->type = $a_type;
94  }
95 
101  function getType()
102  {
103  return $this->type;
104  }
105 
111  function setSLMId($a_slm_id)
112  {
113  $this->slm_id = $a_slm_id;
114 
115  }
116 
122  function getSLMId()
123  {
124  return $this->slm_id;
125  }
126 
132  function setSLMObject($a_slm_obj)
133  {
134  $this->slm_object = $a_slm_obj;
135  }
136 
142  function getSLMObject()
143  {
144  return $this->slm_object;
145  }
146 
152  function getContentObject()
153  {
154  return $this->slm_object;
155  }
156 
162  function setId($a_id)
163  {
164  $this->id = $a_id;
165  }
166 
172  function getId()
173  {
174  return $this->id;
175  }
176 
182  function getImportId()
183  {
184  return $this->import_id;
185  }
186 
192  function setImportId($a_id)
193  {
194  $this->import_id = $a_id;
195  }
196 
200  function read()
201  {
202  global $ilBench, $ilDB;
203 
204  if(!isset($this->data_record))
205  {
206  $query = "SELECT * FROM sahs_sc13_tree_node WHERE obj_id = ".
207  $ilDB->quote($this->id, "integer");
208  $obj_set = $ilDB->query($query);
209  $this->data_record = $ilDB->fetchAssoc($obj_set);
210  }
211 
212  $this->type = $this->data_record["type"];
213  $this->setImportId($this->data_record["import_id"]);
214  $this->setTitle($this->data_record["title"]);
215  }
216 
228  function MDUpdateListener($a_element)
229  {
230  include_once 'Services/MetaData/classes/class.ilMD.php';
231 
232  switch($a_element)
233  {
234  case 'General':
235 
236  // Update Title and description
237  $md = new ilMD($this->getSLMId(), $this->getId(), $this->getType());
238  $md_gen = $md->getGeneral();
239 
240  ilSCORM2004Node::_writeTitle($this->getId(), $md_gen->getTitle());
241 
242  foreach($md_gen->getDescriptionIds() as $id)
243  {
244  $md_des = $md_gen->getDescription($id);
245 // ilLMObject::_writeDescription($this->getId(),$md_des->getDescription());
246  break;
247  }
248 
249  break;
250 
251  default:
252  }
253  return true;
254  }
255 
256 
260  function createMetaData()
261  {
262  global $ilUser;
263 
264  include_once 'Services/MetaData/classes/class.ilMDCreator.php';
265  $md_creator = new ilMDCreator($this->getSLMId(), $this->getId(), $this->getType());
266  $md_creator->setTitle($this->getTitle());
267  $md_creator->setTitleLanguage($ilUser->getPref('language'));
268  $md_creator->setDescription($this->getDescription());
269  $md_creator->setDescriptionLanguage($ilUser->getPref('language'));
270  $md_creator->setKeywordLanguage($ilUser->getPref('language'));
271  $md_creator->setLanguage($ilUser->getPref('language'));
272  $md_creator->create();
273 
274  return true;
275  }
276 
280  function updateMetaData()
281  {
282  include_once("Services/MetaData/classes/class.ilMD.php");
283  include_once("Services/MetaData/classes/class.ilMDGeneral.php");
284  include_once("Services/MetaData/classes/class.ilMDDescription.php");
285 
286  $md = new ilMD($this->getSLMId(), $this->getId(), $this->getType());
287  $md_gen = $md->getGeneral();
288  $md_gen->setTitle($this->getTitle());
289 
290  // sets first description
291  $md_des_ids = $md_gen->getDescriptionIds();
292  if (count($md_des_ids) > 0)
293  {
294  $md_des =& $md_gen->getDescription($md_des_ids[0]);
295 // $md_des->setDescription($this->getDescription());
296  $md_des->update();
297  }
298  $md_gen->update();
299  }
300 
301 
305  function deleteMetaData()
306  {
307  // Delete meta data
308  include_once('Services/MetaData/classes/class.ilMD.php');
309  $md = new ilMD($this->getSLMId(), $this->getId(), $this->getType());
310  $md->deleteAll();
311  }
312 
316  function setDataRecord($a_record)
317  {
318  $this->data_record = $a_record;
319  }
320 
327  static function _lookupTitle($a_obj_id)
328  {
329  global $ilDB;
330 
331  $query = "SELECT * FROM sahs_sc13_tree_node WHERE obj_id = ".
332  $ilDB->quote($a_obj_id, "integer");
333  $obj_set = $ilDB->query($query);
334  $obj_rec = $ilDB->fetchAssoc($obj_set);
335 
336  return $obj_rec["title"];
337  }
338 
345  static function _lookupType($a_obj_id)
346  {
347  global $ilDB;
348 
349  $query = "SELECT * FROM sahs_sc13_tree_node WHERE obj_id = ".
350  $ilDB->quote($a_obj_id, "integer");
351  $obj_set = $ilDB->query($query);
352  $obj_rec = $ilDB->fetchAssoc($obj_set);
353 
354  return $obj_rec["type"];
355  }
356 
363  static function _writeTitle($a_obj_id, $a_title)
364  {
365  global $ilDB;
366 
367  $query = "UPDATE sahs_sc13_tree_node SET ".
368  " title = ".$ilDB->quote($a_title, "text").
369  " WHERE obj_id = ".$ilDB->quote($a_obj_id, "integer");
370  $ilDB->manipulate($query);
371  }
372 
379  static function _writeImportId($a_id, $a_import_id)
380  {
381  global $ilDB;
382 
383  $q = "UPDATE sahs_sc13_tree_node ".
384  "SET ".
385  "import_id = ".$ilDB->quote($a_import_id, "text").",".
386  "last_update = ".$ilDB->now().
387  "WHERE obj_id = ".$ilDB->quote($a_id, "integer");
388 
389  $ilDB->manipulate($q);
390  }
391 
397  function create($a_upload = false)
398  {
399  global $ilDB;
400 
401  // insert object data
402  $id = $ilDB->nextId("sahs_sc13_tree_node");
403  $query = "INSERT INTO sahs_sc13_tree_node (obj_id, title, type, slm_id, import_id, create_date) ".
404  "VALUES (".
405  $ilDB->quote($id, "integer").",".
406  $ilDB->quote($this->getTitle(), "text").",".
407  $ilDB->quote($this->getType(), "text").", ".
408  $ilDB->quote($this->getSLMId(), "integer").",".
409  $ilDB->quote($this->getImportId(), "text").
410  ", ".$ilDB->now().")";
411  $ilDB->manipulate($query);
412  $this->setId($id);
413 
414  if (!$a_upload)
415  {
416  $this->createMetaData();
417  }
418  }
419 
423  function update()
424  {
425  global $ilDB;
426 
427  $this->updateMetaData();
428 
429  $query = "UPDATE sahs_sc13_tree_node SET ".
430  " slm_id = ".$ilDB->quote($this->getSLMId(), "integer").
431  " ,title = ".$ilDB->quote($this->getTitle(), "text").
432  " WHERE obj_id = ".$ilDB->quote($this->getId(), "integer");
433 
434  $ilDB->manipulate($query);
435  }
436 
440  function delete()
441  {
442  global $ilDB;
443 
444  $query = "DELETE FROM sahs_sc13_tree_node WHERE obj_id= ".
445  $ilDB->quote($this->getId(), "integer");
446  $ilDB->manipulate($query);
447 
448  $this->deleteMetaData();
449  }
450 
462  function _getIdForImportId($a_import_id)
463  {
464  global $ilDB;
465 
466  $ilDB->setLimit(1);
467  $q = "SELECT * FROM sahs_sc13_tree_node WHERE import_id = ".
468  $ilDB->quote($a_import_id, "text")." ".
469  " ORDER BY create_date DESC";
470  $obj_set = $ilDB->query($q);
471  while ($obj_rec = $ilDB->fetchAssoc($obj_set))
472  {
473  $slm_id = ilSCORM2004Node::_lookupSLMID($obj_rec["obj_id"]);
474 
475  // link only in learning module, that is not trashed
477  {
478  return $obj_rec["obj_id"];
479  }
480  }
481 
482  return 0;
483  }
484 
492  function _exists($a_id)
493  {
494  global $ilDB;
495 
496  include_once("./Services/COPage/classes/class.ilInternalLink.php");
497  if (is_int(strpos($a_id, "_")))
498  {
500  }
501 
502  $q = "SELECT * FROM sahs_sc13_tree_node WHERE obj_id = ".
503  $ilDB->quote($a_id, "integer");
504  $obj_set = $ilDB->query($q);
505  if ($obj_rec = $ilDB->fetchAssoc($obj_set))
506  {
507  return true;
508  }
509  else
510  {
511  return false;
512  }
513 
514  }
515 
516 
522  function _deleteAllSLMNodes($a_slm_object)
523  {
524  global $ilDB;
525 
526  $query = "SELECT * FROM sahs_sc13_tree_node ".
527  "WHERE slm_id = ".$ilDB->quote($a_slm_object->getId(), "integer")." ";
528  $obj_set = $ilDB->query($query);
529 
530  require_once("./Modules/Scorm2004/classes/class.ilSCORM2004NodeFactory.php");
531  while($obj_rec = $ilDB->fetchAssoc($obj_set))
532  {
533  $node_obj = ilSCORM2004NodeFactory::getInstance($a_slm_object, $obj_rec["obj_id"],false);
534 
535  if (is_object($node_obj))
536  {
537  $node_obj->delete();
538  }
539  }
540 
541  return true;
542  }
543 
547  function _lookupSLMID($a_id)
548  {
549  global $ilDB;
550 
551  $query = "SELECT * FROM sahs_sc13_tree_node WHERE obj_id = ".
552  $ilDB->quote($a_id, "integer")."";
553  $obj_set = $ilDB->query($query);
554  $obj_rec = $ilDB->fetchAssoc($obj_set);
555 
556  return $obj_rec["slm_id"];
557  }
558 
562  static function putInTree($a_obj, $a_parent_id = "", $a_target_node_id = "")
563  {
564  $tree =& new ilTree($a_obj->getSLMId());
565  $tree->setTreeTablePK("slm_id");
566  $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
567 
568  // determine parent
569  $parent_id = ($a_parent_id != "")
570  ? $a_parent_id
571  : $tree->getRootId();
572 
573  // determine target
574  if ($a_target_node_id != "")
575  {
576  $target = $a_target_node_id;
577  }
578  else
579  {
580  // determine last child that serves as predecessor
581  $childs =& $tree->getChilds($parent_id);
582 
583  if (count($childs) == 0)
584  {
585  $target = IL_FIRST_NODE;
586  }
587  else
588  {
589  $target = $childs[count($childs) - 1]["obj_id"];
590  }
591  }
592 
593  if ($tree->isInTree($parent_id) && !$tree->isInTree($a_obj->getId()))
594  {
595  $tree->insertNode($a_obj->getId(), $parent_id, $target);
596  }
597  }
598 
606  static function getTree($a_slm_obj_id)
607  {
608  $tree = new ilTree($a_slm_obj_id);
609  $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
610  $tree->setTreeTablePK("slm_id");
611  $tree->readRootId();
612 
613  return $tree;
614  }
615 
619  static function clipboardCopy($a_slm_obj_id, $a_ids)
620  {
621  global $ilUser;
622 
623  $tree = ilSCORM2004Node::getTree($a_slm_obj_id);
624 
625  $ilUser->clipboardDeleteObjectsOfType("page");
626  $ilUser->clipboardDeleteObjectsOfType("chap");
627  $ilUser->clipboardDeleteObjectsOfType("sco");
628  $ilUser->clipboardDeleteObjectsOfType("ass");
629 
630  // put them into the clipboard
631  $time = date("Y-m-d H:i:s", time());
632  foreach ($a_ids as $id)
633  {
634  $curnode = "";
635  if ($tree->isInTree($id))
636  {
637  $curnode = $tree->getNodeData($id);
638  $subnodes = $tree->getSubTree($curnode);
639  foreach($subnodes as $subnode)
640  {
641  if ($subnode["child"] != $id)
642  {
643  $ilUser->addObjectToClipboard($subnode["child"],
644  $subnode["type"], $subnode["title"],
645  $subnode["parent"], $time, $subnode["lft"]);
646  }
647  }
648  }
649  $order = ($curnode["lft"] > 0)
650  ? $curnode["lft"]
651  : (int) ($order + 1);
652  $ilUser->addObjectToClipboard($id,
654  $order);
655  }
656  }
657 
661  function clipboardCut($a_slm_obj_id, $a_ids)
662  {
663  $tree = ilSCORM2004Node::getTree($a_slm_obj_id);
664 
665  if (!is_array($a_ids))
666  {
667  return false;
668  }
669  else
670  {
671  // get all "top" ids, i.e. remove ids, that have a selected parent
672  foreach($a_ids as $id)
673  {
674  $path = $tree->getPathId($id);
675  $take = true;
676  foreach($path as $path_id)
677  {
678  if ($path_id != $id && in_array($path_id, $a_ids))
679  {
680  $take = false;
681  }
682  }
683  if ($take)
684  {
685  $cut_ids[] = $id;
686  }
687  }
688  }
689 
690  ilSCORM2004Node::clipboardCopy($a_slm_obj_id, $cut_ids);
691 
692  // remove the objects from the tree
693  // note: we are getting chapters, scos and pages which are *not* in the tree
694  // we do not delete any pages/chapters here
695  foreach ($cut_ids as $id)
696  {
697  $curnode = $tree->getNodeData($id);
698  if ($tree->isInTree($id))
699  {
700  $tree->deleteTree($curnode);
701  }
702  }
703 
704  }
705 
709  static function uniqueTypesCheck($a_items)
710  {
711  $types = array();
712  if (is_array($a_items))
713  {
714  foreach($a_items as $item)
715  {
717  $types[$type] = $type;
718  }
719  }
720 
721  if (count($types) > 1)
722  {
723  return false;
724  }
725  return true;
726  }
727 
731  static function insertPageClip($a_slm_obj)
732  {
733  global $ilCtrl, $ilUser;
734 
735  // @todo: move this to a service since it can be used here, too
736  include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
737 
738  include_once("./Modules/Scorm2004/classes/class.ilSCORM2004OrganizationHFormGUI.php");
741 
742  $tree = ilSCORM2004Node::getTree($a_slm_obj->getId());
743 
744  if (!$first_child) // insert after node id
745  {
746  $parent_id = $tree->getParentId($node_id);
747  $target = $node_id;
748  }
749  else // insert as first child
750  {
751  $parent_id = $node_id;
752  $target = IL_FIRST_NODE;
753  }
754 
755  // cut and paste
756  $pages = $ilUser->getClipboardObjects("page");
757  $copied_nodes = array();
758  foreach ($pages as $pg)
759  {
760  $cid = ilSCORM2004Node::pasteTree($a_slm_obj, $pg["id"], $parent_id, $target,
761  $pg["insert_time"], $copied_nodes,
762  (ilEditClipboard::getAction() == "copy"));
763  $target = $cid;
764  }
765  //ilLMObject::updateInternalLinks($copied_nodes);
766 
767  if (ilEditClipboard::getAction() == "cut")
768  {
769  $ilUser->clipboardDeleteObjectsOfType("page");
770  $ilUser->clipboardDeleteObjectsOfType("chap");
771  $ilUser->clipboardDeleteObjectsOfType("sco");
772  $ilUser->clipboardDeleteObjectsOfType("ass");
774  }
775  }
776 
780  static function insertAssetClip($a_slm_obj, $a_type = "ass")
781  {
782  global $ilCtrl, $ilUser;
783 
784  // @todo: move this to a service since it can be used here, too
785  include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
786 
787  include_once("./Modules/Scorm2004/classes/class.ilSCORM2004OrganizationHFormGUI.php");
790 
791  $tree = ilSCORM2004Node::getTree($a_slm_obj->getId());
792 
793  if (!$first_child) // insert after node id
794  {
795  $parent_id = $tree->getParentId($node_id);
796  $target = $node_id;
797  }
798  else // insert as first child
799  {
800  $parent_id = $node_id;
801  $target = IL_FIRST_NODE;
802  }
803 
804  // cut and paste
805  $scos = $ilUser->getClipboardObjects($a_type);
806  $copied_nodes = array();
807  foreach ($scos as $sco)
808  {
809  $cid = ilSCORM2004Node::pasteTree($a_slm_obj, $sco["id"], $parent_id, $target,
810  $sco["insert_time"], $copied_nodes,
811  (ilEditClipboard::getAction() == "copy"));
812  $target = $cid;
813  }
814  //ilLMObject::updateInternalLinks($copied_nodes);
815 
816  if (ilEditClipboard::getAction() == "cut")
817  {
818  $ilUser->clipboardDeleteObjectsOfType("page");
819  $ilUser->clipboardDeleteObjectsOfType("chap");
820  $ilUser->clipboardDeleteObjectsOfType("sco");
821  $ilUser->clipboardDeleteObjectsOfType("ass");
823  }
824  }
825 
829  static function insertScoClip($a_slm_obj)
830  {
831  self::insertAssetClip($a_slm_obj, "sco");
832  }
833 
834 
838  function insertChapterClip($a_slm_obj, $a_as_sub = false)
839  {
840  global $ilUser, $ilCtrl, $ilLog;
841 
842  // @todo: move this to a service since it can be used here, too
843  include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
844 
845  include_once("./Modules/Scorm2004/classes/class.ilSCORM2004OrganizationHFormGUI.php");
848 
849  $tree = ilSCORM2004Node::getTree($a_slm_obj->getId());
850 
851  if ($a_as_sub) // as subchapter
852  {
853  if (!$first_child) // insert under parent
854  {
855  $parent_id = $node_id;
856  $target = "";
857  }
858  else // we shouldnt end up here
859  {
860  return;
861  }
862  }
863  else // as chapter
864  {
865  if (!$first_child) // insert after node id
866  {
867  $parent_id = $tree->getParentId($node_id);
868  $target = $node_id;
869  }
870  else // insert as first child
871  {
872  $parent_id = $node_id;
873  $target = IL_FIRST_NODE;
874 
875  // do not move a chapter in front of a sco (maybe never needed)
876  $childs = $tree->getChildsByType($parent_id, "sco");
877  if (count($childs) != 0)
878  {
879  $target = $childs[count($childs) - 1]["obj_id"];
880  }
881  }
882  }
883 
884  // copy and paste
885  $chapters = $ilUser->getClipboardObjects("chap", true);
886  $copied_nodes = array();
887  foreach ($chapters as $chap)
888  {
889  $cid = ilSCORM2004Node::pasteTree($a_slm_obj, $chap["id"], $parent_id,
890  $target, $chap["insert_time"], $copied_nodes,
891  (ilEditClipboard::getAction() == "copy"));
892  $target = $cid;
893  }
894  //ilLMObject::updateInternalLinks($copied_nodes);
895 
896  if (ilEditClipboard::getAction() == "cut")
897  {
898  $ilUser->clipboardDeleteObjectsOfType("page");
899  $ilUser->clipboardDeleteObjectsOfType("chap");
900  $ilUser->clipboardDeleteObjectsOfType("sco");
901  $ilUser->clipboardDeleteObjectsOfType("ass");
903  }
904  }
905 
918  static function pasteTree($a_target_slm, $a_item_id, $a_parent_id, $a_target, $a_insert_time,
919  &$a_copied_nodes, $a_as_copy = false, $a_from_clipboard = true)
920  {
921  global $ilUser, $ilias, $ilLog;
922 
923  // source lm id, item type and lm object
924  $item_slm_id = ilSCORM2004Node::_lookupSLMID($a_item_id);
925  $item_type = ilSCORM2004Node::_lookupType($a_item_id);
926  //$slm_obj = $ilias->obj_factory->getInstanceByObjId($item_slm_id);
927  include_once("./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
928  $slm_obj = new ilObjSCORM2004LearningModule($item_slm_id, false);
929 
930  if ($item_type == "chap")
931  {
932  include_once("./Modules/Scorm2004/classes/class.ilSCORM2004Chapter.php");
933  $item = new ilSCORM2004Chapter($slm_obj, $a_item_id);
934  }
935  else if ($item_type == "page")
936  {
937  include_once("./Modules/Scorm2004/classes/class.ilSCORM2004PageNode.php");
938  $item = new ilSCORM2004PageNode($slm_obj, $a_item_id);
939  }
940  else if ($item_type == "sco")
941  {
942  include_once("./Modules/Scorm2004/classes/class.ilSCORM2004Sco.php");
943  $item = new ilSCORM2004Sco($slm_obj, $a_item_id);
944  }
945  else if ($item_type == "ass")
946  {
947  include_once("./Modules/Scorm2004/classes/class.ilSCORM2004Asset.php");
948  $item = new ilSCORM2004Asset($slm_obj, $a_item_id);
949  }
950 
951  $ilLog->write("Getting from clipboard type ".$item_type.", ".
952  "Item ID: ".$a_item_id.", of original SLM: ".$item_slm_id);
953 
954  if ($item_slm_id != $a_target_slm->getId() && !$a_as_copy)
955  {
956  // @todo: check whether st is NOT in tree
957 
958  // "move" metadata to new lm
959  include_once("Services/MetaData/classes/class.ilMD.php");
960  $md = new ilMD($item_slm_id, $item->getId(), $item->getType());
961  $new_md = $md->cloneMD($a_target_slm->getId(), $item->getId(), $item->getType());
962 
963  // update lm object
964  $item->setSLMId($a_target_slm->getId());
965  $item->setSLMObject($a_target_slm);
966  $item->update();
967 
968  // delete old meta data set
969  $md->deleteAll();
970 
971  if ($item_type == "page")
972  {
973  $page = $item->getPageObject();
974  $page->buildDom($a_from_clipboard);
975  $page->setParentId($a_target_slm->getId());
976  $page->update();
977  }
978  }
979 
980  if ($a_as_copy)
981  {
982  $target_item = $item->copy($a_target_slm);
983  $a_copied_nodes[$item->getId()] = $target_item->getId();
984  }
985  else
986  {
987  $target_item = $item;
988  }
989 
990  $ilLog->write("Putting into tree type ".$target_item->getType().
991  "Item ID: ".$target_item->getId().", Parent: ".$a_parent_id.", ".
992  "Target: ".$a_target.", Item LM:".$target_item->getContentObject()->getId());
993 
994  ilSCORM2004Node::putInTree($target_item, $a_parent_id, $a_target);
995 
996  if ($a_from_clipboard)
997  {
998  $childs = $ilUser->getClipboardChilds($item->getId(), $a_insert_time);
999  }
1000  else
1001  {
1002  // get childs of source tree
1003  $source_tree = $slm_obj->getTree();
1004  $childs = $source_tree->getChilds($a_item_id);
1005  }
1006 
1007  foreach($childs as $child)
1008  {
1009  $child_id = ($a_from_clipboard)
1010  ? $child["id"]
1011  : $child["child"];
1012  ilSCORM2004Node::pasteTree($a_target_slm, $child_id, $target_item->getId(),
1013  IL_LAST_NODE, $a_insert_time, $a_copied_nodes, $a_as_copy, $a_from_clipboard);
1014  }
1015 
1016  return $target_item->getId();
1017  }
1018 
1019  //Methods for Sequencing
1020 
1021  //objectives per node
1022  public function getObjectives()
1023  {
1024  include_once("./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Objective.php");
1025  return ilSCORM2004Objective::fetchAllObjectives($this->slm_object,$this->getId());
1026  }
1027 
1028  public function deleteSeqInfo()
1029  {
1030  include_once("./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Item.php");
1031  $seq_item = new ilSCORM2004Item($this->getId());
1032  $seq_item -> delete();
1033  }
1034 
1035  //function currently unused - shouldn't be removed if subchapter support may be added in the future
1036  public function parentHasSeqTemplate(){
1037  include_once("./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Utilities.php");
1038  $seq_util = new ilSCORM2004Utilities($this->getId());
1039  return $seq_util -> parentHasSeqTemplate($this->slm_object);
1040  }
1041 
1042 
1043  public function exportAsScorm12() {
1044  //to implement
1045  return;
1046  }
1047 
1048  public function exportAsScorm13() {
1049  //to implement
1050  return;
1051  }
1052 
1053 
1054 
1055 }
1056 ?>