4 require_once
"./Services/Object/classes/class.ilObject.php";
5 require_once
"Services/MetaData/classes/class.ilMDLanguageItem.php";
60 public function __construct($a_id = 0, $a_call_by_reference =
true)
64 $this->
user = $DIC->user();
65 $this->db = $DIC->database();
66 $this->tree = $DIC->repositoryTree();
67 $this->lng = $DIC->language();
68 $this->error = $DIC[
"ilErr"];
69 if (isset($DIC[
"tpl"])) {
70 $this->tpl = $DIC[
"tpl"];
72 if (isset($DIC[
"ilLocator"])) {
73 $this->locator = $DIC[
"ilLocator"];
77 parent::__construct($a_id, $a_call_by_reference);
81 $this->mob_ids = array();
82 $this->file_ids = array();
83 $this->q_ids = array();
89 public function create($a_no_meta_data =
false)
96 if (!$a_no_meta_data) {
114 # echo "Content<br>\n"; 117 $this->lm_tree->setTableNames(
'lm_tree',
'lm_data');
118 $this->lm_tree->setTreeTablePK(
"lm_id");
124 "SELECT * FROM lm_glossaries " .
125 " WHERE lm_id = " .
$ilDB->quote($this->getId(),
"integer")
128 while ($rec =
$ilDB->fetchAssoc($set)) {
129 $glos[] = $rec[
"glo_id"];
143 return parent::getTitle();
151 parent::setTitle($a_title);
162 return parent::getDescription();
170 parent::setDescription($a_description);
182 $this->import_id = $a_id;
192 $this->layout_per_page = $a_val;
202 return $this->layout_per_page;
212 $this->disable_def_feedback = $a_val;
222 return $this->disable_def_feedback;
232 $this->progr_icons = $a_val;
242 return $this->progr_icons;
252 $this->store_tries = $a_val;
262 return $this->store_tries;
272 $this->restrict_forw_nav = $a_val;
282 return $this->restrict_forw_nav;
314 "DELETE FROM lm_glossaries WHERE " .
315 " lm_id = " .
$ilDB->quote($this->getId(),
"integer")
318 $ilDB->manipulate(
"INSERT INTO lm_glossaries " .
319 "(lm_id, glo_id) VALUES (" .
320 $ilDB->quote($this->getId(),
"integer") .
"," .
321 $ilDB->quote($glo_id,
"integer") .
330 public function import()
346 parent::putInTree($a_parent);
361 $this->lm_tree->setTreeTablePK(
"lm_id");
362 $this->lm_tree->setTableNames(
'lm_tree',
'lm_data');
363 $this->lm_tree->addTree($this->
getId(), 1);
373 $this->auto_glossaries = array();
374 if (is_array($a_val)) {
375 foreach ($a_val as $v) {
378 !in_array($v, $this->auto_glossaries)) {
379 $this->auto_glossaries[] = $v;
405 if ($g != $a_glo_id) {
420 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
421 include_once(
"./Modules/LearningModule/classes/class.ilStructureObject.php");
422 include_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
424 $root_id = $this->lm_tree->getRootId();
428 $chap->setType(
"st");
429 $chap->setTitle(
$lng->txt(
"cont_new_chap"));
430 $chap->setLMId($this->
getId());
436 $page->setType(
"pg");
437 $page->setTitle(
$lng->txt(
"cont_new_page"));
438 $page->setLMId($this->
getId());
450 $this->for_translation = $a_val;
482 if (!is_writable($lm_data_dir)) {
483 $ilErr->raiseError(
"Content object Data Directory (" . $lm_data_dir
484 .
") not writeable.",
$ilErr->FATAL);
488 $lm_dir = $lm_data_dir .
"/lm_" . $this->
getId();
490 if (!@is_dir($lm_dir)) {
491 $ilErr->raiseError(
"Creation of Learning Module Directory failed.",
$ilErr->FATAL);
498 $ilErr->raiseError(
"Creation of Import Directory failed.",
$ilErr->FATAL);
508 "/lm_" . $this->
getId();
516 if (strlen($this->import_dir)) {
521 "/lm_" . $this->
getId() .
"/import";
537 $this->import_dir = $a_import_dir;
551 if (!is_writable($lm_data_dir)) {
552 $ilErr->raiseError(
"Content object Data Directory (" . $lm_data_dir
553 .
") not writeable.",
$ilErr->FATAL);
556 $lm_dir = $lm_data_dir .
"/lm_" . $this->
getId();
558 if (!@is_dir($lm_dir)) {
559 $ilErr->raiseError(
"Creation of Learning Module Directory failed.",
$ilErr->FATAL);
565 $export_dir = $lm_dir .
"/export_scorm";
569 if (substr(
$a_type, 0, 4) ==
"html") {
570 $export_dir = $lm_dir .
"/export_" .
$a_type;
572 $export_dir = $lm_dir .
"/export";
578 if (!@is_dir($export_dir)) {
579 $ilErr->raiseError(
"Creation of Export Directory failed.",
$ilErr->FATAL);
594 if (substr(
$a_type, 0, 4) ==
"html") {
615 public function delete()
620 if (!parent::delete()) {
625 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
633 $this->lm_tree->removeTree($this->lm_tree->getTreeId());
639 $q =
"DELETE FROM content_object WHERE id = " .
641 $ilDB->manipulate($q);
644 $q =
"DELETE FROM lm_menu WHERE lm_id = " .
646 $ilDB->manipulate($q);
650 "DELETE FROM lm_glossaries WHERE " .
651 " lm_id = " .
$ilDB->quote($this->getId(),
"integer")
676 $this->layout = $a_layout;
692 $this->style_id = $a_style_id;
702 $q =
"UPDATE content_object SET " .
703 " stylesheet = " .
$ilDB->quote((
int) $a_style_id,
"integer") .
704 " WHERE id = " .
$ilDB->quote($this->
getId(),
"integer");
705 $ilDB->manipulate($q);
707 $this->style_id = $a_style_id;
720 $ilDB = $DIC->database();
723 "UPDATE content_object SET " .
724 " header_page = " .
$ilDB->quote($a_page_id,
"integer") .
725 " WHERE id = " .
$ilDB->quote($a_lm_id,
"integer")
739 $ilDB = $DIC->database();
742 "UPDATE content_object SET " .
743 " footer_page = " .
$ilDB->quote($a_page_id,
"integer") .
744 " WHERE id = " .
$ilDB->quote($a_lm_id,
"integer")
756 $ilDB = $DIC->database();
758 if ($a_from_style < 0) {
759 $q =
"SELECT stylesheet FROM content_object, style_data " .
760 " WHERE content_object.stylesheet = style_data.id " .
761 " AND style_data.standard = " .
$ilDB->quote(0,
"integer") .
762 " AND content_object.stylesheet > " .
$ilDB->quote(0,
"integer");
763 $style_set =
$ilDB->query($q);
764 while ($style_rec =
$ilDB->fetchAssoc($style_set)) {
766 $q =
"UPDATE content_object SET " .
767 " stylesheet = " .
$ilDB->quote((
int) $a_to_style,
"integer") .
768 " WHERE stylesheet = " .
$ilDB->quote($style_rec[
"stylesheet"],
"integer");
769 $ilDB->manipulate($q);
773 $style_obj->delete();
776 $q =
"UPDATE content_object SET " .
777 " stylesheet = " .
$ilDB->quote((
int) $a_to_style,
"integer") .
778 " WHERE stylesheet = " .
$ilDB->quote($a_from_style,
"integer");
779 $ilDB->manipulate($q);
790 protected static function _lookup($a_obj_id, $a_field)
794 $ilDB = $DIC->database();
797 $q =
"SELECT " . $a_field .
" FROM content_object " .
798 " WHERE id = " .
$ilDB->quote($a_obj_id,
"integer");
803 return $rec[$a_field];
814 return self::_lookup($a_obj_id,
"restrict_forw_nav");
824 $ilDB = $DIC->database();
826 $q =
"SELECT stylesheet FROM content_object " .
827 " WHERE id = " .
$ilDB->quote($a_cont_obj_id,
"integer");
831 return $sheet[
"stylesheet"];
841 $ilDB = $DIC->database();
843 $q =
"SELECT id FROM content_object " .
844 " WHERE stylesheet = " .
$ilDB->quote($a_style_id,
"integer");
847 while ($cont =
$ilDB->fetchAssoc(
$res)) {
848 $obj_ids[] = $cont[
"id"];
860 $ilDB = $DIC->database();
862 $q =
"SELECT disable_def_feedback FROM content_object " .
863 " WHERE id = " .
$ilDB->quote($a_id,
"integer");
867 return $rec[
"disable_def_feedback"];
877 $ilDB = $DIC->database();
879 $q =
"SELECT store_tries FROM content_object " .
880 " WHERE id = " .
$ilDB->quote($a_id,
"integer");
884 return $rec[
"store_tries"];
897 $ilDB = $DIC->database();
899 $q =
"SELECT count(*) as cnt FROM content_object " .
900 " WHERE stylesheet = " .
$ilDB->quote($a_style_id,
"integer");
901 $cset =
$ilDB->query($q);
902 $crow =
$ilDB->fetchAssoc($cset);
904 return (
int) $crow[
"cnt"];
915 $ilDB = $DIC->database();
918 $q =
"SELECT count(*) as cnt FROM content_object, style_data " .
919 " WHERE stylesheet = style_data.id " .
920 " AND standard = " .
$ilDB->quote(0,
"integer");
921 $cset =
$ilDB->query($q);
922 $crow =
$ilDB->fetchAssoc($cset);
924 return (
int) $crow[
"cnt"];
934 $ilDB = $DIC->database();
936 $q =
"SELECT count(*) as cnt FROM content_object " .
937 " WHERE stylesheet = " .
$ilDB->quote(0,
"integer");
938 $cset =
$ilDB->query($q);
939 $crow =
$ilDB->fetchAssoc($cset);
941 return (
int) $crow[
"cnt"];
953 $ilDB = $DIC->database();
955 $q =
"UPDATE content_object SET " .
956 " stylesheet = " .
$ilDB->quote(0,
"integer") .
957 " WHERE stylesheet = " .
$ilDB->quote((
int) $a_style_id,
"integer");
959 $ilDB->manipulate($q);
977 $this->pg_header = $a_pg_header;
985 return $this->toc_mode;
993 return $this->public_access_mode;
1003 $this->toc_mode = $a_toc_mode;
1008 $this->lm_menu_active = $a_act_lm_menu;
1013 return $this->lm_menu_active;
1018 $this->toc_active = $a_toc;
1023 return $this->toc_active;
1028 $this->numbering = $a_num;
1033 return $this->numbering;
1038 $this->print_view_active = $a_print;
1043 return $this->print_view_active;
1048 $this->prevent_glossary_appendix_active = $a_print;
1053 return $this->prevent_glossary_appendix_active;
1063 $this->hide_header_footer_print = $a_val;
1073 return $this->hide_header_footer_print;
1078 $this->downloads_active = $a_down;
1083 return $this->downloads_active;
1088 $this->downloads_public_active = $a_down;
1093 return $this->downloads_public_active;
1098 $this->pub_notes = $a_pub_notes;
1103 return $this->pub_notes;
1108 $this->clean_frames = $a_clean;
1113 return $this->clean_frames;
1118 $this->user_comments = $a_comm;
1123 $this->public_access_mode = $a_mode;
1128 return $this->user_comments;
1133 $this->header_page = $a_pg;
1138 return $this->header_page;
1143 $this->footer_page = $a_pg;
1148 return $this->footer_page;
1158 $q =
"SELECT * FROM content_object WHERE id = " .
1162 $this->
setLayout($lm_rec[
"default_layout"]);
1191 include_once(
"./Services/Notes/classes/class.ilNote.php");
1209 $q =
"UPDATE content_object SET " .
1210 " default_layout = " .
$ilDB->quote($this->
getLayout(),
"text") .
", " .
1231 " rating = " .
$ilDB->quote($this->
hasRating(),
"integer") .
", " .
1238 " WHERE id = " .
$ilDB->quote($this->
getId(),
"integer");
1239 $ilDB->manipulate($q);
1241 include_once(
"./Services/Notes/classes/class.ilNote.php");
1252 $q =
"INSERT INTO content_object (id) VALUES (" .
$ilDB->quote($this->
getId(),
"integer") .
")";
1253 $ilDB->manipulate($q);
1256 include_once(
"./Services/Notes/classes/class.ilNote.php");
1268 $dir = opendir(
"./Modules/LearningModule/layouts/lm");
1272 while ($file = readdir($dir)) {
1273 if ($file !=
"." && $file !=
".." && $file !=
"CVS" && $file !=
".svn") {
1275 if (@is_dir(
"./Modules/LearningModule/layouts/lm/" . $file)) {
1276 $layouts[$file] = $file;
1284 'toc2win' =>
'toc2win',
1285 'toc2windyn' =>
'toc2windyn',
1286 '1window' =>
'1window',
1287 '2window' =>
'2window',
1288 '3window' =>
'3window',
1289 'presentation' =>
'presentation',
1290 'fullscreen' =>
'fullscreen' 1293 foreach ($layouts as
$l) {
1294 if (!in_array($l,
$ret)) {
1313 $lm_tree->setTableNames(
'lm_tree',
'lm_data');
1316 if (
$lm_tree->isInTree($page_id)) {
1318 foreach (
$path as $node) {
1319 if ($node[
"type"] ==
"st") {
1336 $lm_tree->setTableNames(
'lm_tree',
'lm_data');
1340 if (
$lm_tree->isInTree($page_id)) {
1343 foreach (
$path as $node) {
1344 if ($node[
"type"] ==
"st") {
1347 foreach ($tconds as $tcond) {
1366 $lm_tree->setTableNames(
'lm_tree',
'lm_data');
1370 if (
$lm_tree->isInTree($page_id)) {
1373 foreach (
$path as $node) {
1374 if ($node[
"type"] ==
"st") {
1377 foreach ($tconds as $tcond) {
1380 return $node[
"child"];
1396 $tree->setTableNames(
'lm_tree',
'lm_data');
1397 $tree->setTreeTablePK(
"lm_id");
1398 if (
$tree->isInTree($a_page_id)) {
1399 $succ =
$tree->fetchSuccessorNode($a_page_id,
"pg");
1411 $tree->setTableNames(
'lm_tree',
'lm_data');
1412 $tree->setTreeTablePK(
"lm_id");
1414 $tree->checkTreeChilds();
1430 $set =
$ilDB->query(
1431 "SELECT DISTINCT l1.lm_id" .
1432 " FROM lm_tree l1" .
1433 " JOIN lm_tree l2 ON ( l1.child = l2.parent" .
1434 " AND l1.lm_id = l2.lm_id )" .
1435 " JOIN lm_data ON ( l1.child = lm_data.obj_id )" .
1436 " WHERE (l2.lft < l1.lft" .
1437 " OR l2.rgt > l1.rgt OR l2.lft > l1.rgt OR l2.rgt < l1.lft)" .
1438 " AND l1.lm_id = " .
$ilDB->quote($this->getId(),
"integer") .
1439 " ORDER BY lm_data.create_date DESC" 1441 if ($rec =
$ilDB->fetchAssoc($set)) {
1446 $set =
$ilDB->query(
"SELECT * FROM lm_tree WHERE lm_tree.lm_id = " .
$ilDB->quote($this->getId(),
"integer"));
1447 while ($node =
$ilDB->fetchAssoc($set)) {
1448 $q =
"SELECT * FROM lm_data WHERE obj_id = " .
1449 $ilDB->quote($node[
"child"],
"integer");
1450 $obj_set =
$ilDB->query($q);
1451 $obj_rec =
$ilDB->fetchAssoc($obj_set);
1453 $node_data =
$tree->getNodeData($node[
"child"]);
1454 $node_data[
"child"] = $node[
"child"];
1455 $tree->deleteTree($node_data);
1461 foreach (
$nodes as $node) {
1462 $q =
"SELECT * FROM lm_data WHERE obj_id = " .
1463 $ilDB->quote($node[
"parent"],
"integer");
1464 $obj_set =
$ilDB->query($q);
1465 $obj_rec =
$ilDB->fetchAssoc($obj_set);
1466 if ($obj_rec[
"type"] ==
"pg") {
1467 $node_data =
$tree->getNodeData($node[
"child"]);
1468 if (
$tree->isInTree($node[
"child"])) {
1469 $tree->deleteTree($node_data);
1476 $set =
$ilDB->query(
"SELECT DISTINCT l1.lm_id" .
1477 " FROM lm_tree l1" .
1478 " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )" .
1479 " JOIN lm_data ON (l1.child = lm_data.obj_id)" .
1480 " WHERE l1.child <> 1" .
1481 " AND l1.lm_id <> lm_data.lm_id" .
1482 " AND l1.lm_id = " .
$ilDB->quote($this->getId(),
"integer"));
1483 if ($rec =
$ilDB->fetchAssoc($set)) {
1484 $set =
$ilDB->query(
"SELECT DISTINCT l1.child " .
1485 " FROM lm_tree l1" .
1486 " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )" .
1487 " JOIN lm_data ON (l1.child = lm_data.obj_id)" .
1488 " WHERE l1.child <> 1" .
1489 " AND l1.lm_id <> lm_data.lm_id" .
1490 " AND l1.lm_id = " .
$ilDB->quote($this->getId(),
"integer"));
1491 include_once(
"./Modules/LearningModule/classes/class.ilLMObjectFactory.php");
1492 while ($rec =
$ilDB->fetchAssoc($set)) {
1495 if (is_object($cobj)) {
1496 if ($cobj->getType() ==
"pg") {
1498 $pg_copy = $cobj->copy($this);
1502 "UPDATE lm_tree SET " .
1503 " child = " .
$ilDB->quote($pg_copy->getId(),
"integer") .
1504 " WHERE child = " .
$ilDB->quote($cobj->getId(),
"integer") .
1505 " AND lm_id = " .
$ilDB->quote($this->getId(),
"integer")
1507 } elseif ($cobj->getType() ==
"st") {
1509 $st_copy = $cobj->copy($this);
1513 "UPDATE lm_tree SET " .
1514 " child = " .
$ilDB->quote($st_copy->getId(),
"integer") .
1515 " WHERE child = " .
$ilDB->quote($cobj->getId(),
"integer") .
1516 " AND lm_id = " .
$ilDB->quote($this->getId(),
"integer")
1521 "UPDATE lm_tree SET " .
1522 " parent = " .
$ilDB->quote($st_copy->getId(),
"integer") .
1523 " WHERE parent = " .
$ilDB->quote($cobj->getId(),
"integer") .
1524 " AND lm_id = " .
$ilDB->quote($this->getId(),
"integer")
1532 $set =
$ilDB->queryF(
1533 "SELECT * FROM lm_data " .
1534 " WHERE lm_id = %s AND type = %s",
1535 array(
"integer",
"text"),
1536 array($this->
getId(),
"pg")
1538 while ($rec =
$ilDB->fetchAssoc($set)) {
1541 $lm_page->setId($rec[
"obj_id"]);
1542 $lm_page->setParentId($this->
getId());
1561 $set =
$ilDB->query(
1562 "SELECT l1.child, l1.lft l1lft, l1.rgt l1rgt, l2.parent, l2.lft l2lft, l2.rgt l2rgt" .
1563 " FROM lm_tree l1" .
1564 " JOIN lm_tree l2 ON ( l1.child = l2.parent" .
1565 " AND l1.lm_id = l2.lm_id )" .
1566 " JOIN lm_data ON ( l1.child = lm_data.obj_id )" .
1567 " WHERE (l2.lft < l1.lft" .
1568 " OR l2.rgt > l1.rgt OR l2.lft > l1.rgt OR l2.rgt < l1.lft)" .
1569 " AND l1.lm_id = " .
$ilDB->quote($this->getId(),
"integer") .
1570 " ORDER BY lm_data.create_date DESC" 1572 while ($rec =
$ilDB->fetchAssoc($set)) {
1573 $issues[] =
"Tree numbering: " . print_r($rec,
true);
1577 $set =
$ilDB->query(
"SELECT * FROM lm_tree WHERE lm_tree.lm_id = " .
$ilDB->quote($this->getId(),
"integer"));
1578 while ($node =
$ilDB->fetchAssoc($set)) {
1579 $q =
"SELECT * FROM lm_data WHERE obj_id = " .
1580 $ilDB->quote($node[
"child"],
"integer");
1581 $obj_set =
$ilDB->query($q);
1582 $obj_rec =
$ilDB->fetchAssoc($obj_set);
1584 $issues[] =
"Tree entry without data entry: " . print_r($node,
true);
1590 foreach (
$nodes as $node) {
1591 $q =
"SELECT * FROM lm_data WHERE obj_id = " .
1592 $ilDB->quote($node[
"parent"],
"integer");
1593 $obj_set =
$ilDB->query($q);
1594 $obj_rec =
$ilDB->fetchAssoc($obj_set);
1595 if ($obj_rec[
"type"] ==
"pg") {
1596 $node_data =
$tree->getNodeData($node[
"child"]);
1597 if (
$tree->isInTree($node[
"child"])) {
1598 $issues[] =
"Subtree with page parent: " . print_r($node_data,
true);
1605 $set =
$ilDB->query(
"SELECT DISTINCT l1.lm_id" .
1606 " FROM lm_tree l1" .
1607 " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )" .
1608 " JOIN lm_data ON (l1.child = lm_data.obj_id)" .
1609 " WHERE l1.child <> 1" .
1610 " AND l1.lm_id <> lm_data.lm_id" .
1611 " AND l1.lm_id = " .
$ilDB->quote($this->getId(),
"integer"));
1612 if ($rec =
$ilDB->fetchAssoc($set)) {
1613 $set =
$ilDB->query(
"SELECT DISTINCT l1.child " .
1614 " FROM lm_tree l1" .
1615 " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )" .
1616 " JOIN lm_data ON (l1.child = lm_data.obj_id)" .
1617 " WHERE l1.child <> 1" .
1618 " AND l1.lm_id <> lm_data.lm_id" .
1619 " AND l1.lm_id = " .
$ilDB->quote($this->getId(),
"integer"));
1620 include_once(
"./Modules/LearningModule/classes/class.ilLMObjectFactory.php");
1621 while ($rec =
$ilDB->fetchAssoc($set)) {
1622 $set3 =
$ilDB->queryF(
1623 "SELECT * FROM lm_tree " .
1624 " WHERE child = %s ",
1626 array($rec[
"child"])
1628 while ($rec3 =
$ilDB->fetchAssoc($set3)) {
1629 $issues[] =
"Multi-reference item: " . print_r($rec3,
true);
1635 $set =
$ilDB->queryF(
1636 "SELECT * FROM lm_data " .
1637 " WHERE lm_id = %s AND type = %s",
1638 array(
"integer",
"text"),
1639 array($this->
getId(),
"pg")
1641 while ($rec =
$ilDB->fetchAssoc($set)) {
1643 $issues[] =
"Missing COPage: " . print_r($rec,
true);
1657 public function exportXML(&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
1662 $attrs[
"Type"] =
"LearningModule";
1665 $a_xml_writer->xmlStartTag(
"ContentObject", $attrs);
1672 $expLog->write(date(
"[y-m-d H:i:s] ") .
"Start Export Structure Objects");
1674 $expLog->write(date(
"[y-m-d H:i:s] ") .
"Finished Export Structure Objects");
1677 $expLog->write(date(
"[y-m-d H:i:s] ") .
"Start Export Page Objects");
1679 $expLog->write(date(
"[y-m-d H:i:s] ") .
"Finished Export Page Objects");
1682 $expLog->write(date(
"[y-m-d H:i:s] ") .
"Start Export Media Objects");
1684 $expLog->write(date(
"[y-m-d H:i:s] ") .
"Finished Export Media Objects");
1687 $expLog->write(date(
"[y-m-d H:i:s] ") .
"Start Export File Items");
1689 $expLog->write(date(
"[y-m-d H:i:s] ") .
"Finished Export File Items");
1692 if (count($this->q_ids) > 0) {
1693 $qti_file =
fopen($a_target_dir .
"/qti.xml",
"w");
1694 include_once(
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
1696 fwrite($qti_file, $pool->questionsToXML($this->q_ids));
1702 $expLog->write(date(
"[y-m-d H:i:s] ") .
"Start Export Properties");
1704 $expLog->write(date(
"[y-m-d H:i:s] ") .
"Finished Export Properties");
1706 $a_xml_writer->xmlEndTag(
"ContentObject");
1717 include_once(
"Services/MetaData/classes/class.ilMD2XML.php");
1719 $md2xml->setExportMode(
true);
1720 $md2xml->startExport();
1721 $a_xml_writer->appendXML($md2xml->getXML());
1732 include_once
'./Modules/LearningModule/classes/class.ilStructureObject.php';
1734 $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
1735 foreach ($childs as $child) {
1736 if ($child[
"type"] !=
"st") {
1741 $structure_obj->exportXML($a_xml_writer, $a_inst, $expLog);
1742 unset($structure_obj);
1755 include_once
"./Modules/LearningModule/classes/class.ilLMPageObject.php";
1756 include_once
"./Modules/LearningModule/classes/class.ilLMPage.php";
1759 foreach ($pages as $page) {
1761 $expLog->write(date(
"[y-m-d H:i:s] ") .
"Page Object " . $page[
"obj_id"]);
1765 $page_obj->exportXML($a_xml_writer,
"normal", $a_inst);
1768 $mob_ids = $page_obj->getMediaObjectIDs();
1769 foreach ($mob_ids as $mob_id) {
1770 $this->mob_ids[$mob_id] = $mob_id;
1774 $file_ids = $page_obj->getFileItemIds();
1775 foreach ($file_ids as $file_id) {
1776 $this->file_ids[$file_id] = $file_id;
1780 $q_ids = $page_obj->getQuestionIds();
1781 foreach ($q_ids as $q_id) {
1782 $this->q_ids[$q_id] = $q_id;
1798 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1800 $linked_mobs = array();
1803 foreach ($this->mob_ids as $mob_id) {
1805 $expLog->write(date(
"[y-m-d H:i:s] ") .
"Media Object " . $mob_id);
1807 $media_obj->exportXML($a_xml_writer, $a_inst);
1808 $media_obj->exportFiles($a_target_dir);
1810 $lmobs = $media_obj->getLinkedMediaObjects($this->mob_ids);
1811 $linked_mobs = array_merge($linked_mobs, $lmobs);
1818 foreach ($linked_mobs as $mob_id) {
1820 $expLog->write(date(
"[y-m-d H:i:s] ") .
"Media Object " . $mob_id);
1822 $media_obj->exportXML($a_xml_writer, $a_inst);
1823 $media_obj->exportFiles($a_target_dir);
1835 include_once(
"./Modules/File/classes/class.ilObjFile.php");
1837 foreach ($this->file_ids as $file_id) {
1838 $expLog->write(date(
"[y-m-d H:i:s] ") .
"File Item " . $file_id);
1839 $file_obj =
new ilObjFile($file_id,
false);
1840 $file_obj->export($a_target_dir);
1852 $a_xml_writer->xmlStartTag(
"Properties", $attrs);
1855 $attrs = array(
"Name" =>
"Layout",
"Value" => $this->
getLayout());
1856 $a_xml_writer->xmlElement(
"Property", $attrs);
1859 $attrs = array(
"Name" =>
"PageHeader",
"Value" => $this->
getPageHeader());
1860 $a_xml_writer->xmlElement(
"Property", $attrs);
1863 $attrs = array(
"Name" =>
"TOCMode",
"Value" => $this->
getTOCMode());
1864 $a_xml_writer->xmlElement(
"Property", $attrs);
1867 $attrs = array(
"Name" =>
"ActiveLMMenu",
"Value" =>
1869 $a_xml_writer->xmlElement(
"Property", $attrs);
1872 $attrs = array(
"Name" =>
"ActiveNumbering",
"Value" =>
1874 $a_xml_writer->xmlElement(
"Property", $attrs);
1877 $attrs = array(
"Name" =>
"ActiveTOC",
"Value" =>
1879 $a_xml_writer->xmlElement(
"Property", $attrs);
1882 $attrs = array(
"Name" =>
"ActivePrintView",
"Value" =>
1884 $a_xml_writer->xmlElement(
"Property", $attrs);
1890 $attrs = array(
"Name" =>
"CleanFrames",
"Value" =>
1892 $a_xml_writer->xmlElement(
"Property", $attrs);
1895 $attrs = array(
"Name" =>
"PublicNotes",
"Value" =>
1897 $a_xml_writer->xmlElement(
"Property", $attrs);
1900 $attrs = array(
"Name" =>
"HistoryUserComments",
"Value" =>
1902 $a_xml_writer->xmlElement(
"Property", $attrs);
1905 $attrs = array(
"Name" =>
"Rating",
"Value" =>
1907 $a_xml_writer->xmlElement(
"Property", $attrs);
1908 $attrs = array(
"Name" =>
"RatingPages",
"Value" =>
1910 $a_xml_writer->xmlElement(
"Property", $attrs);
1914 $attrs = array(
"Name" =>
"HeaderPage",
"Value" =>
1916 $a_xml_writer->xmlElement(
"Property", $attrs);
1921 $attrs = array(
"Name" =>
"FooterPage",
"Value" =>
1923 $a_xml_writer->xmlElement(
"Property", $attrs);
1927 $attrs = array(
"Name" =>
"LayoutPerPage",
"Value" =>
1929 $a_xml_writer->xmlElement(
"Property", $attrs);
1932 $attrs = array(
"Name" =>
"ProgressIcons",
"Value" =>
1934 $a_xml_writer->xmlElement(
"Property", $attrs);
1937 $attrs = array(
"Name" =>
"StoreTries",
"Value" =>
1939 $a_xml_writer->xmlElement(
"Property", $attrs);
1942 $attrs = array(
"Name" =>
"RestrictForwardNavigation",
"Value" =>
1944 $a_xml_writer->xmlElement(
"Property", $attrs);
1947 $attrs = array(
"Name" =>
"DisableDefaultFeedback",
"Value" =>
1949 $a_xml_writer->xmlElement(
"Property", $attrs);
1951 $a_xml_writer->xmlEndTag(
"Properties");
1961 $types = array(
"xml",
"html",
"scorm");
1963 foreach ($types as
$type) {
1966 if (!@is_dir($dir)
or 1967 !is_writeable($dir)) {
1977 while ($entry = $cdir->read()) {
1978 if ($entry !=
"." and 1980 substr($entry, -4) ==
".zip" and 1981 preg_match(
"~^[0-9]{10}_{2}[0-9]+_{2}(lm_)*[0-9]+\.zip\$~", $entry)) {
1982 $file[$entry .
$type] = array(
"type" => $type,
"file" => $entry,
1983 "size" => filesize($dir .
"/" . $entry));
2005 $this->public_export_file[
$a_type] = $a_file;
2017 return $this->public_export_file[
$a_type];
2026 if (!@is_dir($dir)
or 2027 !is_writeable($dir)) {
2038 while ($entry = $dir->read()) {
2039 if ($entry !=
"." and 2041 substr($entry, -4) ==
".pdf" and 2042 preg_match(
"~^[0-9]{10}_{2}[0-9]+_{2}(lm_)*[0-9]+\.pdf\$~", $entry)) {
2070 include(
"./Modules/LearningModule/classes/class.ilLMContObjectManifestBuilder.php");
2072 $man_builder->buildManifest();
2073 $man_builder->dump($a_target_dir);
2076 copy(
"Modules/LearningModule/scorm_xsd/adlcp_rootv1p2.xsd", $a_target_dir .
"/adlcp_rootv1p2.xsd");
2077 copy(
"Modules/LearningModule/scorm_xsd/imscp_rootv1p1p2.xsd", $a_target_dir .
"/imscp_rootv1p1p2.xsd");
2078 copy(
"Modules/LearningModule/scorm_xsd/imsmd_rootv1p2p1.xsd", $a_target_dir .
"/imsmd_rootv1p2p1.xsd");
2079 copy(
"Modules/LearningModule/scorm_xsd/ims_xml.xsd", $a_target_dir .
"/ims_xml.xsd");
2083 $zip_file = $a_target_dir .
"/" . $date .
"__" . IL_INST_ID .
"__" .
2087 $a_target_dir .
"/imsmanifest.xml",
2088 $a_target_dir .
"/adlcp_rootv1p2.xsd",
2089 $a_target_dir .
"/imscp_rootv1p1p2.xsd",
2090 $a_target_dir .
"/ims_xml.xsd",
2091 $a_target_dir .
"/imsmd_rootv1p2p1.xsd"), $zip_file);
2093 $dest_file = $this->
getExportDirectory(
"scorm") .
"/" . $date .
"__" . IL_INST_ID .
"__" .
2096 rename($zip_file, $dest_file);
2104 public function exportHTML($a_target_dir,
$log, $a_zip_file =
true, $a_export_format =
"html", $a_lang =
"")
2110 $user_lang =
$ilUser->getLanguage();
2115 $mob_dir = $a_target_dir .
"/mobs";
2117 $file_dir = $a_target_dir .
"/files";
2119 $teximg_dir = $a_target_dir .
"/teximg";
2121 $style_dir = $a_target_dir .
"/style";
2123 $style_img_dir = $a_target_dir .
"/style/images";
2125 $content_style_dir = $a_target_dir .
"/content_style";
2127 $content_style_img_dir = $a_target_dir .
"/content_style/images";
2131 include_once
'./Services/MathJax/classes/class.ilMathJax.php';
2136 $style_name =
$ilUser->prefs[
"style"] .
".css";
2137 copy($location_stylesheet, $style_dir .
"/" . $style_name);
2138 $fh =
fopen($location_stylesheet,
"r");
2139 $css = fread($fh, filesize($location_stylesheet));
2140 preg_match_all(
"/url\(([^\)]*)\)/", $css,
$files);
2141 foreach (array_unique(
$files[1]) as $fileref) {
2142 $css_fileref = str_replace(array(
"'",
'"'),
"", $fileref);
2143 $fileref = dirname($location_stylesheet) .
"/" . $css_fileref;
2144 if (is_file($fileref)) {
2148 copy($fileref, $style_dir .
"/" . $css_fileref);
2156 $cont_stylesheet =
"./Services/COPage/css/content.css";
2158 $css = fread(
fopen($cont_stylesheet,
'r'), filesize($cont_stylesheet));
2159 preg_match_all(
"/url\(([^\)]*)\)/", $css,
$files);
2160 foreach (array_unique(
$files[1]) as $fileref) {
2161 $target_fileref = str_replace(
"..",
".", $fileref);
2162 $target_fileref = str_replace(
'"',
"", $target_fileref);
2163 if (is_file($target_fileref)) {
2164 copy($target_fileref, $content_style_img_dir .
"/" . basename($target_fileref));
2166 $css = str_replace($fileref,
"images/" . basename($target_fileref), $css);
2168 fwrite(
fopen($content_style_dir .
"/content.css",
'w'), $css);
2171 $style->writeCSSFile($content_style_dir .
"/content.css",
"images");
2172 $style->copyImagesToDir($content_style_img_dir);
2177 copy($syn_stylesheet, $a_target_dir .
"/syntaxhighlight.css");
2180 include_once(
"./Modules/LearningModule/classes/class.ilLMPresentationGUI.php");
2181 $_GET[
"cmd"] =
"nop";
2182 $get_transl =
$_GET[
"transl"];
2183 $_GET[
"transl"] =
"";
2185 $lm_gui->setOfflineMode(
true, ($a_lang ==
"all"));
2186 $lm_gui->setOfflineDirectory($a_target_dir);
2187 $lm_gui->setExportFormat($a_export_format);
2191 if ($a_lang !=
"all") {
2192 $langs = array($a_lang);
2194 $ot_langs = $ot->getLanguages();
2195 foreach ($ot_langs as $otl) {
2196 $langs[] = $otl[
"lang_code"];
2201 $this->offline_mobs = array();
2202 $this->offline_int_links = array();
2203 $this->offline_files = array();
2206 foreach ($langs as
$lang) {
2209 $ilUser->setCurrentLanguage($lang);
2211 $ilUser->setLanguage($user_lang);
2212 $ilUser->setCurrentLanguage($user_lang);
2216 if ($lang == $ot->getMasterLanguage()) {
2219 $lm_gui->lang =
$lang;
2225 $this->
exportHTMLPages($lm_gui, $a_target_dir, $lm_gui->lang, ($a_lang ==
"all"));
2228 $ilLocator->clearItems();
2234 $lm_gui->tpl =
$tpl;
2235 $content = $lm_gui->showTableOfContents();
2237 if ($a_lang ==
"all") {
2238 $file = $a_target_dir .
"/table_of_contents_" . $lang .
".html";
2240 $file = $a_target_dir .
"/table_of_contents.html";
2244 if (!($fp = @
fopen($file,
"w+"))) {
2245 die(
"<b>Error</b>: Could not open \"" . $file .
"\" for writing" .
2246 " in <b>" . __FILE__ .
"</b> on line <b>" . __LINE__ .
"</b><br />");
2249 fwrite($fp, $content);
2258 $linked_mobs = array();
2259 foreach ($this->offline_mobs as $mob) {
2261 $this->
exportHTMLMOB($a_target_dir, $lm_gui, $mob,
"_blank", $linked_mobs);
2264 $linked_mobs2 = array();
2265 foreach ($linked_mobs as $mob) {
2267 $this->
exportHTMLMOB($a_target_dir, $lm_gui, $mob,
"_blank", $linked_mobs2);
2270 $_GET[
"obj_type"] =
"MediaObject";
2271 $_GET[
"obj_id"] = $a_mob_id;
2275 foreach ($this->offline_files as $file) {
2280 if (count($this->q_ids) > 0) {
2281 foreach ($this->q_ids as $q_id) {
2285 $a_target_dir .
"/assessment/0/" . $q_id .
"/images" 2291 $image_dir = $a_target_dir .
"/images";
2296 $image_dir .
"/enlarge.svg" 2300 $image_dir .
"/browser/plus.png" 2304 $image_dir .
"/browser/minus.png" 2308 $image_dir .
"/browser/blank.png" 2312 $image_dir .
"/spacer.png" 2316 $image_dir .
"/icon_st.svg" 2320 $image_dir .
"/icon_pg.svg" 2324 $image_dir .
"/icon_lm.svg" 2328 $image_dir .
"/nav_arr_L.png" 2332 $image_dir .
"/nav_arr_R.png" 2336 $services_dir = $a_target_dir .
"/Services";
2338 $media_service_dir = $services_dir .
"/MediaObjects";
2340 include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
2343 $mp3_dir = $media_service_dir .
"/flash_mp3_player";
2348 include_once(
"./Services/UIComponent/Explorer2/classes/class.ilExplorerBaseGUI.php");
2356 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
2357 foreach (self::getSupplyingExportFiles($a_target_dir) as
$f) {
2358 if ($f[
"source"] !=
"") {
2360 copy($f[
"source"], $f[
"target"]);
2365 $tpl->setVariable(
"LOCATION_STYLESHEET", $location_stylesheet);
2366 $tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
2368 if ($a_lang !=
"") {
2369 $ilUser->setLanguage($user_lang);
2370 $ilUser->setCurrentLanguage($user_lang);
2375 if ($a_lang ==
"") {
2384 $zip_file = $zip_target_dir .
"/" . $date .
"__" . IL_INST_ID .
"__" .
2400 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
2401 include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
2402 include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
2403 include_once(
"./Services/UIComponent/Explorer2/classes/class.ilExplorerBaseGUI.php");
2406 "target" => $a_target_dir .
'/js/yahoo/yahoo-min.js',
2409 "target" => $a_target_dir .
'/js/yahoo/yahoo-dom-event.js',
2412 "target" => $a_target_dir .
'/js/yahoo/animation-min.js',
2414 array(
"source" =>
'./Services/JavaScript/js/Basic.js',
2415 "target" => $a_target_dir .
'/js/Basic.js',
2417 array(
"source" =>
'./Services/Accordion/js/accordion.js',
2418 "target" => $a_target_dir .
'/js/accordion.js',
2420 array(
"source" =>
'./Services/Accordion/css/accordion.css',
2421 "target" => $a_target_dir .
'/css/accordion.css',
2424 "target" => $a_target_dir .
'/js/jquery.js',
2427 "target" => $a_target_dir .
'/js/maphilight.js',
2430 "target" => $a_target_dir .
'/js/jquery-ui-min.js',
2432 array(
"source" =>
'./Services/COPage/js/ilCOPagePres.js',
2433 "target" => $a_target_dir .
'/js/ilCOPagePres.js',
2435 array(
"source" =>
'./Modules/Scorm2004/scripts/questions/pure.js',
2436 "target" => $a_target_dir .
'/js/pure.js',
2438 array(
"source" =>
'./Modules/Scorm2004/scripts/questions/question_handling.js',
2439 "target" => $a_target_dir .
'/js/question_handling.js',
2441 array(
"source" =>
'./Modules/TestQuestionPool/js/ilMatchingQuestion.js',
2442 "target" => $a_target_dir .
'/js/ilMatchingQuestion.js',
2444 array(
"source" =>
'./Modules/Scorm2004/templates/default/question_handling.css',
2445 "target" => $a_target_dir .
'/css/question_handling.css',
2447 array(
"source" =>
'./Modules/TestQuestionPool/templates/default/test_javascript.css',
2448 "target" => $a_target_dir .
'/css/test_javascript.css',
2450 array(
"source" =>
'./Modules/TestQuestionPool/js/ilAssMultipleChoice.js',
2451 "target" => $a_target_dir .
'/js/ilAssMultipleChoice.js',
2468 array(
"source" =>
'./Modules/LearningModule/js/LearningModule.js',
2469 "target" => $a_target_dir .
'/js/LearningModule.js',
2476 $scripts[] = array(
"source" =>
"",
2482 include_once(
"./Services/Link/classes/class.ilLinkifyUtil.php");
2484 if (is_int(strpos($p,
"ExtLink"))) {
2485 $scripts[] = array(
"source" => $p,
2486 "target" => $a_target_dir .
'/js/ilExtLink.js',
2489 if (is_int(strpos($p,
"linkify.min.js"))) {
2490 $scripts[] = array(
"source" => $p,
2491 "target" => $a_target_dir .
'/js/linkify.min.js',
2494 if (is_int(strpos($p,
"linkify-jquery.min.js"))) {
2495 $scripts[] = array(
"source" => $p,
2496 "target" => $a_target_dir .
'/js/linkify-jquery.min.js',
2509 $file_dir = $a_target_dir .
"/files/file_" . $a_file_id;
2511 include_once(
"./Modules/File/classes/class.ilObjFile.php");
2512 $file_obj =
new ilObjFile($a_file_id,
false);
2513 $source_file = $file_obj->getDirectory($file_obj->getVersion()) .
"/" . $file_obj->getFileName();
2514 if (!is_file($source_file)) {
2515 $source_file = $file_obj->getDirectory() .
"/" . $file_obj->getFileName();
2517 if (is_file($source_file)) {
2518 copy($source_file, $file_dir .
"/" . $file_obj->getFileName());
2525 public function exportHTMLMOB($a_target_dir, &$a_lm_gui, $a_mob_id, $a_frame, &$a_linked_mobs)
2529 $mob_dir = $a_target_dir .
"/mobs";
2532 if (@is_dir($source_dir)) {
2538 $tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
2539 $_GET[
"obj_type"] =
"MediaObject";
2540 $_GET[
"mob_id"] = $a_mob_id;
2541 $_GET[
"frame"] = $a_frame;
2543 $content = $a_lm_gui->media();
2544 $file = $a_target_dir .
"/media_" . $a_mob_id .
".html";
2547 if (!($fp = @
fopen($file,
"w+"))) {
2548 die(
"<b>Error</b>: Could not open \"" . $file .
"\" for writing" .
2549 " in <b>" . __FILE__ .
"</b> on line <b>" . __LINE__ .
"</b><br />");
2552 fwrite($fp, $content);
2556 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2558 if ($mob_obj->hasFullscreenItem()) {
2560 $tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
2561 $_GET[
"obj_type"] =
"";
2562 $_GET[
"frame"] =
"";
2563 $_GET[
"mob_id"] = $a_mob_id;
2564 $_GET[
"cmd"] =
"fullscreen";
2565 $content = $a_lm_gui->fullscreen();
2566 $file = $a_target_dir .
"/fullscreen_" . $a_mob_id .
".html";
2569 if (!($fp = @
fopen($file,
"w+"))) {
2570 die(
"<b>Error</b>: Could not open \"" . $file .
"\" for writing" .
2571 " in <b>" . __FILE__ .
"</b> on line <b>" . __LINE__ .
"</b><br />");
2574 fwrite($fp, $content);
2577 $linked_mobs = $mob_obj->getLinkedMediaObjects();
2578 foreach ($linked_mobs as
$id) {
2582 $a_linked_mobs = array_merge($a_linked_mobs, $linked_mobs);
2592 foreach ($this->offline_int_links as $int_link) {
2593 $ilLocator->clearItems();
2594 if ($int_link[
"type"] ==
"git") {
2596 $tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
2598 $_GET[
"obj_id"] = $int_link[
"id"];
2599 $_GET[
"frame"] =
"_blank";
2600 $content = $a_lm_gui->glossary();
2601 $file = $a_target_dir .
"/term_" . $int_link[
"id"] .
".html";
2604 if (!($fp = @
fopen($file,
"w+"))) {
2605 die(
"<b>Error</b>: Could not open \"" . $file .
"\" for writing" .
2606 " in <b>" . __FILE__ .
"</b> on line <b>" . __LINE__ .
"</b><br />");
2609 fwrite($fp, $content);
2613 include_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
2615 foreach ($defs as
$def) {
2617 foreach ($def_mobs as $def_mob) {
2618 $this->offline_mobs[$def_mob] = $def_mob;
2619 include_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
2626 $this->offline_files = array_merge($this->offline_files, $def_files);
2635 public function exportHTMLPages(&$a_lm_gui, $a_target_dir, $a_lang =
"", $a_all_languages =
false)
2643 $this->first_page_id = $first_page[
"child"];
2647 $int_links = array();
2648 $this->offline_files = array();
2650 include_once(
"./Services/COPage/classes/class.ilPageContentUsage.php");
2651 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2655 $exp_id_map = array();
2657 if (
$lm_set->get(
"html_export_ids")) {
2658 foreach ($pages as $page) {
2660 if (trim($exp_id) !=
"") {
2661 $exp_id_map[$page[
"obj_id"]] = trim($exp_id);
2666 if ($a_lang ==
"") {
2671 foreach ($pages as $page) {
2673 $ilLocator->clearItems();
2686 foreach ($pcs as $pc) {
2687 if ($pc[
"type"] ==
"incl") {
2689 foreach ($incl_mobs as $incl_mob) {
2690 $mobs[$incl_mob] = $incl_mob;
2691 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
2692 $this->log->debug(
"HTML Export: Add media object $incl_mob (" .
ilObject::_lookupTitle($incl_mob) .
") " .
2693 " due to snippet " . $pc[
"id"] .
" in page " . $page[
"obj_id"] .
" (" .
ilLMObject::_lookupTitle($page[
"obj_id"]) .
").");
2700 foreach ($pg_mobs as $pg_mob) {
2701 $mobs[$pg_mob] = $pg_mob;
2702 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
2709 $int_links = array_merge($int_links, $pg_links);
2712 include_once(
"./Modules/File/classes/class.ilObjFile.php");
2714 $this->offline_files = array_merge($this->offline_files, $pg_files);
2717 include_once(
"./Services/COPage/classes/class.ilPCQuestion.php");
2719 foreach ($q_ids as $q_id) {
2720 $this->q_ids[$q_id] = $q_id;
2725 $this->offline_mobs[
$m] =
$m;
2727 foreach ($int_links as $k => $v) {
2728 $this->offline_int_links[$k] = $v;
2742 $a_exp_id_map = array(),
2744 $a_all_languages =
false 2749 if ($a_lang !=
"-" && $a_lang !=
"" && $a_all_languages) {
2750 $lang_suffix =
"_" . $a_lang;
2756 $tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
2758 include_once(
"./Services/COPage/classes/class.ilPCQuestion.php");
2761 $_GET[
"obj_id"] = $a_lm_page_id;
2762 $_GET[
"frame"] = $a_frame;
2764 if ($a_frame ==
"") {
2766 if (is_array($a_exp_id_map) && isset($a_exp_id_map[$a_lm_page_id])) {
2767 $file = $a_target_dir .
"/lm_pg_" . $a_exp_id_map[$a_lm_page_id] . $lang_suffix .
".html";
2769 $file = $a_target_dir .
"/lm_pg_" . $a_lm_page_id . $lang_suffix .
".html";
2772 if ($a_frame !=
"toc") {
2773 $file = $a_target_dir .
"/frame_" . $a_lm_page_id .
"_" . $a_frame . $lang_suffix .
".html";
2775 $file = $a_target_dir .
"/frame_" . $a_frame . $lang_suffix .
".html";
2780 if (@is_file($file)) {
2784 $content = $a_lm_gui->layout(
"main.xml",
false);
2787 if (!($fp = @
fopen($file,
"w+"))) {
2788 die(
"<b>Error</b>: Could not open \"" . $file .
"\" for writing" .
2789 " in <b>" . __FILE__ .
"</b> on line <b>" . __LINE__ .
"</b><br />");
2796 fwrite($fp, $content);
2801 if ($this->first_page_id == $a_lm_page_id && $a_frame ==
"") {
2802 copy($file, $a_target_dir .
"/index" . $lang_suffix .
".html");
2806 $frameset = $a_lm_gui->getCurrentFrameSet();
2808 foreach ($frameset as $frame) {
2809 $this->
exportPageHTML($a_lm_gui, $a_target_dir, $a_lm_page_id, $frame);
2819 public function exportFO(&$a_xml_writer, $a_target_dir)
2823 $attrs[
"xmlns:fo"] =
"http://www.w3.org/1999/XSL/Format";
2824 $a_xml_writer->xmlStartTag(
"fo:root", $attrs);
2828 $a_xml_writer->xmlStartTag(
"fo:layout-master-set", $attrs);
2832 $attrs[
"master-name"] =
"DinA4";
2833 $attrs[
"page-height"] =
"29.7cm";
2834 $attrs[
"page-width"] =
"21cm";
2835 $attrs[
"margin-top"] =
"4cm";
2836 $attrs[
"margin-bottom"] =
"1cm";
2837 $attrs[
"margin-left"] =
"2.8cm";
2838 $attrs[
"margin-right"] =
"7.3cm";
2839 $a_xml_writer->xmlStartTag(
"fo:simple-page-master", $attrs);
2843 $attrs[
"margin-top"] =
"0cm";
2844 $attrs[
"margin-bottom"] =
"1.25cm";
2845 $a_xml_writer->xmlElement(
"fo:region-body", $attrs);
2849 $attrs[
"extent"] =
"1cm";
2850 $a_xml_writer->xmlElement(
"fo:region-before", $attrs);
2854 $attrs[
"extent"] =
"1cm";
2855 $a_xml_writer->xmlElement(
"fo:region-after", $attrs);
2858 $a_xml_writer->xmlEndTag(
"fo:simple-page-master");
2861 $a_xml_writer->xmlEndTag(
"fo:layout-master-set");
2865 $attrs[
"master-reference"] =
"DinA4";
2866 $a_xml_writer->xmlStartTag(
"fo:page-sequence", $attrs);
2870 $attrs[
"flow-name"] =
"xsl-region-body";
2871 $a_xml_writer->xmlStartTag(
"fo:flow", $attrs);
2878 $a_xml_writer->xmlEndTag(
"fo:flow");
2881 $a_xml_writer->xmlEndTag(
"fo:page-sequence");
2884 $a_xml_writer->xmlEndTag(
"fo:root");
2895 $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
2896 foreach ($childs as $child) {
2897 if ($child[
"type"] !=
"st") {
2902 $structure_obj->exportFO($a_xml_writer, $expLog);
2903 unset($structure_obj);
2909 include_once(
"./Modules/LearningModule/classes/class.ilContObjectExport.php");
2913 $export_file = $cont_exp->buildExportFile();
2914 return $export_file;
2928 $lmtree->setTableNames(
'lm_tree',
'lm_data');
2929 $lmtree->setTreeTablePK(
"lm_id");
2932 $source_obj->setLMId($this->
getId());
2934 if (!$first_child) {
2936 $target_obj->setLMId($this->
getId());
2937 $target_parent = $lmtree->getParentId(
$target_id);
2941 if ($source_obj->getType() ==
"pg") {
2943 if ($lmtree->isInTree($source_obj->getId())) {
2944 $node_data = $lmtree->getNodeData($source_obj->getId());
2947 if ($movecopy ==
"move") {
2948 $parent_id = $lmtree->getParentId($source_obj->getId());
2949 $lmtree->deleteTree($node_data);
2952 require_once(
"./Services/History/classes/class.ilHistory.php");
2954 $source_obj->getId(),
2967 $new_page = $source_obj->copy();
2968 $source_id = $new_page->getId();
2969 $source_obj = $new_page;
2973 if (!$lmtree->isInTree($source_obj->getId())) {
2977 } elseif ($as_subitem) {
2980 $pg_childs = $lmtree->getChildsByType($parent,
"pg");
2981 if (count($pg_childs) != 0) {
2982 $target_pos = $pg_childs[count($pg_childs) - 1][
"obj_id"];
2986 $parent = $target_parent;
2990 $lmtree->insertNode(
2991 $source_obj->getId(),
2997 if ($movecopy ==
"move") {
2999 include_once(
"./Services/History/classes/class.ilHistory.php");
3001 $source_obj->getId(),
3018 if ($source_obj->getType() ==
"st") {
3020 $source_node = $lmtree->getNodeData($source_id);
3021 $subnodes = $lmtree->getSubtree($source_node);
3024 foreach ($subnodes as $subnode) {
3036 $pg_childs = $lmtree->getChildsByType($target_parent,
"pg");
3037 if (count($pg_childs) != 0) {
3038 $target_pos = $pg_childs[count($pg_childs) - 1][
"obj_id"];
3040 } elseif ($as_subitem) {
3043 $childs = $lmtree->getChilds($target_parent);
3044 if (count($childs) != 0) {
3045 $target_pos = $childs[count($childs) - 1][
"obj_id"];
3070 if ($movecopy ==
"move") {
3071 $lmtree->deleteTree($source_node);
3074 $new_chapter = $source_obj->copy($lmtree, $target_parent, $target_pos);
3077 if (!$lmtree->isInTree($source_id)) {
3078 $lmtree->insertNode($source_id, $target_parent, $target_pos);
3081 if ($movecopy ==
"move") {
3082 foreach ($subnodes as $node) {
3083 if ($node[
"obj_id"] != $source_id) {
3084 $lmtree->insertNode($node[
"obj_id"], $node[
"parent"]);
3102 include_once
"./Modules/LearningModule/classes/class.ilLMPageObject.php";
3103 include_once
"./Modules/LearningModule/classes/class.ilLMPage.php";
3108 foreach ($pages as $page) {
3110 $cpage =
new ilLMPage($page[
"obj_id"]);
3112 $error = @$cpage->validateDom();
3115 $this->lng->loadLanguageModule(
"content");
3119 $mess .= $this->lng->txt(
"obj_pg") .
": " .
$title;
3120 $mess .=
'<div class="small">';
3122 $err_mess = implode($e,
" - ");
3123 if (!is_int(strpos($err_mess,
":0:"))) {
3124 $mess .= htmlentities($err_mess) .
"<br />";
3146 $a_import_into_help_module = 0
3154 $file = pathinfo($a_filename);
3157 ilUtil::moveUploadedFile(
3166 $subdir = basename($file[
"basename"],
"." . $file[
"extension"]);
3193 $this->log->debug(
"import from directory " . $a_directory);
3196 $subdir = basename($a_directory);
3197 $xml_file = $a_directory .
"/" . $subdir .
".xml";
3200 if (!is_dir($a_directory)) {
3201 $this->log->error(sprintf(
$lng->txt(
"cont_no_subdir_in_zip"), $subdir));
3202 return sprintf(
$lng->txt(
"cont_no_subdir_in_zip"), $subdir);
3206 if (!is_file($xml_file)) {
3207 $this->log->error(sprintf(
$lng->txt(
"cont_zip_file_invalid"), $subdir .
"/" . $subdir .
".xml"));
3208 return sprintf(
$lng->txt(
"cont_zip_file_invalid"), $subdir .
"/" . $subdir .
".xml");
3212 $this->log->debug(
"import qti");
3213 $qti_file = $a_directory .
"/qti.xml";
3215 if (is_file($qti_file)) {
3216 include_once
"./Services/QTI/classes/class.ilQTIParser.php";
3217 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
3224 $result = $qtiParser->startParsing();
3225 $founditems = &$qtiParser->getFoundItems();
3227 if (count($founditems) > 0) {
3229 $qtiParser->setTestObject($testObj);
3230 $result = $qtiParser->startParsing();
3231 $qtis = array_merge($qtis, $qtiParser->getImportMapping());
3235 $this->log->debug(
"get ilContObjParser");
3236 include_once(
"./Modules/LearningModule/classes/class.ilContObjParser.php");
3238 $contParser =
new ilContObjParser($this, $xml_file, $subdir, $a_directory);
3240 $contParser->setImportMapping($a_mapping);
3241 $contParser->setQuestionMapping($qtis);
3242 $contParser->startParsing();
3247 $style_file = $a_directory .
"/style.xml";
3248 $style_zip_file = $a_directory .
"/style.zip";
3249 if (is_file($style_zip_file)) {
3250 require_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
3252 $style->import($style_zip_file);
3254 } elseif (is_file($style_file)) {
3255 require_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
3257 $style->import($style_file);
3268 include_once(
"./Modules/LearningModule/classes/class.ilLMPage.php");
3287 public function cloneObject($a_target_id, $a_copy_id = 0, $a_omit_tree =
false)
3289 $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
3296 if (!$cp_options->isRootNode($this->getRefId())) {
3303 $new_obj->setLayout($this->
getLayout());
3317 $new_obj->setRating($this->
hasRating());
3327 $new_obj->createLMTree();
3330 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
3335 $new_id = $style_obj->ilClone();
3336 $new_obj->setStyleSheetId($new_id);
3347 $new_obj->setHeaderPage($new_page_header);
3350 $new_obj->setFooterPage($new_page_footer);
3355 include_once(
'Services/Tracking/classes/class.ilLPObjSettings.php');
3357 $obj_settings->cloneSettings($new_obj->getId());
3358 unset($obj_settings);
3361 include_once(
"./Services/Object/classes/class.ilObjectTranslation.php");
3363 $ot->copy($new_obj->getId());
3366 include_once
'./Modules/LearningModule/classes/class.ilLMMenuEditor.php';
3368 $menu->setObjId($this->
getId());
3370 $new_menu->setObjId($new_obj->getId());
3371 foreach ($menu->getMenuEntries() as $entry) {
3379 $new_menu->setTarget($entry[
"link"]);
3380 $new_menu->setTitle($entry[
"title"]);
3381 $new_menu->setLinkType($entry[
"type"]);
3382 $new_menu->setLinkRefId($entry[
"ref_id"]);
3383 $new_menu->create();
3398 $parent_id = $a_target_obj->lm_tree->readRootId();
3400 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
3401 include_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
3404 $chapters = $this->lm_tree->getChildsByType($this->lm_tree->readRootId(),
"st");
3405 $copied_nodes = array();
3407 foreach ($chapters as $chap) {
3423 foreach ($pages as $p) {
3424 if (!$this->lm_tree->isInTree($p[
"obj_id"])) {
3426 $target_item = $item->copy($a_target_obj);
3427 $copied_nodes[$item->getId()] = $target_item->getId();
3432 include_once
'./Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
3434 foreach ($copied_nodes as $old_id => $new_id) {
3437 $a_target_obj->getRefId() .
'_' . $new_id
3443 $a_target_obj->checkTree();
3445 return $copied_nodes;
3459 $ilDB = $DIC->database();
3462 $set =
$ilDB->query(
3463 "SELECT * FROM lm_glossaries " .
3464 " WHERE lm_id = " .
$ilDB->quote($a_lm_id,
"integer")
3467 while ($rec =
$ilDB->fetchAssoc($set)) {
3468 $glos[] = $rec[
"glo_id"];
3482 include_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
3486 include_once(
"./Modules/LearningModule/classes/class.ilLMPage.php");
3490 $found_pages = array();
3491 foreach ($pages as $p) {
3493 $c = $pg->getXMLContent();
3494 foreach ($terms as
$t) {
3495 if (is_int(stripos(
$c, $t[
"term"]))) {
3496 $found_pages[$p[
"id"]][
"terms"][] =
$t;
3497 if (!is_object($found_pages[$p[
"id"]][
"page"])) {
3498 $found_pages[$p[
"id"]][
"page"] = $pg;
3506 include_once(
"./Services/COPage/classes/class.ilPCParagraph.php");
3507 foreach ($found_pages as
$id => $fp) {
3524 if (!$a_as_obj_id && $a_id > 0 && $a_id == OH_REF_ID) {
3535 $this->rating = (bool) $a_value;
3545 $this->rating_pages = (bool) $a_value;
3556 parent::MDUpdateListener($a_element);
3558 include_once
'Services/MetaData/classes/class.ilMD.php';
3560 switch ($a_element) {
3562 include_once(
"./Services/Object/classes/class.ilObjectLP.php");
3565 $obj_lp->getCurrentMode(),
3568 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
3577 if (!is_object($md_gen = $md->getGeneral())) {
3581 include_once(
"./Services/Object/classes/class.ilObjectTranslation.php");
3583 if ($ot->getContentActivated()) {
3584 $ot->setDefaultTitle($md_gen->getTitle());
3586 foreach ($md_gen->getDescriptionIds() as
$id) {
3587 $md_des = $md_gen->getDescription(
$id);
3588 $ot->setDefaultDescription($md_des->getDescription());
3606 $dirs = array(
"xml",
"scorm");
3607 $export_files = array();
3609 include_once(
"./Services/Object/classes/class.ilObjectTranslation.php");
3611 if ($ot->getContentActivated()) {
3612 $langs = $ot->getLanguages();
3613 foreach ($langs as
$l => $ldata) {
3614 $dirs[] =
"html_" .
$l;
3616 $dirs[] =
"html_all";
3621 foreach ($dirs as $dir) {
3622 $type = explode(
"_", $dir);
3629 $export_files[] = array(
"type" =>
$type,
3637 return $export_files;
getHideHeaderFooterPrint()
Get hide header footer in print mode.
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
static makeDirParents($a_dir)
Create a new directory and all parent directories.
static _getMissingPreconditionsTopChapter($cont_obj_ref_id, $cont_obj_id, $page_id)
get top chapter of page for that any precondition is missing
static _lookupContObjIdByStyleId($a_style_id)
lookup style sheet ID
static tf2yn($a_tf)
convert true/false to "y"/"n"
static _lookupDisableDefaultFeedback($a_id)
Lookup disable default feedback.
exportHTMLGlossaryTerms(&$a_lm_gui, $a_target_dir)
export glossary terms
static updateInternalLinks($a_copied_nodes, $a_parent_type="lm")
Update internal links, after multiple pages have been copied.
static getDefinitionList($a_term_id)
static
read()
read data of content object
getStyleSheetId()
get ID of assigned style sheet object
static _getNrLMsNoStyle()
get number of learning modules assigned no style
static _lookupStyleSheetId($a_cont_obj_id)
lookup style sheet ID
getExportDirectory($a_type="xml")
get export directory of lm
create($a_no_meta_data=false)
create content object
setPublicExportFile($a_type, $a_file)
specify public export file for type
static commentsActivated($a_rep_obj_id, $a_obj_id, $a_obj_type, $a_news_id=0)
Are comments activated for object?
__construct($a_id=0, $a_call_by_reference=true)
Constructor public.
static _getQuestionIdsForPage($a_parent_type, $a_page_id, $a_lang="-")
Get all questions of a page.
setTOCMode($a_toc_mode="chapters")
set toc mode
checkStructure()
Check tree (this has been copied from fixTree due to a bug fixing, should be reorganised) ...
exportFO(&$a_xml_writer, $a_target_dir)
export object to fo
setPublicNotes($a_pub_notes)
validatePages()
Validate all pages.
exportFileItems($a_target_dir, &$expLog)
export files of file itmes
setImportDirectory($a_import_dir)
Set import directory for further use in ilContObjParser.
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
exportHTML($a_target_dir, $log, $a_zip_file=true, $a_export_format="html", $a_lang="")
export html package
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
isActiveHistoryUserComments()
exportXMLPageObjects(&$a_xml_writer, $a_inst, &$expLog)
export page objects to xml (see ilias_co.dtd)
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
isActivePreventGlossaryAppendix()
static _getNrOfAssignedLMs($a_style_id)
gets the number of learning modules assigned to a content style
getLayout()
get default page layout of content object (see directory layouts/)
getStoreTries()
Get store tries.
static hasSuccessorPage($a_cont_obj_id, $a_page_id)
checks if page has a successor page
updateMetaData()
update meta data entry
static getLocaljQueryUIPath()
createLMTree()
create content object tree (that stores structure object hierarchie)
static getLocalJsPaths()
Get paths of necessary js files.
executeDragDrop($source_id, $target_id, $first_child, $as_subitem=false, $movecopy="move")
Execute Drag Drop Action.
static _checkPreconditionsOfPage($cont_ref_id, $cont_obj_id, $page_id)
checks wether the preconditions of a page are fulfilled or not
static writeHeaderPage($a_lm_id, $a_page_id)
Write header page.
getImportDirectory()
get import directory of lm
getExportFiles()
get export files
getOfflineStatus()
Get offline status.
static _checkCondition($condition, $a_usr_id=0)
checks wether a single condition is fulfilled every trigger object type must implement a static metho...
Content Object (ILIAS native learning module / digilib book) Manifest export class.
static getAvailableLayouts()
get all available lm layouts
setActiveNumbering($a_num)
setLayoutPerPage($a_val)
Set layout per page.
createMetaData()
create meta data entry
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file
getOfflineFiles($dir)
get offline files
static writeFooterPage($a_lm_id, $a_page_id)
Write footer page.
static getAllPages($a_parent_type, $a_parent_id, $a_lang="-")
Get all pages for parent object.
getPublicExportFile($a_type)
get public export file
static _lookupTitle($a_id)
lookup object title
Export class for content objects.
exportHTMLFile($a_target_dir, $a_file_id)
export file object
const LP_MODE_COLLECTION_TLT
static _deleteStyleAssignments($a_style_id)
delete all style references to style
isActiveDownloadsPublic()
setDisableDefaultFeedback($a_val)
Set disable default feedback for questions.
setStyleSheetId($a_style_id)
set ID of assigned style sheet object
static _refreshStatus($a_obj_id, $a_users=null)
Set dirty.
getAutoGlossaries()
Get auto glossaries.
removeAutoGlossary($a_glo_id)
Remove auto glossary.
static _lookupTitle($a_obj_id)
Lookup title.
MDUpdateListener($a_element)
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.
exportPageHTML(&$a_lm_gui, $a_target_dir, $a_lm_page_id, $a_frame="", $a_exp_id_map=array(), $a_lang="-", $a_all_languages=false)
export page html
writeStyleSheetId($a_style_id)
write ID of assigned style sheet object to db
getPublicAccessMode()
get public access mode ("complete" | "selected")
static getLocalJsTreeJsPath()
Get local path of jsTree js.
exportXMLMetaData(&$a_xml_writer)
export content objects meta data to xml (see ilias_co.dtd)
autoLinkGlossaryTerms($a_glo_ref_id)
Auto link glossary terms.
exportFOStructureObjects(&$a_xml_writer)
export structure objects to fo
static getLocalMediaElementCssPath()
Get local path of jQuery file.
static _lookupStandard($a_id)
Lookup standard flag.
setActiveLMMenu($a_act_lm_menu)
setActiveDownloadsPublic($a_down)
static _moveLMStyles($a_from_style, $a_to_style)
move learning modules from one style to another
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Class ilLMPresentationGUI.
exportXMLMediaObjects(&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
export media objects to xml (see ilias_co.dtd)
static autoLinkGlossariesPage($a_page, $a_terms)
Auto link glossary of whole page.
setTitle($a_title)
set title of content object
static getUsagesOfPage($a_usage_id, $a_usage_type, $a_hist_nr=0, $a_all_hist_nrs=false, $a_lang="-")
Get page content usages for page.
createExportDirectory($a_type="xml")
creates data directory for export files (data_dir/lm_data/lm_<id>/export, depending on data directory...
addFirstChapterAndPage()
Add first chapter and page.
getLayoutPerPage()
Get layout per page.
setRestrictForwardNavigation($a_val)
Set restrict forward navigation.
getForTranslation()
Get for translation.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
update()
update complete object (meta data and properties)
getProgressIcons()
Get progress icons.
static createHTMLExportDirs($a_target_dir)
Create html export directories.
foreach($_POST as $key=> $value) $res
getPageHeader()
get page header mode (IL_CHAPTER_TITLE | IL_PAGE_TITLE | IL_NO_HEADER)
getId()
get object id public
exportHTMLMOB($a_target_dir, &$a_lm_gui, $a_mob_id, $a_frame, &$a_linked_mobs)
export media object to html
setActivePrintView($a_print)
static _deleteAllObjectData(&$a_cobj)
delete all objects of content object (digi book / learning module)
updateAutoGlossaries()
Update auto glossaries.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
setActiveDownloads($a_down)
static getLocalMediaElementJsPath()
Get local path of jQuery file.
getPublicExportFiles()
Get public export files.
exportXMLStructureObjects(&$a_xml_writer, $a_inst, &$expLog)
export structure objects to xml (see ilias_co.dtd)
exportXMLProperties($a_xml_writer, &$expLog)
export properties of content object
readProperties()
read content object properties
static _lookupObjId($a_id)
static getLocalExplorerJsPath()
Get local path of explorer js.
getTOCMode()
get toc mode ("chapters" | "pages")
special template class to simplify handling of ITX/PEAR
updateProperties()
Update content object properties.
setPageHeader($a_pg_header=IL_CHAPTER_TITLE)
set page header mode
static putInTree($a_obj, $a_parent_id="", $a_target_node_id="")
put this object into content object tree
& getLMTree()
get content object tree
static getInstance(&$a_content_obj, $a_id=0, $a_halt=true)
static getFlashVideoPlayerDirectory()
Get flash video player directory.
putInTree($a_parent)
put content object in main tree
static lookupAutoGlossaries($a_lm_id)
Lookup auto glossaries.
static getTermList( $a_glo_ref_id, $searchterm="", $a_first_letter="", $a_def="", $a_tax_node=0, $a_add_amet_fields=false, array $a_amet_filter=null, $a_include_references=false)
Get all terms for given set of glossary ids.
cloneMetaData($target_obj)
Copy meta data.
static _checkAllConditionsOfTarget($a_target_ref_id, $a_target_id, $a_target_type="", $a_usr_id=0)
checks wether all conditions of a target object are fulfilled
setProgressIcons($a_val)
Set progress icons.
setPublicAccessMode($a_mode)
exportSCORM($a_target_dir, $log)
export scorm package
static getExportId($a_lm_id, $a_lmobj_id, $a_type="pg")
Get export ID.
static _handleImportRepositoryLinks($a_rep_import_id, $a_rep_type, $a_rep_ref_id)
Change targest of repository links.
static getSyntaxStylePath()
get syntax style path
static _getTargetsOfSource($a_source_type, $a_source_id, $a_source_lang="-")
Get all targets of a source object (e.g., a page)
importFromZipFile( $a_tmp_file, $a_filename, $a_validate=true, $a_import_into_help_module=0)
Import lm from zip file.
getDisableDefaultFeedback()
Get disable default feedback for questions.
getDataDirectory()
get data directory
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
getType()
get object type public
static _getFilesOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_usage_lang="-")
get all files of an object
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
static _lookupType($a_id, $a_reference=false)
lookup object type
createImportDirectory()
creates data directory for import files (data_dir/lm_data/lm_<id>/import, depending on data directory...
static getSupplyingExportFiles($a_target_dir=".")
Get supplying export files.
static _lookup($a_obj_id, $a_field)
Lookup property.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static _getMissingPreconditionsOfPage($cont_ref_id, $cont_obj_id, $page_id)
gets all missing preconditions of page
static isOnlineHelpModule($a_id, $a_as_obj_id=false)
Is module an online module.
copyAllPagesAndChapters($a_target_obj, $a_copy_id=0)
Copy all pages and chapters.
update($pash, $contents, Config $config)
importFromDirectory($a_directory, $a_validate=true, $a_mapping=null)
Import lm from directory.
static getLocalPath($a_name="")
Get local path of a YUI js file.
static resetInitialState()
Reset initial state (for exports)
static getDataDir()
get data directory (outside webspace)
getRestrictForwardNavigation()
Get restrict forward navigation.
static getInstance()
Singleton: get instance.
exportHTMLPages(&$a_lm_gui, $a_target_dir, $a_lang="", $a_all_languages=false)
export all pages of learning module to html file
static activateComments($a_rep_obj_id, $a_obj_id, $a_obj_type, $a_activate=true)
Activate notes feature.
setOfflineStatus($a_status)
Set offline status.
static _writeImportId($a_obj_id, $a_import_id)
write import id to db (static)
static _lookupRestrictForwardNavigation($a_obj_id)
Lookup forward restriction navigation.
static _lookupStoreTries($a_id)
Lookup disable default feedback.
static copyPlayerFilesToTargetDirectory($a_target_dir)
Copy css files to target dir.
setLayout($a_layout)
set default page layout
setActivePreventGlossaryAppendix($a_print)
static getInstance($a_obj_id)
Get instance.
static _getNrLMsIndividualStyles()
get number of learning modules with individual styles
setHideHeaderFooterPrint($a_val)
Set hide header footer in print mode.
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
getTitle()
get title of content object
getRefId()
get reference id public
static getLocalMaphilightPath()
Get local path of maphilight file.
static _getPersistedConditionsOfTarget($a_target_ref_id, $a_target_obj_id, $a_target_type="")
get all persisted conditions of target object
deleteMetaData()
delete meta data entry
static getLogger($a_component_id)
Get component logger.
if(strpos($jquery_path, './')===0) elseif(strpos($jquery_path, '.')===0) $mathJaxSetting
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.
Class ilObjContentObject.
static yn2tf($a_yn)
convert "y"/"n" to true/false
setAutoGlossaries($a_val)
Set auto glossaries.
static getPageList($lm_id)
static
setDescription($a_description)
set description of content object
static getLocalJsTreeCssPath()
Get local path of jsTree js.
exportXML(&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
export object to xml (see ilias_co.dtd)
static getLocaljQueryPath()
static getInstance($a_obj_id)
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
getDescription()
get description of content object
static getWebspaceDir($mode="filesystem")
get webspace directory
createProperties()
create new properties record
setForTranslation($a_val)
Set for translation.
static _lookGlossaryTerm($term_id)
get glossary term
setStoreTries($a_val)
Set store tries.
Extension of ilPageObject for learning modules.
setHistoryUserComments($a_comm)
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
cloneObject($a_target_id, $a_copy_id=0, $a_omit_tree=false)
Clone learning module.