4 require_once
"classes/class.ilObject.php";
5 require_once
"Services/MetaData/classes/class.ilMDLanguageItem.php";
6 require_once(
"classes/class.ilNestedSetXML.php");
41 $this->
ilObject($a_id,$a_call_by_reference);
43 $this->mob_ids = array();
44 $this->file_ids = array();
45 $this->q_ids = array();
51 function create($a_no_meta_data =
false)
77 global $rbacadmin, $rbacreview;
100 return $roles ? $roles : array();
110 # echo "Content<br>\n";
113 $this->lm_tree->setTableNames(
'lm_tree',
'lm_data');
114 $this->lm_tree->setTreeTablePK(
"lm_id");
166 $this->import_id = $a_id;
176 $this->layout_per_page = $a_val;
186 return $this->layout_per_page;
239 $this->lm_tree->setTreeTablePK(
"lm_id");
240 $this->lm_tree->setTableNames(
'lm_tree',
'lm_data');
241 $this->lm_tree->addTree($this->
getId(), 1);
251 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
252 include_once(
"./Modules/LearningModule/classes/class.ilStructureObject.php");
253 include_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
255 $root_id = $this->lm_tree->getRootId();
259 $chap->setType(
"st");
260 $chap->setTitle($lng->txt(
"cont_new_chap"));
261 $chap->setLMId($this->
getId());
267 $page->setType(
"pg");
268 $page->setTitle($lng->txt(
"cont_new_page"));
269 $page->setLMId($this->
getId());
292 if(!is_writable($lm_data_dir))
294 $this->ilias->raiseError(
"Content object Data Directory (".$lm_data_dir
295 .
") not writeable.",$this->ilias->error_obj->FATAL);
299 $lm_dir = $lm_data_dir.
"/lm_".$this->
getId();
301 if(!@is_dir($lm_dir))
303 $this->ilias->raiseError(
"Creation of Learning Module Directory failed.",$this->ilias->error_obj->FATAL);
311 $this->ilias->raiseError(
"Creation of Import Directory failed.",$this->ilias->error_obj->FATAL);
321 "/lm_".$this->getId();
329 if(strlen($this->import_dir))
335 "/lm_".$this->getId().
"/import";
354 $this->import_dir = $a_import_dir;
366 if(!is_writable($lm_data_dir))
368 $this->ilias->raiseError(
"Content object Data Directory (".$lm_data_dir
369 .
") not writeable.",$this->ilias->error_obj->FATAL);
372 $lm_dir = $lm_data_dir.
"/lm_".$this->
getId();
374 if(!@is_dir($lm_dir))
376 $this->ilias->raiseError(
"Creation of Learning Module Directory failed.",$this->ilias->error_obj->FATAL);
383 $export_dir = $lm_dir.
"/export_html";
388 $export_dir = $lm_dir.
"/export_scorm";
392 $export_dir = $lm_dir.
"/export";
397 if(!@is_dir($export_dir))
399 $this->ilias->raiseError(
"Creation of Export Directory failed.",$this->ilias->error_obj->FATAL);
443 if (!parent::delete())
449 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
457 $nested->init($this->
getId(),
"bib");
458 $nested->deleteAllDBData();
462 $this->lm_tree->removeTree($this->lm_tree->getTreeId());
468 $q =
"DELETE FROM content_object WHERE id = ".
469 $ilDB->quote($this->
getId(),
"integer");
470 $ilDB->manipulate($q);
473 $q =
"DELETE FROM lm_menu WHERE lm_id = ".
474 $ilDB->quote($this->
getId(),
"integer");
475 $ilDB->manipulate($q);
498 $this->layout = $a_layout;
514 $this->style_id = $a_style_id;
524 $q =
"UPDATE content_object SET ".
525 " stylesheet = ".$ilDB->quote((
int) $a_style_id,
"integer").
526 " WHERE id = ".$ilDB->quote($this->
getId(),
"integer");
527 $ilDB->manipulate($q);
529 $this->style_id = $a_style_id;
539 if ($a_from_style < 0)
541 $q =
"SELECT stylesheet FROM content_object, style_data ".
542 " WHERE content_object.stylesheet = style_data.id ".
543 " AND style_data.standard = ".$ilDB->quote(0,
"integer").
544 " AND content_object.stylesheet > ".$ilDB->quote(0,
"integer");
545 $style_set = $ilDB->query($q);
546 while($style_rec = $ilDB->fetchAssoc($style_set))
549 $q =
"UPDATE content_object SET ".
550 " stylesheet = ".$ilDB->quote((
int) $a_to_style,
"integer").
551 " WHERE stylesheet = ".$ilDB->quote($style_rec[
"stylesheet"],
"integer");
552 $ilDB->manipulate($q);
555 $style_obj =& $ilias->obj_factory->getInstanceByObjId($style_rec[
"stylesheet"]);
556 $style_obj->delete();
561 $q =
"UPDATE content_object SET ".
562 " stylesheet = ".$ilDB->quote((
int) $a_to_style,
"integer").
563 " WHERE stylesheet = ".$ilDB->quote($a_from_style,
"integer");
564 $ilDB->manipulate($q);
575 $q =
"SELECT stylesheet FROM content_object ".
576 " WHERE id = ".$ilDB->quote($a_cont_obj_id,
"integer");
577 $res = $ilDB->query($q);
578 $sheet = $ilDB->fetchAssoc(
$res);
580 return $sheet[
"stylesheet"];
590 $q =
"SELECT id FROM content_object ".
591 " WHERE stylesheet = ".$ilDB->quote($a_style_id,
"integer");
592 $res = $ilDB->query($q);
594 while($cont = $ilDB->fetchAssoc(
$res))
596 $obj_ids[] = $cont[
"id"];
610 $q =
"SELECT count(*) as cnt FROM content_object ".
611 " WHERE stylesheet = ".$ilDB->quote($a_style_id,
"integer");
612 $cset = $ilDB->query($q);
613 $crow = $ilDB->fetchAssoc($cset);
615 return (
int) $crow[
"cnt"];
627 $q =
"SELECT count(*) as cnt FROM content_object, style_data ".
628 " WHERE stylesheet = style_data.id ".
629 " AND standard = ".$ilDB->quote(0,
"integer");
630 $cset = $ilDB->query($q);
631 $crow = $ilDB->fetchAssoc($cset);
633 return (
int) $crow[
"cnt"];
643 $q =
"SELECT count(*) as cnt FROM content_object ".
644 " WHERE stylesheet = ".$ilDB->quote(0,
"integer");
645 $cset = $ilDB->query($q);
646 $crow = $ilDB->fetchAssoc($cset);
648 return (
int) $crow[
"cnt"];
660 $q =
"UPDATE content_object SET ".
661 " stylesheet = ".$ilDB->quote(0,
"integer").
662 " WHERE stylesheet = ".$ilDB->quote((
int) $this->
getId($a_style_id),
"integer");
664 $ilDB->manipulate($q);
682 $this->pg_header = $a_pg_header;
690 return $this->toc_mode;
698 return $this->public_access_mode;
708 $this->toc_mode = $a_toc_mode;
713 $this->online = $a_online;
723 $this->lm_menu_active = $a_act_lm_menu;
728 return $this->lm_menu_active;
733 $this->toc_active = $a_toc;
738 return $this->toc_active;
743 $this->numbering = $a_num;
748 return $this->numbering;
753 $this->print_view_active = $a_print;
758 return $this->print_view_active;
763 $this->prevent_glossary_appendix_active = $a_print;
768 return $this->prevent_glossary_appendix_active;
773 $this->downloads_active = $a_down;
778 return $this->downloads_active;
783 $this->downloads_public_active = $a_down;
788 return $this->downloads_public_active;
793 $this->pub_notes = $a_pub_notes;
798 return $this->pub_notes;
803 $this->clean_frames = $a_clean;
808 return $this->clean_frames;
813 $this->user_comments = $a_comm;
818 $this->public_access_mode = $a_mode;
823 return $this->user_comments;
828 $this->header_page = $a_pg;
833 return $this->header_page;
838 $this->footer_page = $a_pg;
843 return $this->footer_page;
853 $q =
"SELECT * FROM content_object WHERE id = ".
854 $ilDB->quote($this->
getId(),
"integer");
855 $lm_set = $ilDB->query($q);
856 $lm_rec = $ilDB->fetchAssoc($lm_set);
857 $this->
setLayout($lm_rec[
"default_layout"]);
894 $q =
"UPDATE content_object SET ".
895 " default_layout = ".$ilDB->quote($this->
getLayout(),
"text").
", ".
896 " stylesheet = ".$ilDB->quote($this->
getStyleSheetId(),
"integer").
",".
897 " page_header = ".$ilDB->quote($this->
getPageHeader(),
"text").
",".
898 " toc_mode = ".$ilDB->quote($this->
getTOCMode(),
"text").
",".
913 " header_page = ".$ilDB->quote($this->
getHeaderPage(),
"integer").
",".
914 " footer_page = ".$ilDB->quote($this->
getFooterPage(),
"integer").
",".
916 " layout_per_page = ".$ilDB->quote($this->
getLayoutPerPage(),
"integer").
" ".
917 " WHERE id = ".$ilDB->quote($this->
getId(),
"integer");
918 $ilDB->manipulate($q);
928 $q =
"INSERT INTO content_object (id) VALUES (".$ilDB->quote($this->
getId(),
"integer").
")";
929 $ilDB->manipulate($q);
942 $q =
"SELECT is_online FROM content_object WHERE id = ".$ilDB->quote($a_id,
"integer");
943 $lm_set = $ilDB->query($q);
944 $lm_rec = $ilDB->fetchAssoc($lm_set);
956 $dir = opendir(
"./Modules/LearningModule/layouts/lm");
965 if (@is_dir(
"./Modules/LearningModule/layouts/lm/".
$file))
975 'toc2win' =>
'toc2win',
976 'toc2windyn' =>
'toc2windyn',
977 '1window' =>
'1window',
978 '2window' =>
'2window',
979 '3window' =>
'3window',
980 'presentation' =>
'presentation',
981 'fullscreen' =>
'fullscreen'
995 $lm_tree->setTableNames(
'lm_tree',
'lm_data');
1001 foreach (
$path as $node)
1003 if ($node[
"type"] ==
"st")
1022 $lm_tree->setTableNames(
'lm_tree',
'lm_data');
1030 foreach (
$path as $node)
1032 if ($node[
"type"] ==
"st")
1036 foreach ($tconds as $tcond)
1057 $lm_tree->setTableNames(
'lm_tree',
'lm_data');
1065 foreach (
$path as $node)
1067 if ($node[
"type"] ==
"st")
1071 foreach ($tconds as $tcond)
1076 return $node[
"child"];
1096 function notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params = 0)
1136 if ($a_node_id==
$_GET[
"ref_id"])
1138 $parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
1139 $parent_type = $parent_obj->getType();
1140 if($parent_type == $this->
getType())
1142 $a_node_id = (int) $tree->getParentId($a_node_id);
1146 parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
1155 $tree =
new ilTree($a_cont_obj_id);
1156 $tree->setTableNames(
'lm_tree',
'lm_data');
1157 $tree->setTreeTablePK(
"lm_id");
1158 if ($tree->isInTree($a_page_id))
1160 $succ = $tree->fetchSuccessorNode($a_page_id,
"pg");
1173 $tree->setTableNames(
'lm_tree',
'lm_data');
1174 $tree->setTreeTablePK(
"lm_id");
1176 $tree->checkTreeChilds();
1192 $set = $ilDB->query(
"SELECT DISTINCT l1.lm_id".
1194 " JOIN lm_tree l2 ON ( l1.child = l2.parent".
1195 " AND l1.lm_id = l2.lm_id )".
1196 " JOIN lm_data ON ( l1.child = lm_data.obj_id )".
1197 " WHERE (l2.lft < l1.lft".
1198 " OR l2.rgt > l1.rgt OR l2.lft > l1.rgt OR l2.rgt < l1.lft)".
1199 " AND l1.lm_id = ".$ilDB->quote($this->getId(),
"integer").
1200 " ORDER BY lm_data.create_date DESC"
1202 if ($rec = $ilDB->fetchAssoc($set))
1208 $nodes = $tree->getSubtree($tree->getNodeData($tree->getRootId()));
1209 foreach ($nodes as $node)
1211 $q =
"SELECT * FROM lm_data WHERE obj_id = ".
1212 $ilDB->quote($node[
"child"],
"integer");
1213 $obj_set = $ilDB->query($q);
1214 $obj_rec = $ilDB->fetchAssoc($obj_set);
1217 $node_data = $tree->getNodeData($node[
"child"]);
1218 $tree->deleteTree($node_data);
1223 $nodes = $tree->getSubtree($tree->getNodeData($tree->getRootId()));
1224 foreach ($nodes as $node)
1226 $q =
"SELECT * FROM lm_data WHERE obj_id = ".
1227 $ilDB->quote($node[
"parent"],
"integer");
1228 $obj_set = $ilDB->query($q);
1229 $obj_rec = $ilDB->fetchAssoc($obj_set);
1230 if ($obj_rec[
"type"] ==
"pg")
1232 $node_data = $tree->getNodeData($node[
"child"]);
1233 if ($tree->isInTree($node[
"child"]))
1235 $tree->deleteTree($node_data);
1242 $set = $ilDB->query(
"SELECT DISTINCT l1.lm_id".
1244 " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )".
1245 " JOIN lm_data ON (l1.child = lm_data.obj_id)".
1246 " WHERE l1.child <> 1".
1247 " AND l1.lm_id <> lm_data.lm_id".
1248 " AND l1.lm_id = ".$ilDB->quote($this->getId(),
"integer"));
1249 if ($rec = $ilDB->fetchAssoc($set))
1251 $set = $ilDB->query(
"SELECT DISTINCT l1.child ".
1253 " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )".
1254 " JOIN lm_data ON (l1.child = lm_data.obj_id)".
1255 " WHERE l1.child <> 1".
1256 " AND l1.lm_id <> lm_data.lm_id".
1257 " AND l1.lm_id = ".$ilDB->quote($this->getId(),
"integer"));
1258 include_once(
"./Modules/LearningModule/classes/class.ilLMObjectFactory.php");
1259 while ($rec = $ilDB->fetchAssoc($set))
1263 if (is_object($cobj))
1265 if ($cobj->getType() ==
"pg")
1268 $pg_copy = $cobj->copy($this);
1271 $ilDB->manipulate(
"UPDATE lm_tree SET ".
1272 " child = ".$ilDB->quote($pg_copy->getId(),
"integer").
1273 " WHERE child = ".$ilDB->quote($cobj->getId(),
"integer").
1274 " AND lm_id = ".$ilDB->quote($this->getId(),
"integer")
1277 else if ($cobj->getType() ==
"st")
1280 $st_copy = $cobj->copy($this);
1283 $ilDB->manipulate(
"UPDATE lm_tree SET ".
1284 " child = ".$ilDB->quote($st_copy->getId(),
"integer").
1285 " WHERE child = ".$ilDB->quote($cobj->getId(),
"integer").
1286 " AND lm_id = ".$ilDB->quote($this->getId(),
"integer")
1290 $ilDB->manipulate(
"UPDATE lm_tree SET ".
1291 " parent = ".$ilDB->quote($st_copy->getId(),
"integer").
1292 " WHERE parent = ".$ilDB->quote($cobj->getId(),
"integer").
1293 " AND lm_id = ".$ilDB->quote($this->getId(),
"integer")
1308 function exportXML(&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
1316 $attrs[
"Type"] =
"LearningModule";
1320 $attrs[
"Type"] =
"LibObject";
1323 $a_xml_writer->xmlStartTag(
"ContentObject", $attrs);
1330 $expLog->write(date(
"[y-m-d H:i:s] ").
"Start Export Structure Objects");
1331 $ilBench->start(
"ContentObjectExport",
"exportStructureObjects");
1333 $ilBench->stop(
"ContentObjectExport",
"exportStructureObjects");
1334 $expLog->write(date(
"[y-m-d H:i:s] ").
"Finished Export Structure Objects");
1337 $expLog->write(date(
"[y-m-d H:i:s] ").
"Start Export Page Objects");
1338 $ilBench->start(
"ContentObjectExport",
"exportPageObjects");
1340 $ilBench->stop(
"ContentObjectExport",
"exportPageObjects");
1341 $expLog->write(date(
"[y-m-d H:i:s] ").
"Finished Export Page Objects");
1344 $expLog->write(date(
"[y-m-d H:i:s] ").
"Start Export Media Objects");
1345 $ilBench->start(
"ContentObjectExport",
"exportMediaObjects");
1347 $ilBench->stop(
"ContentObjectExport",
"exportMediaObjects");
1348 $expLog->write(date(
"[y-m-d H:i:s] ").
"Finished Export Media Objects");
1351 $expLog->write(date(
"[y-m-d H:i:s] ").
"Start Export File Items");
1352 $ilBench->start(
"ContentObjectExport",
"exportFileItems");
1354 $ilBench->stop(
"ContentObjectExport",
"exportFileItems");
1355 $expLog->write(date(
"[y-m-d H:i:s] ").
"Finished Export File Items");
1358 if (count($this->q_ids) > 0)
1360 $qti_file = fopen($a_target_dir.
"/qti.xml",
"w");
1361 include_once(
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
1363 fwrite($qti_file, $pool->toXML($this->q_ids));
1369 $expLog->write(date(
"[y-m-d H:i:s] ").
"Start Export Properties");
1371 $expLog->write(date(
"[y-m-d H:i:s] ").
"Finished Export Properties");
1373 $a_xml_writer->xmlEndTag(
"ContentObject");
1384 include_once(
"Services/MetaData/classes/class.ilMD2XML.php");
1386 $md2xml->setExportMode(
true);
1387 $md2xml->startExport();
1388 $a_xml_writer->appendXML($md2xml->getXML());
1399 include_once
'./Modules/LearningModule/classes/class.ilStructureObject.php';
1401 $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
1402 foreach ($childs as $child)
1404 if($child[
"type"] !=
"st")
1410 $structure_obj->exportXML($a_xml_writer, $a_inst, $expLog);
1411 unset($structure_obj);
1426 include_once
"./Modules/LearningModule/classes/class.ilLMPageObject.php";
1429 foreach ($pages as $page)
1433 $expLog->write(date(
"[y-m-d H:i:s] ").
"Page Object ".$page[
"obj_id"]);
1437 $page_obj->exportXML($a_xml_writer,
"normal", $a_inst);
1440 $mob_ids = $page_obj->getMediaObjectIDs();
1441 foreach($mob_ids as $mob_id)
1443 $this->mob_ids[$mob_id] = $mob_id;
1447 $file_ids = $page_obj->getFileItemIds();
1448 foreach($file_ids as $file_id)
1450 $this->file_ids[$file_id] = $file_id;
1454 $q_ids = $page_obj->getQuestionIds();
1455 foreach($q_ids as $q_id)
1457 $this->q_ids[$q_id] = $q_id;
1473 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1475 $linked_mobs = array();
1478 foreach ($this->mob_ids as $mob_id)
1482 $expLog->write(date(
"[y-m-d H:i:s] ").
"Media Object ".$mob_id);
1484 $media_obj->exportXML($a_xml_writer, $a_inst);
1485 $media_obj->exportFiles($a_target_dir);
1487 $lmobs = $media_obj->getLinkedMediaObjects($this->mob_ids);
1488 $linked_mobs = array_merge($linked_mobs, $lmobs);
1495 foreach ($linked_mobs as $mob_id)
1499 $expLog->write(date(
"[y-m-d H:i:s] ").
"Media Object ".$mob_id);
1501 $media_obj->exportXML($a_xml_writer, $a_inst);
1502 $media_obj->exportFiles($a_target_dir);
1515 include_once(
"./Modules/File/classes/class.ilObjFile.php");
1517 foreach ($this->file_ids as $file_id)
1519 $expLog->write(date(
"[y-m-d H:i:s] ").
"File Item ".$file_id);
1520 $file_obj =
new ilObjFile($file_id,
false);
1521 $file_obj->export($a_target_dir);
1533 $a_xml_writer->xmlStartTag(
"Properties", $attrs);
1536 $attrs = array(
"Name" =>
"Layout",
"Value" => $this->
getLayout());
1537 $a_xml_writer->xmlElement(
"Property", $attrs);
1540 $attrs = array(
"Name" =>
"PageHeader",
"Value" => $this->
getPageHeader());
1541 $a_xml_writer->xmlElement(
"Property", $attrs);
1544 $attrs = array(
"Name" =>
"TOCMode",
"Value" => $this->
getTOCMode());
1545 $a_xml_writer->xmlElement(
"Property", $attrs);
1548 $attrs = array(
"Name" =>
"ActiveLMMenu",
"Value" =>
1550 $a_xml_writer->xmlElement(
"Property", $attrs);
1553 $attrs = array(
"Name" =>
"ActiveNumbering",
"Value" =>
1555 $a_xml_writer->xmlElement(
"Property", $attrs);
1558 $attrs = array(
"Name" =>
"ActiveTOC",
"Value" =>
1560 $a_xml_writer->xmlElement(
"Property", $attrs);
1563 $attrs = array(
"Name" =>
"ActivePrintView",
"Value" =>
1565 $a_xml_writer->xmlElement(
"Property", $attrs);
1571 $attrs = array(
"Name" =>
"CleanFrames",
"Value" =>
1573 $a_xml_writer->xmlElement(
"Property", $attrs);
1576 $attrs = array(
"Name" =>
"PublicNotes",
"Value" =>
1578 $a_xml_writer->xmlElement(
"Property", $attrs);
1581 $attrs = array(
"Name" =>
"HistoryUserComments",
"Value" =>
1583 $a_xml_writer->xmlElement(
"Property", $attrs);
1588 $attrs = array(
"Name" =>
"HeaderPage",
"Value" =>
1589 "il_".IL_INST_ID.
"_pg_".$this->getHeaderPage());
1590 $a_xml_writer->xmlElement(
"Property", $attrs);
1596 $attrs = array(
"Name" =>
"FooterPage",
"Value" =>
1597 "il_".IL_INST_ID.
"_pg_".$this->getFooterPage());
1598 $a_xml_writer->xmlElement(
"Property", $attrs);
1601 $a_xml_writer->xmlEndTag(
"Properties");
1611 $types = array(
"xml",
"html",
"scorm");
1613 foreach ($types as
$type)
1617 if (!@is_dir(
$dir) or
1618 !is_writeable(
$dir))
1629 while ($entry = $cdir->read())
1631 if ($entry !=
"." and
1633 substr($entry, -4) ==
".zip" and
1634 ereg(
"^[0-9]{10}_{2}[0-9]+_{2}(lm_)*[0-9]+\.zip\$", $entry))
1636 $file[$entry.$type] = array(
"type" => $type,
"file" => $entry,
1637 "size" => filesize(
$dir.
"/".$entry));
1659 $this->public_export_file[$a_type] = $a_file;
1671 return $this->public_export_file[$a_type];
1680 if (!@is_dir(
$dir) or
1681 !is_writeable(
$dir))
1693 while ($entry =
$dir->read())
1695 if ($entry !=
"." and
1697 substr($entry, -4) ==
".pdf" and
1698 ereg(
"^[0-9]{10}_{2}[0-9]+_{2}(lm_)*[0-9]+\.pdf\$", $entry))
1727 include(
"./Modules/LearningModule/classes/class.ilContObjectManifestBuilder.php");
1729 $man_builder->buildManifest();
1730 $man_builder->dump($a_target_dir);
1733 copy(
"Modules/LearningModule/scorm_xsd/adlcp_rootv1p2.xsd", $a_target_dir.
"/adlcp_rootv1p2.xsd");
1734 copy(
"Modules/LearningModule/scorm_xsd/imscp_rootv1p1p2.xsd", $a_target_dir.
"/imscp_rootv1p1p2.xsd");
1735 copy(
"Modules/LearningModule/scorm_xsd/imsmd_rootv1p2p1.xsd", $a_target_dir.
"/imsmd_rootv1p2p1.xsd");
1736 copy(
"Modules/LearningModule/scorm_xsd/ims_xml.xsd", $a_target_dir.
"/ims_xml.xsd");
1740 $zip_file = $a_target_dir.
"/".$date.
"__".IL_INST_ID.
"__".
1744 $a_target_dir.
"/imsmanifest.xml",
1745 $a_target_dir.
"/adlcp_rootv1p2.xsd",
1746 $a_target_dir.
"/imscp_rootv1p1p2.xsd",
1747 $a_target_dir.
"/ims_xml.xsd",
1748 $a_target_dir.
"/imsmd_rootv1p2p1.xsd")
1754 rename($zip_file, $dest_file);
1763 function exportHTML($a_target_dir,
$log, $a_zip_file =
true, $a_export_format =
"html")
1770 $mob_dir = $a_target_dir.
"/mobs";
1772 $file_dir = $a_target_dir.
"/files";
1774 $teximg_dir = $a_target_dir.
"/teximg";
1776 $style_dir = $a_target_dir.
"/style";
1778 $style_img_dir = $a_target_dir.
"/style/images";
1780 $content_style_dir = $a_target_dir.
"/content_style";
1782 $content_style_img_dir = $a_target_dir.
"/content_style/images";
1788 $style_name = $ilUser->prefs[
"style"].
".css";
1789 copy($location_stylesheet, $style_dir.
"/".$style_name);
1790 $fh = fopen($location_stylesheet,
"r");
1791 $css = fread($fh, filesize($location_stylesheet));
1792 preg_match_all(
"/url\(([^\)]*)\)/",$css,
$files);
1793 foreach (array_unique(
$files[1]) as $fileref)
1795 $fileref = dirname($location_stylesheet).
"/".$fileref;
1796 if (is_file($fileref))
1798 copy($fileref, $style_img_dir.
"/".basename($fileref));
1805 $ilBench->start(
"ExportHTML",
"exportContentStyle");
1808 $cont_stylesheet =
"./Services/COPage/css/content.css";
1810 $css = fread(fopen($cont_stylesheet,
'r'),filesize($cont_stylesheet));
1811 preg_match_all(
"/url\(([^\)]*)\)/",$css,
$files);
1812 foreach (array_unique(
$files[1]) as $fileref)
1814 if (is_file(str_replace(
"..",
".", $fileref)))
1816 copy(str_replace(
"..",
".", $fileref), $content_style_img_dir.
"/".basename($fileref));
1818 $css = str_replace($fileref,
"images/".basename($fileref),$css);
1820 fwrite(fopen($content_style_dir.
"/content.css",
'w'),$css);
1825 $style->writeCSSFile($content_style_dir.
"/content.css",
"images");
1826 $style->copyImagesToDir($content_style_img_dir);
1828 $ilBench->stop(
"ExportHTML",
"exportContentStyle");
1832 copy($syn_stylesheet, $a_target_dir.
"/syntaxhighlight.css");
1835 include_once(
"./Modules/LearningModule/classes/class.ilLMPresentationGUI.php");
1836 $_GET[
"cmd"] =
"nop";
1838 $lm_gui->setOfflineMode(
true);
1839 $lm_gui->setOfflineDirectory($a_target_dir);
1840 $lm_gui->setExportFormat($a_export_format);
1843 $ilBench->start(
"ExportHTML",
"exportHTMLPages");
1845 $ilBench->stop(
"ExportHTML",
"exportHTMLPages");
1848 $ilBench->start(
"ExportHTML",
"exportHTMLGlossaryTerms");
1850 $ilBench->stop(
"ExportHTML",
"exportHTMLGlossaryTerms");
1853 $ilBench->start(
"ExportHTML",
"exportHTMLMediaObjects");
1854 $linked_mobs = array();
1855 foreach ($this->offline_mobs as $mob)
1859 $this->
exportHTMLMOB($a_target_dir, $lm_gui, $mob,
"_blank", $linked_mobs);
1862 $linked_mobs2 = array();
1863 foreach ($linked_mobs as $mob)
1867 $this->
exportHTMLMOB($a_target_dir, $lm_gui, $mob,
"_blank", $linked_mobs2);
1870 $_GET[
"obj_type"] =
"MediaObject";
1871 $_GET[
"obj_id"] = $a_mob_id;
1873 $ilBench->stop(
"ExportHTML",
"exportHTMLMediaObjects");
1876 $ilBench->start(
"ExportHTML",
"exportHTMLFileObjects");
1877 foreach ($this->offline_files as
$file)
1881 $ilBench->stop(
"ExportHTML",
"exportHTMLFileObjects");
1884 $ilBench->start(
"ExportHTML",
"exportHTMLTOC");
1885 $ilLocator->clearItems();
1888 $tpl =
new ilTemplate(
"tpl.main.html",
true,
true);
1890 $content =& $lm_gui->showTableOfContents();
1891 $file = $a_target_dir.
"/table_of_contents.html";
1894 if (!($fp = @fopen($file,
"w+")))
1896 die (
"<b>Error</b>: Could not open \"".$file.
"\" for writing".
1897 " in <b>".__FILE__.
"</b> on line <b>".__LINE__.
"</b><br />");
1900 fwrite($fp, $content);
1903 $ilBench->stop(
"ExportHTML",
"exportHTMLTOC");
1906 $ilBench->start(
"ExportHTML",
"exportHTMLImages");
1907 $image_dir = $a_target_dir.
"/images";
1911 $image_dir.
"/enlarge.gif");
1913 $image_dir.
"/browser/plus.gif");
1915 $image_dir.
"/browser/minus.gif");
1917 $image_dir.
"/browser/blank.gif");
1919 $image_dir.
"/spacer.gif");
1921 $image_dir.
"/icon_st.gif");
1923 $image_dir.
"/icon_pg.gif");
1925 $image_dir.
"/icon_st_s.gif");
1927 $image_dir.
"/icon_pg_s.gif");
1929 $image_dir.
"/icon_lm.gif");
1931 $image_dir.
"/icon_lm_s.gif");
1933 $image_dir.
"/nav_arr_L.gif");
1935 $image_dir.
"/nav_arr_R.gif");
1937 $image_dir.
"/browser/forceexp.gif");
1940 $image_dir.
"/download.gif");
1941 $ilBench->stop(
"ExportHTML",
"exportHTMLImages");
1944 $services_dir = $a_target_dir.
"/Services";
1946 $media_service_dir = $services_dir.
"/MediaObjects";
1948 $flv_dir = $media_service_dir.
"/flash_flv_player";
1950 $mp3_dir = $media_service_dir.
"/flash_mp3_player";
1952 copy(
"./Services/MediaObjects/flash_flv_player/flvplayer.swf",
1953 $flv_dir.
"/flvplayer.swf");
1954 copy(
"./Services/MediaObjects/flash_mp3_player/mp3player.swf",
1955 $mp3_dir.
"/mp3player.swf");
1961 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
1962 foreach (self::getSupplyingExportFiles($a_target_dir) as $f)
1964 copy($f[
"source"], $f[
"target"]);
1968 $tpl =
new ilTemplate(
"tpl.main.html",
true,
true);
1969 $tpl->setVariable(
"LOCATION_STYLESHEET",$location_stylesheet);
1970 $tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
1973 $ilBench->start(
"ExportHTML",
"zip");
1986 $ilBench->stop(
"ExportHTML",
"zip");
1998 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
1999 include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
2002 "target" => $a_target_dir.
'/js/yahoo/yahoo-min.js',
2005 "target" => $a_target_dir.
'/js/yahoo/yahoo-dom-event.js',
2008 "target" => $a_target_dir.
'/js/yahoo/animation-min.js',
2010 array(
"source" =>
'./Services/JavaScript/js/Basic.js',
2011 "target" => $a_target_dir.
'/js/Basic.js',
2013 array(
"source" =>
'./Services/Accordion/js/accordion.js',
2014 "target" => $a_target_dir.
'/js/accordion.js',
2016 array(
"source" =>
'./Services/Accordion/css/accordion.css',
2017 "target" => $a_target_dir.
'/css/accordion.css',
2020 "target" => $a_target_dir.
'/js/jquery.js',
2023 "target" => $a_target_dir.
'/js/jquery-ui-min.js',
2025 array(
"source" =>
'./Services/COPage/js/ilCOPagePres.js',
2026 "target" => $a_target_dir.
'/js/ilCOPagePres.js',
2028 array(
"source" =>
'./Modules/Scorm2004/scripts/questions/pure.js',
2029 "target" => $a_target_dir.
'/js/pure.js',
2031 array(
"source" =>
'./Modules/Scorm2004/scripts/questions/question_handling.js',
2032 "target" => $a_target_dir.
'/js/question_handling.js',
2034 array(
"source" =>
'./Modules/Scorm2004/templates/default/question_handling.css',
2035 "target" => $a_target_dir.
'/css/question_handling.css',
2045 $file_dir = $a_target_dir.
"/files/file_".$a_file_id;
2047 include_once(
"./Modules/File/classes/class.ilObjFile.php");
2048 $file_obj =
new ilObjFile($a_file_id,
false);
2049 $source_file = $file_obj->getDirectory($file_obj->getVersion()).
"/".$file_obj->getFileName();
2050 if (!is_file($source_file))
2052 $source_file = $file_obj->getDirectory().
"/".$file_obj->getFileName();
2054 if (is_file($source_file))
2056 copy($source_file, $file_dir.
"/".$file_obj->getFileName());
2063 function exportHTMLMOB($a_target_dir, &$a_lm_gui, $a_mob_id, $a_frame, &$a_linked_mobs)
2067 $mob_dir = $a_target_dir.
"/mobs";
2070 if (@is_dir($source_dir))
2076 $tpl =
new ilTemplate(
"tpl.main.html",
true,
true);
2077 $tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
2078 $_GET[
"obj_type"] =
"MediaObject";
2079 $_GET[
"mob_id"] = $a_mob_id;
2080 $_GET[
"frame"] = $a_frame;
2082 $content =& $a_lm_gui->media();
2083 $file = $a_target_dir.
"/media_".$a_mob_id.
".html";
2086 if (!($fp = @fopen(
$file,
"w+")))
2088 die (
"<b>Error</b>: Could not open \"".
$file.
"\" for writing".
2089 " in <b>".__FILE__.
"</b> on line <b>".__LINE__.
"</b><br />");
2092 fwrite($fp, $content);
2096 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2098 if ($mob_obj->hasFullscreenItem())
2100 $tpl =
new ilTemplate(
"tpl.main.html",
true,
true);
2101 $tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
2102 $_GET[
"obj_type"] =
"";
2103 $_GET[
"frame"] =
"";
2104 $_GET[
"mob_id"] = $a_mob_id;
2105 $_GET[
"cmd"] =
"fullscreen";
2106 $content =& $a_lm_gui->fullscreen();
2107 $file = $a_target_dir.
"/fullscreen_".$a_mob_id.
".html";
2110 if (!($fp = @fopen(
$file,
"w+")))
2112 die (
"<b>Error</b>: Could not open \"".
$file.
"\" for writing".
2113 " in <b>".__FILE__.
"</b> on line <b>".__LINE__.
"</b><br />");
2116 fwrite($fp, $content);
2119 $linked_mobs = $mob_obj->getLinkedMediaObjects();
2120 $a_linked_mobs = array_merge($a_linked_mobs, $linked_mobs);
2130 foreach($this->offline_int_links as $int_link)
2132 $ilLocator->clearItems();
2133 if ($int_link[
"type"] ==
"git")
2136 $tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
2138 $_GET[
"obj_id"] = $int_link[
"id"];
2139 $_GET[
"frame"] =
"_blank";
2140 $content =& $a_lm_gui->glossary();
2141 $file = $a_target_dir.
"/term_".$int_link[
"id"].
".html";
2144 if (!($fp = @fopen(
$file,
"w+")))
2146 die (
"<b>Error</b>: Could not open \"".
$file.
"\" for writing".
2147 " in <b>".__FILE__.
"</b> on line <b>".__LINE__.
"</b><br />");
2150 fwrite($fp, $content);
2154 include_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
2156 foreach($defs as $def)
2159 foreach($def_mobs as $def_mob)
2161 $this->offline_mobs[$def_mob] = $def_mob;
2166 $this->offline_files = array_merge($this->offline_files, $def_files);
2185 $this->first_page_id = $first_page[
"child"];
2189 $int_links = array();
2190 $this->offline_files = array();
2192 include_once(
"./Services/COPage/classes/class.ilPageContentUsage.php");
2193 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2197 $exp_id_map = array();
2199 if ($lm_set->get(
"html_export_ids"))
2201 foreach ($pages as $page)
2204 if (trim($exp_id) !=
"")
2206 $exp_id_map[$page[
"obj_id"]] = trim($exp_id);
2212 foreach ($pages as $page)
2216 $ilLocator->clearItems();
2217 $ilBench->start(
"ExportHTML",
"exportHTMLPage");
2218 $ilBench->start(
"ExportHTML",
"exportPageHTML");
2221 $ilBench->stop(
"ExportHTML",
"exportPageHTML");
2225 foreach ($pcs as $pc)
2227 if ($pc[
"type"] ==
"incl")
2230 foreach($incl_mobs as $incl_mob)
2232 $mobs[$incl_mob] = $incl_mob;
2239 foreach($pg_mobs as $pg_mob)
2241 $mobs[$pg_mob] = $pg_mob;
2246 $int_links = array_merge($int_links, $pg_links);
2249 include_once(
"./Modules/File/classes/class.ilObjFile.php");
2251 $this->offline_files = array_merge($this->offline_files, $pg_files);
2253 $ilBench->stop(
"ExportHTML",
"exportHTMLPage");
2256 $this->offline_mobs =
$mobs;
2257 $this->offline_int_links = $int_links;
2268 $a_exp_id_map = array())
2274 $tpl =
new ilTemplate(
"tpl.main.html",
true,
true);
2275 $tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
2277 $_GET[
"obj_id"] = $a_lm_page_id;
2278 $_GET[
"frame"] = $a_frame;
2283 if (is_array($a_exp_id_map) && isset($a_exp_id_map[$a_lm_page_id]))
2285 $file = $a_target_dir.
"/lm_pg_".$a_exp_id_map[$a_lm_page_id].
".html";
2289 $file = $a_target_dir.
"/lm_pg_".$a_lm_page_id.
".html";
2294 if ($a_frame !=
"toc")
2296 $file = $a_target_dir.
"/frame_".$a_lm_page_id.
"_".$a_frame.
".html";
2300 $file = $a_target_dir.
"/frame_".$a_frame.
".html";
2305 if (@is_file(
$file))
2310 $ilBench->start(
"ExportHTML",
"layout");
2311 $ilBench->start(
"ExportHTML",
"layout_".$a_frame);
2312 $content =& $a_lm_gui->layout(
"main.xml",
false);
2313 $ilBench->stop(
"ExportHTML",
"layout_".$a_frame);
2314 $ilBench->stop(
"ExportHTML",
"layout");
2317 if (!($fp = @fopen(
$file,
"w+")))
2319 die (
"<b>Error</b>: Could not open \"".
$file.
"\" for writing".
2320 " in <b>".__FILE__.
"</b> on line <b>".__LINE__.
"</b><br />");
2327 fwrite($fp, $content);
2332 if ($this->first_page_id == $a_lm_page_id && $a_frame ==
"")
2334 copy(
$file, $a_target_dir.
"/index.html");
2338 $ilBench->start(
"ExportHTML",
"getCurrentFrameSet");
2339 $frameset = $a_lm_gui->getCurrentFrameSet();
2340 $ilBench->stop(
"ExportHTML",
"getCurrentFrameSet");
2342 foreach ($frameset as $frame)
2344 $this->
exportPageHTML($a_lm_gui, $a_target_dir, $a_lm_page_id, $frame);
2361 $attrs[
"xmlns:fo"] =
"http://www.w3.org/1999/XSL/Format";
2362 $a_xml_writer->xmlStartTag(
"fo:root", $attrs);
2366 $a_xml_writer->xmlStartTag(
"fo:layout-master-set", $attrs);
2370 $attrs[
"master-name"] =
"DinA4";
2371 $attrs[
"page-height"] =
"29.7cm";
2372 $attrs[
"page-width"] =
"21cm";
2373 $attrs[
"margin-top"] =
"4cm";
2374 $attrs[
"margin-bottom"] =
"1cm";
2375 $attrs[
"margin-left"] =
"2.8cm";
2376 $attrs[
"margin-right"] =
"7.3cm";
2377 $a_xml_writer->xmlStartTag(
"fo:simple-page-master", $attrs);
2381 $attrs[
"margin-top"] =
"0cm";
2382 $attrs[
"margin-bottom"] =
"1.25cm";
2383 $a_xml_writer->xmlElement(
"fo:region-body", $attrs);
2387 $attrs[
"extent"] =
"1cm";
2388 $a_xml_writer->xmlElement(
"fo:region-before", $attrs);
2392 $attrs[
"extent"] =
"1cm";
2393 $a_xml_writer->xmlElement(
"fo:region-after", $attrs);
2396 $a_xml_writer->xmlEndTag(
"fo:simple-page-master");
2399 $a_xml_writer->xmlEndTag(
"fo:layout-master-set");
2403 $attrs[
"master-reference"] =
"DinA4";
2404 $a_xml_writer->xmlStartTag(
"fo:page-sequence", $attrs);
2408 $attrs[
"flow-name"] =
"xsl-region-body";
2409 $a_xml_writer->xmlStartTag(
"fo:flow", $attrs);
2414 $ilBench->start(
"ContentObjectExport",
"exportFOStructureObjects");
2416 $ilBench->stop(
"ContentObjectExport",
"exportFOStructureObjects");
2420 $a_xml_writer->xmlEndTag(
"fo:flow");
2423 $a_xml_writer->xmlEndTag(
"fo:page-sequence");
2426 $a_xml_writer->xmlEndTag(
"fo:root");
2437 $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
2438 foreach ($childs as $child)
2440 if($child[
"type"] !=
"st")
2446 $structure_obj->exportFO($a_xml_writer, $expLog);
2447 unset($structure_obj);
2453 include_once(
"./Modules/LearningModule/classes/class.ilContObjectExport.php");
2457 $export_file = $cont_exp->buildExportFile();
2458 return $export_file;
2472 $lmtree->setTableNames(
'lm_tree',
'lm_data');
2473 $lmtree->setTreeTablePK(
"lm_id");
2476 $source_obj->setLMId($this->
getId());
2481 $target_obj->setLMId($this->
getId());
2482 $target_parent = $lmtree->getParentId(
$target_id);
2486 if ($source_obj->getType() ==
"pg")
2489 if ($lmtree->isInTree($source_obj->getId()))
2491 $node_data = $lmtree->getNodeData($source_obj->getId());
2494 if ($movecopy ==
"move")
2496 $parent_id = $lmtree->getParentId($source_obj->getId());
2497 $lmtree->deleteTree($node_data);
2500 require_once(
"classes/class.ilHistory.php");
2511 $new_page =& $source_obj->copy();
2512 $source_id = $new_page->getId();
2513 $source_obj =& $new_page;
2517 if(!$lmtree->isInTree($source_obj->getId()))
2524 else if ($as_subitem)
2528 $pg_childs =& $lmtree->getChildsByType($parent,
"pg");
2529 if (count($pg_childs) != 0)
2531 $target_pos = $pg_childs[count($pg_childs) - 1][
"obj_id"];
2537 $parent = $target_parent;
2541 $lmtree->insertNode($source_obj->getId(),
2542 $parent, $target_pos);
2545 if ($movecopy ==
"move")
2548 include_once(
"classes/class.ilHistory.php");
2562 if ($source_obj->getType() ==
"st")
2565 $source_node = $lmtree->getNodeData($source_id);
2566 $subnodes = $lmtree->getSubtree($source_node);
2569 foreach ($subnodes as $subnode)
2584 $pg_childs =& $lmtree->getChildsByType($target_parent,
"pg");
2585 if (count($pg_childs) != 0)
2587 $target_pos = $pg_childs[count($pg_childs) - 1][
"obj_id"];
2590 else if ($as_subitem)
2594 $childs =& $lmtree->getChilds($target_parent);
2595 if (count($childs) != 0)
2597 $target_pos = $childs[count($childs) - 1][
"obj_id"];
2622 if ($movecopy ==
"move")
2624 $lmtree->deleteTree($source_node);
2629 $new_chapter =& $source_obj->copy($lmtree, $target_parent, $target_pos);
2632 if (!$lmtree->isInTree($source_id))
2634 $lmtree->insertNode($source_id, $target_parent, $target_pos);
2637 if ($movecopy ==
"move")
2639 foreach ($subnodes as $node)
2641 if($node[
"obj_id"] != $source_id)
2643 $lmtree->insertNode($node[
"obj_id"], $node[
"parent"]);
2661 include_once
"./Modules/LearningModule/classes/class.ilLMPageObject.php";
2662 include_once
"./Services/COPage/classes/class.ilPageObject.php";
2667 foreach ($pages as $page)
2673 $error = @$cpage->validateDom();
2677 $this->lng->loadLanguageModule(
"content");
2681 $mess.= $this->lng->txt(
"obj_pg").
": ".
$title;
2682 $mess.=
'<div class="small">';
2683 foreach ($error as $e)
2685 $err_mess = implode($e,
" - ");
2686 if (!is_int(strpos($err_mess,
":0:")))
2688 $mess.= htmlentities($err_mess).
"<br />";
2714 $file = pathinfo($a_filename);
2718 $a_filename, $full_path);
2723 $subdir = basename(
$file[
"basename"],
".".
$file[
"extension"]);
2746 $subdir = basename($a_directory);
2747 $xml_file = $a_directory.
"/".$subdir.
".xml";
2750 if (!is_dir($a_directory))
2752 return sprintf($lng->txt(
"cont_no_subdir_in_zip"), $subdir);
2756 if (!is_file($xml_file))
2758 return sprintf($lng->txt(
"cont_zip_file_invalid"), $subdir.
"/".$subdir.
".xml");
2762 $qti_file = $a_directory.
"/qti.xml";
2764 if (is_file($qti_file))
2766 include_once
"./Services/QTI/classes/class.ilQTIParser.php";
2767 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
2770 $result = $qtiParser->startParsing ();
2771 $founditems = & $qtiParser->getFoundItems ();
2773 if (count($founditems) > 0)
2776 $qtiParser->setTestObject($testObj);
2777 $result = $qtiParser->startParsing();
2778 $qtis = array_merge($qtis, $qtiParser->getImportMapping());
2782 include_once (
"./Modules/LearningModule/classes/class.ilContObjParser.php");
2783 $contParser =
new ilContObjParser($this, $xml_file, $subdir, $qmapping);
2784 $contParser->setQuestionMapping($qtis);
2785 $contParser->startParsing();
2790 $style_file = $a_directory.
"/style.xml";
2791 $style_zip_file = $a_directory.
"/style.zip";
2792 if (is_file($style_zip_file))
2794 require_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
2796 $style->import($style_zip_file);
2799 else if (is_file($style_file))
2801 require_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
2803 $style->import($style_file);
2816 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
2840 $new_obj->setTitle($this->
getTitle());
2843 $new_obj->setLayout($this->
getLayout());
2859 $new_obj->createLMTree();
2862 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
2867 $style_obj = $ilias->obj_factory->getInstanceByObjId(
$style_id);
2868 $new_id = $style_obj->ilClone();
2869 $new_obj->setStyleSheetId($new_id);
2877 include_once(
'Services/Tracking/classes/class.ilLPObjSettings.php');
2879 $obj_settings->cloneSettings($new_obj->getId());
2880 unset($obj_settings);
2893 $parent_id = $a_target_obj->lm_tree->readRootId();
2895 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
2896 include_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
2899 $chapters = $this->lm_tree->getChildsByType($this->lm_tree->readRootId(),
"st");
2900 $copied_nodes = array();
2902 foreach ($chapters as $chap)
2911 foreach ($pages as $p)
2913 if (!$this->lm_tree->isInTree($p[
"obj_id"]))
2916 $target_item = $item->copy($a_target_obj);
2917 $copied_nodes[$item->getId()] = $target_item->getId();
2923 $a_target_obj->checkTree();