4require_once
"./Services/Object/classes/class.ilObject.php";
5require_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)
95 if (!$a_no_meta_data) {
113 # echo "Content<br>\n";
116 $this->lm_tree->setTableNames(
'lm_tree',
'lm_data');
117 $this->lm_tree->setTreeTablePK(
"lm_id");
123 "SELECT * FROM lm_glossaries " .
124 " WHERE lm_id = " .
$ilDB->quote($this->getId(),
"integer")
127 while ($rec =
$ilDB->fetchAssoc($set)) {
128 $glos[] = $rec[
"glo_id"];
142 return parent::getTitle();
150 parent::setTitle($a_title);
169 parent::setDescription($a_description);
181 $this->import_id = $a_id;
191 $this->layout_per_page = $a_val;
201 return $this->layout_per_page;
211 $this->disable_def_feedback = $a_val;
221 return $this->disable_def_feedback;
231 $this->progr_icons = $a_val;
241 return $this->progr_icons;
251 $this->store_tries = $a_val;
261 return $this->store_tries;
271 $this->restrict_forw_nav = $a_val;
281 return $this->restrict_forw_nav;
313 "DELETE FROM lm_glossaries WHERE " .
314 " lm_id = " .
$ilDB->quote($this->getId(),
"integer")
317 $ilDB->manipulate(
"INSERT INTO lm_glossaries " .
318 "(lm_id, glo_id) VALUES (" .
319 $ilDB->quote($this->getId(),
"integer") .
"," .
320 $ilDB->quote($glo_id,
"integer") .
329 public function import()
345 parent::putInTree($a_parent);
360 $this->lm_tree->setTreeTablePK(
"lm_id");
361 $this->lm_tree->setTableNames(
'lm_tree',
'lm_data');
362 $this->lm_tree->addTree($this->
getId(), 1);
372 $this->auto_glossaries = array();
373 if (is_array($a_val)) {
374 foreach ($a_val as $v) {
377 !in_array($v, $this->auto_glossaries)) {
378 $this->auto_glossaries[] = $v;
404 if ($g != $a_glo_id) {
419 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
420 include_once(
"./Modules/LearningModule/classes/class.ilStructureObject.php");
421 include_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
423 $root_id = $this->lm_tree->getRootId();
427 $chap->setType(
"st");
428 $chap->setTitle(
$lng->txt(
"cont_new_chap"));
429 $chap->setLMId($this->
getId());
435 $page->setType(
"pg");
436 $page->setTitle(
$lng->txt(
"cont_new_page"));
437 $page->setLMId($this->
getId());
449 $this->for_translation = $a_val;
481 if (!is_writable($lm_data_dir)) {
482 $ilErr->raiseError(
"Content object Data Directory (" . $lm_data_dir
483 .
") not writeable.",
$ilErr->FATAL);
487 $lm_dir = $lm_data_dir .
"/lm_" . $this->
getId();
489 if (!@is_dir($lm_dir)) {
490 $ilErr->raiseError(
"Creation of Learning Module Directory failed.",
$ilErr->FATAL);
497 $ilErr->raiseError(
"Creation of Import Directory failed.",
$ilErr->FATAL);
507 "/lm_" . $this->
getId();
515 if (strlen($this->import_dir)) {
520 "/lm_" . $this->
getId() .
"/import";
536 $this->import_dir = $a_import_dir;
550 if (!is_writable($lm_data_dir)) {
551 $ilErr->raiseError(
"Content object Data Directory (" . $lm_data_dir
552 .
") not writeable.",
$ilErr->FATAL);
555 $lm_dir = $lm_data_dir .
"/lm_" . $this->
getId();
557 if (!@is_dir($lm_dir)) {
558 $ilErr->raiseError(
"Creation of Learning Module Directory failed.",
$ilErr->FATAL);
564 $export_dir = $lm_dir .
"/export_scorm";
568 if (substr(
$a_type, 0, 4) ==
"html") {
569 $export_dir = $lm_dir .
"/export_" .
$a_type;
571 $export_dir = $lm_dir .
"/export";
577 if (!@is_dir($export_dir)) {
578 $ilErr->raiseError(
"Creation of Export Directory failed.",
$ilErr->FATAL);
593 if (substr(
$a_type, 0, 4) ==
"html") {
614 public function delete()
619 if (!parent::delete()) {
624 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
632 $this->lm_tree->removeTree($this->lm_tree->getTreeId());
638 $q =
"DELETE FROM content_object WHERE id = " .
640 $ilDB->manipulate($q);
643 $q =
"DELETE FROM lm_menu WHERE lm_id = " .
645 $ilDB->manipulate($q);
649 "DELETE FROM lm_glossaries WHERE " .
650 " lm_id = " .
$ilDB->quote($this->getId(),
"integer")
675 $this->layout = $a_layout;
691 $this->style_id = $a_style_id;
701 $q =
"UPDATE content_object SET " .
702 " stylesheet = " .
$ilDB->quote((
int) $a_style_id,
"integer") .
703 " WHERE id = " .
$ilDB->quote($this->
getId(),
"integer");
704 $ilDB->manipulate($q);
706 $this->style_id = $a_style_id;
722 "UPDATE content_object SET " .
723 " header_page = " .
$ilDB->quote($a_page_id,
"integer") .
724 " WHERE id = " .
$ilDB->quote($a_lm_id,
"integer")
741 "UPDATE content_object SET " .
742 " footer_page = " .
$ilDB->quote($a_page_id,
"integer") .
743 " WHERE id = " .
$ilDB->quote($a_lm_id,
"integer")
757 if ($a_from_style < 0) {
758 $q =
"SELECT stylesheet FROM content_object, style_data " .
759 " WHERE content_object.stylesheet = style_data.id " .
760 " AND style_data.standard = " .
$ilDB->quote(0,
"integer") .
761 " AND content_object.stylesheet > " .
$ilDB->quote(0,
"integer");
762 $style_set =
$ilDB->query($q);
763 while ($style_rec =
$ilDB->fetchAssoc($style_set)) {
765 $q =
"UPDATE content_object SET " .
766 " stylesheet = " .
$ilDB->quote((
int) $a_to_style,
"integer") .
767 " WHERE stylesheet = " .
$ilDB->quote($style_rec[
"stylesheet"],
"integer");
768 $ilDB->manipulate($q);
772 $style_obj->delete();
775 $q =
"UPDATE content_object SET " .
776 " stylesheet = " .
$ilDB->quote((
int) $a_to_style,
"integer") .
777 " WHERE stylesheet = " .
$ilDB->quote($a_from_style,
"integer");
778 $ilDB->manipulate($q);
789 protected static function _lookup($a_obj_id, $a_field)
796 $q =
"SELECT " . $a_field .
" FROM content_object " .
797 " WHERE id = " .
$ilDB->quote($a_obj_id,
"integer");
802 return $rec[$a_field];
825 $q =
"SELECT stylesheet FROM content_object " .
826 " WHERE id = " .
$ilDB->quote($a_cont_obj_id,
"integer");
830 return $sheet[
"stylesheet"];
842 $q =
"SELECT id FROM content_object " .
843 " WHERE stylesheet = " .
$ilDB->quote($a_style_id,
"integer");
846 while ($cont =
$ilDB->fetchAssoc(
$res)) {
847 $obj_ids[] = $cont[
"id"];
861 $q =
"SELECT disable_def_feedback FROM content_object " .
862 " WHERE id = " .
$ilDB->quote($a_id,
"integer");
866 return $rec[
"disable_def_feedback"];
878 $q =
"SELECT store_tries FROM content_object " .
879 " WHERE id = " .
$ilDB->quote($a_id,
"integer");
883 return $rec[
"store_tries"];
898 $q =
"SELECT count(*) as cnt FROM content_object " .
899 " WHERE stylesheet = " .
$ilDB->quote($a_style_id,
"integer");
900 $cset =
$ilDB->query($q);
901 $crow =
$ilDB->fetchAssoc($cset);
903 return (
int) $crow[
"cnt"];
917 $q =
"SELECT count(*) as cnt FROM content_object, style_data " .
918 " WHERE stylesheet = style_data.id " .
919 " AND standard = " .
$ilDB->quote(0,
"integer");
920 $cset =
$ilDB->query($q);
921 $crow =
$ilDB->fetchAssoc($cset);
923 return (
int) $crow[
"cnt"];
935 $q =
"SELECT count(*) as cnt FROM content_object " .
936 " WHERE stylesheet = " .
$ilDB->quote(0,
"integer");
937 $cset =
$ilDB->query($q);
938 $crow =
$ilDB->fetchAssoc($cset);
940 return (
int) $crow[
"cnt"];
954 $q =
"UPDATE content_object SET " .
955 " stylesheet = " .
$ilDB->quote(0,
"integer") .
956 " WHERE stylesheet = " .
$ilDB->quote((
int) $a_style_id,
"integer");
958 $ilDB->manipulate($q);
976 $this->pg_header = $a_pg_header;
984 return $this->toc_mode;
992 return $this->public_access_mode;
1002 $this->toc_mode = $a_toc_mode;
1007 $this->online = $a_online;
1017 $this->lm_menu_active = $a_act_lm_menu;
1022 return $this->lm_menu_active;
1027 $this->toc_active = $a_toc;
1032 return $this->toc_active;
1037 $this->numbering = $a_num;
1042 return $this->numbering;
1047 $this->print_view_active = $a_print;
1052 return $this->print_view_active;
1057 $this->prevent_glossary_appendix_active = $a_print;
1062 return $this->prevent_glossary_appendix_active;
1072 $this->hide_header_footer_print = $a_val;
1082 return $this->hide_header_footer_print;
1087 $this->downloads_active = $a_down;
1092 return $this->downloads_active;
1097 $this->downloads_public_active = $a_down;
1102 return $this->downloads_public_active;
1107 $this->pub_notes = $a_pub_notes;
1112 return $this->pub_notes;
1117 $this->clean_frames = $a_clean;
1122 return $this->clean_frames;
1127 $this->user_comments = $a_comm;
1132 $this->public_access_mode = $a_mode;
1137 return $this->user_comments;
1142 $this->header_page = $a_pg;
1147 return $this->header_page;
1152 $this->footer_page = $a_pg;
1157 return $this->footer_page;
1167 $q =
"SELECT * FROM content_object WHERE id = " .
1171 $this->
setLayout($lm_rec[
"default_layout"]);
1201 include_once(
"./Services/Notes/classes/class.ilNote.php");
1219 $q =
"UPDATE content_object SET " .
1220 " default_layout = " .
$ilDB->quote($this->
getLayout(),
"text") .
", " .
1242 " rating = " .
$ilDB->quote($this->
hasRating(),
"integer") .
", " .
1249 " WHERE id = " .
$ilDB->quote($this->
getId(),
"integer");
1250 $ilDB->manipulate($q);
1252 include_once(
"./Services/Notes/classes/class.ilNote.php");
1263 $q =
"INSERT INTO content_object (id) VALUES (" .
$ilDB->quote($this->
getId(),
"integer") .
")";
1264 $ilDB->manipulate($q);
1267 include_once(
"./Services/Notes/classes/class.ilNote.php");
1284 $q =
"SELECT is_online FROM content_object WHERE id = " .
$ilDB->quote($a_id,
"integer");
1296 $dir = opendir(
"./Modules/LearningModule/layouts/lm");
1300 while (
$file = readdir($dir)) {
1303 if (@is_dir(
"./Modules/LearningModule/layouts/lm/" .
$file)) {
1312 'toc2win' =>
'toc2win',
1313 'toc2windyn' =>
'toc2windyn',
1314 '1window' =>
'1window',
1315 '2window' =>
'2window',
1316 '3window' =>
'3window',
1317 'presentation' =>
'presentation',
1318 'fullscreen' =>
'fullscreen'
1321 foreach ($layouts as
$l) {
1322 if (!in_array(
$l,
$ret)) {
1341 $lm_tree->setTableNames(
'lm_tree',
'lm_data');
1344 if (
$lm_tree->isInTree($page_id)) {
1346 foreach (
$path as $node) {
1347 if ($node[
"type"] ==
"st") {
1364 $lm_tree->setTableNames(
'lm_tree',
'lm_data');
1368 if (
$lm_tree->isInTree($page_id)) {
1371 foreach (
$path as $node) {
1372 if ($node[
"type"] ==
"st") {
1375 foreach ($tconds as $tcond) {
1394 $lm_tree->setTableNames(
'lm_tree',
'lm_data');
1398 if (
$lm_tree->isInTree($page_id)) {
1401 foreach (
$path as $node) {
1402 if ($node[
"type"] ==
"st") {
1405 foreach ($tconds as $tcond) {
1408 return $node[
"child"];
1424 $tree->setTableNames(
'lm_tree',
'lm_data');
1425 $tree->setTreeTablePK(
"lm_id");
1426 if (
$tree->isInTree($a_page_id)) {
1427 $succ =
$tree->fetchSuccessorNode($a_page_id,
"pg");
1439 $tree->setTableNames(
'lm_tree',
'lm_data');
1440 $tree->setTreeTablePK(
"lm_id");
1442 $tree->checkTreeChilds();
1458 $set =
$ilDB->query(
1459 "SELECT DISTINCT l1.lm_id" .
1460 " FROM lm_tree l1" .
1461 " JOIN lm_tree l2 ON ( l1.child = l2.parent" .
1462 " AND l1.lm_id = l2.lm_id )" .
1463 " JOIN lm_data ON ( l1.child = lm_data.obj_id )" .
1464 " WHERE (l2.lft < l1.lft" .
1465 " OR l2.rgt > l1.rgt OR l2.lft > l1.rgt OR l2.rgt < l1.lft)" .
1466 " AND l1.lm_id = " .
$ilDB->quote($this->getId(),
"integer") .
1467 " ORDER BY lm_data.create_date DESC"
1469 if ($rec =
$ilDB->fetchAssoc($set)) {
1474 $set =
$ilDB->query(
"SELECT * FROM lm_tree WHERE lm_tree.lm_id = " .
$ilDB->quote($this->getId(),
"integer"));
1475 while ($node =
$ilDB->fetchAssoc($set)) {
1476 $q =
"SELECT * FROM lm_data WHERE obj_id = " .
1477 $ilDB->quote($node[
"child"],
"integer");
1478 $obj_set =
$ilDB->query($q);
1479 $obj_rec =
$ilDB->fetchAssoc($obj_set);
1481 $node_data =
$tree->getNodeData($node[
"child"]);
1482 $node_data[
"child"] = $node[
"child"];
1483 $tree->deleteTree($node_data);
1489 foreach ($nodes as $node) {
1490 $q =
"SELECT * FROM lm_data WHERE obj_id = " .
1491 $ilDB->quote($node[
"parent"],
"integer");
1492 $obj_set =
$ilDB->query($q);
1493 $obj_rec =
$ilDB->fetchAssoc($obj_set);
1494 if ($obj_rec[
"type"] ==
"pg") {
1495 $node_data =
$tree->getNodeData($node[
"child"]);
1496 if (
$tree->isInTree($node[
"child"])) {
1497 $tree->deleteTree($node_data);
1504 $set =
$ilDB->query(
"SELECT DISTINCT l1.lm_id" .
1505 " FROM lm_tree l1" .
1506 " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )" .
1507 " JOIN lm_data ON (l1.child = lm_data.obj_id)" .
1508 " WHERE l1.child <> 1" .
1509 " AND l1.lm_id <> lm_data.lm_id" .
1510 " AND l1.lm_id = " .
$ilDB->quote($this->getId(),
"integer"));
1511 if ($rec =
$ilDB->fetchAssoc($set)) {
1512 $set =
$ilDB->query(
"SELECT DISTINCT l1.child " .
1513 " FROM lm_tree l1" .
1514 " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )" .
1515 " JOIN lm_data ON (l1.child = lm_data.obj_id)" .
1516 " WHERE l1.child <> 1" .
1517 " AND l1.lm_id <> lm_data.lm_id" .
1518 " AND l1.lm_id = " .
$ilDB->quote($this->getId(),
"integer"));
1519 include_once(
"./Modules/LearningModule/classes/class.ilLMObjectFactory.php");
1520 while ($rec =
$ilDB->fetchAssoc($set)) {
1523 if (is_object($cobj)) {
1524 if ($cobj->getType() ==
"pg") {
1526 $pg_copy = $cobj->copy($this);
1530 "UPDATE lm_tree SET " .
1531 " child = " .
$ilDB->quote($pg_copy->getId(),
"integer") .
1532 " WHERE child = " .
$ilDB->quote($cobj->getId(),
"integer") .
1533 " AND lm_id = " .
$ilDB->quote($this->getId(),
"integer")
1535 } elseif ($cobj->getType() ==
"st") {
1537 $st_copy = $cobj->copy($this);
1541 "UPDATE lm_tree SET " .
1542 " child = " .
$ilDB->quote($st_copy->getId(),
"integer") .
1543 " WHERE child = " .
$ilDB->quote($cobj->getId(),
"integer") .
1544 " AND lm_id = " .
$ilDB->quote($this->getId(),
"integer")
1549 "UPDATE lm_tree SET " .
1550 " parent = " .
$ilDB->quote($st_copy->getId(),
"integer") .
1551 " WHERE parent = " .
$ilDB->quote($cobj->getId(),
"integer") .
1552 " AND lm_id = " .
$ilDB->quote($this->getId(),
"integer")
1560 $set =
$ilDB->queryF(
1561 "SELECT * FROM lm_data " .
1562 " WHERE lm_id = %s AND type = %s",
1563 array(
"integer",
"text"),
1564 array($this->
getId(),
"pg")
1566 while ($rec =
$ilDB->fetchAssoc($set)) {
1569 $lm_page->setId($rec[
"obj_id"]);
1570 $lm_page->setParentId($this->
getId());
1589 $set =
$ilDB->query(
1590 "SELECT l1.child, l1.lft l1lft, l1.rgt l1rgt, l2.parent, l2.lft l2lft, l2.rgt l2rgt" .
1591 " FROM lm_tree l1" .
1592 " JOIN lm_tree l2 ON ( l1.child = l2.parent" .
1593 " AND l1.lm_id = l2.lm_id )" .
1594 " JOIN lm_data ON ( l1.child = lm_data.obj_id )" .
1595 " WHERE (l2.lft < l1.lft" .
1596 " OR l2.rgt > l1.rgt OR l2.lft > l1.rgt OR l2.rgt < l1.lft)" .
1597 " AND l1.lm_id = " .
$ilDB->quote($this->getId(),
"integer") .
1598 " ORDER BY lm_data.create_date DESC"
1600 while ($rec =
$ilDB->fetchAssoc($set)) {
1601 $issues[] =
"Tree numbering: " . print_r($rec,
true);
1605 $set =
$ilDB->query(
"SELECT * FROM lm_tree WHERE lm_tree.lm_id = " .
$ilDB->quote($this->getId(),
"integer"));
1606 while ($node =
$ilDB->fetchAssoc($set)) {
1607 $q =
"SELECT * FROM lm_data WHERE obj_id = " .
1608 $ilDB->quote($node[
"child"],
"integer");
1609 $obj_set =
$ilDB->query($q);
1610 $obj_rec =
$ilDB->fetchAssoc($obj_set);
1612 $issues[] =
"Tree entry without data entry: " . print_r($node,
true);
1618 foreach ($nodes as $node) {
1619 $q =
"SELECT * FROM lm_data WHERE obj_id = " .
1620 $ilDB->quote($node[
"parent"],
"integer");
1621 $obj_set =
$ilDB->query($q);
1622 $obj_rec =
$ilDB->fetchAssoc($obj_set);
1623 if ($obj_rec[
"type"] ==
"pg") {
1624 $node_data =
$tree->getNodeData($node[
"child"]);
1625 if (
$tree->isInTree($node[
"child"])) {
1626 $issues[] =
"Subtree with page parent: " . print_r($node_data,
true);
1633 $set =
$ilDB->query(
"SELECT DISTINCT l1.lm_id" .
1634 " FROM lm_tree l1" .
1635 " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )" .
1636 " JOIN lm_data ON (l1.child = lm_data.obj_id)" .
1637 " WHERE l1.child <> 1" .
1638 " AND l1.lm_id <> lm_data.lm_id" .
1639 " AND l1.lm_id = " .
$ilDB->quote($this->getId(),
"integer"));
1640 if ($rec =
$ilDB->fetchAssoc($set)) {
1641 $set =
$ilDB->query(
"SELECT DISTINCT l1.child " .
1642 " FROM lm_tree l1" .
1643 " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )" .
1644 " JOIN lm_data ON (l1.child = lm_data.obj_id)" .
1645 " WHERE l1.child <> 1" .
1646 " AND l1.lm_id <> lm_data.lm_id" .
1647 " AND l1.lm_id = " .
$ilDB->quote($this->getId(),
"integer"));
1648 include_once(
"./Modules/LearningModule/classes/class.ilLMObjectFactory.php");
1649 while ($rec =
$ilDB->fetchAssoc($set)) {
1650 $set3 =
$ilDB->queryF(
1651 "SELECT * FROM lm_tree " .
1652 " WHERE child = %s ",
1654 array($rec[
"child"])
1656 while ($rec3 =
$ilDB->fetchAssoc($set3)) {
1657 $issues[] =
"Multi-reference item: " . print_r($rec3,
true);
1663 $set =
$ilDB->queryF(
1664 "SELECT * FROM lm_data " .
1665 " WHERE lm_id = %s AND type = %s",
1666 array(
"integer",
"text"),
1667 array($this->
getId(),
"pg")
1669 while ($rec =
$ilDB->fetchAssoc($set)) {
1671 $issues[] =
"Missing COPage: " . print_r($rec,
true);
1685 public function exportXML(&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
1690 $attrs[
"Type"] =
"LearningModule";
1693 $a_xml_writer->xmlStartTag(
"ContentObject", $attrs);
1700 $expLog->write(
date(
"[y-m-d H:i:s] ") .
"Start Export Structure Objects");
1702 $expLog->write(
date(
"[y-m-d H:i:s] ") .
"Finished Export Structure Objects");
1705 $expLog->write(
date(
"[y-m-d H:i:s] ") .
"Start Export Page Objects");
1707 $expLog->write(
date(
"[y-m-d H:i:s] ") .
"Finished Export Page Objects");
1710 $expLog->write(
date(
"[y-m-d H:i:s] ") .
"Start Export Media Objects");
1712 $expLog->write(
date(
"[y-m-d H:i:s] ") .
"Finished Export Media Objects");
1715 $expLog->write(
date(
"[y-m-d H:i:s] ") .
"Start Export File Items");
1717 $expLog->write(
date(
"[y-m-d H:i:s] ") .
"Finished Export File Items");
1720 if (count($this->q_ids) > 0) {
1721 $qti_file = fopen($a_target_dir .
"/qti.xml",
"w");
1722 include_once(
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
1724 fwrite($qti_file, $pool->questionsToXML($this->q_ids));
1730 $expLog->write(
date(
"[y-m-d H:i:s] ") .
"Start Export Properties");
1732 $expLog->write(
date(
"[y-m-d H:i:s] ") .
"Finished Export Properties");
1734 $a_xml_writer->xmlEndTag(
"ContentObject");
1745 include_once(
"Services/MetaData/classes/class.ilMD2XML.php");
1747 $md2xml->setExportMode(
true);
1748 $md2xml->startExport();
1749 $a_xml_writer->appendXML($md2xml->getXML());
1760 include_once
'./Modules/LearningModule/classes/class.ilStructureObject.php';
1762 $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
1763 foreach ($childs as $child) {
1764 if ($child[
"type"] !=
"st") {
1769 $structure_obj->exportXML($a_xml_writer, $a_inst, $expLog);
1770 unset($structure_obj);
1783 include_once
"./Modules/LearningModule/classes/class.ilLMPageObject.php";
1784 include_once
"./Modules/LearningModule/classes/class.ilLMPage.php";
1787 foreach ($pages as $page) {
1789 $expLog->write(
date(
"[y-m-d H:i:s] ") .
"Page Object " . $page[
"obj_id"]);
1793 $page_obj->exportXML($a_xml_writer,
"normal", $a_inst);
1796 $mob_ids = $page_obj->getMediaObjectIDs();
1797 foreach ($mob_ids as $mob_id) {
1798 $this->mob_ids[$mob_id] = $mob_id;
1802 $file_ids = $page_obj->getFileItemIds();
1803 foreach ($file_ids as $file_id) {
1804 $this->file_ids[$file_id] = $file_id;
1808 $q_ids = $page_obj->getQuestionIds();
1809 foreach ($q_ids as $q_id) {
1810 $this->q_ids[$q_id] = $q_id;
1826 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1828 $linked_mobs = array();
1831 foreach ($this->mob_ids as $mob_id) {
1833 $expLog->write(
date(
"[y-m-d H:i:s] ") .
"Media Object " . $mob_id);
1835 $media_obj->exportXML($a_xml_writer, $a_inst);
1836 $media_obj->exportFiles($a_target_dir);
1838 $lmobs = $media_obj->getLinkedMediaObjects($this->mob_ids);
1839 $linked_mobs = array_merge($linked_mobs, $lmobs);
1846 foreach ($linked_mobs as $mob_id) {
1848 $expLog->write(
date(
"[y-m-d H:i:s] ") .
"Media Object " . $mob_id);
1850 $media_obj->exportXML($a_xml_writer, $a_inst);
1851 $media_obj->exportFiles($a_target_dir);
1863 include_once(
"./Modules/File/classes/class.ilObjFile.php");
1865 foreach ($this->file_ids as $file_id) {
1866 $expLog->write(
date(
"[y-m-d H:i:s] ") .
"File Item " . $file_id);
1867 $file_obj =
new ilObjFile($file_id,
false);
1868 $file_obj->export($a_target_dir);
1880 $a_xml_writer->xmlStartTag(
"Properties", $attrs);
1883 $attrs = array(
"Name" =>
"Layout",
"Value" => $this->
getLayout());
1884 $a_xml_writer->xmlElement(
"Property", $attrs);
1887 $attrs = array(
"Name" =>
"PageHeader",
"Value" => $this->
getPageHeader());
1888 $a_xml_writer->xmlElement(
"Property", $attrs);
1891 $attrs = array(
"Name" =>
"TOCMode",
"Value" => $this->
getTOCMode());
1892 $a_xml_writer->xmlElement(
"Property", $attrs);
1895 $attrs = array(
"Name" =>
"ActiveLMMenu",
"Value" =>
1897 $a_xml_writer->xmlElement(
"Property", $attrs);
1900 $attrs = array(
"Name" =>
"ActiveNumbering",
"Value" =>
1902 $a_xml_writer->xmlElement(
"Property", $attrs);
1905 $attrs = array(
"Name" =>
"ActiveTOC",
"Value" =>
1907 $a_xml_writer->xmlElement(
"Property", $attrs);
1910 $attrs = array(
"Name" =>
"ActivePrintView",
"Value" =>
1912 $a_xml_writer->xmlElement(
"Property", $attrs);
1918 $attrs = array(
"Name" =>
"CleanFrames",
"Value" =>
1920 $a_xml_writer->xmlElement(
"Property", $attrs);
1923 $attrs = array(
"Name" =>
"PublicNotes",
"Value" =>
1925 $a_xml_writer->xmlElement(
"Property", $attrs);
1928 $attrs = array(
"Name" =>
"HistoryUserComments",
"Value" =>
1930 $a_xml_writer->xmlElement(
"Property", $attrs);
1933 $attrs = array(
"Name" =>
"Rating",
"Value" =>
1935 $a_xml_writer->xmlElement(
"Property", $attrs);
1936 $attrs = array(
"Name" =>
"RatingPages",
"Value" =>
1938 $a_xml_writer->xmlElement(
"Property", $attrs);
1942 $attrs = array(
"Name" =>
"HeaderPage",
"Value" =>
1944 $a_xml_writer->xmlElement(
"Property", $attrs);
1949 $attrs = array(
"Name" =>
"FooterPage",
"Value" =>
1951 $a_xml_writer->xmlElement(
"Property", $attrs);
1955 $attrs = array(
"Name" =>
"LayoutPerPage",
"Value" =>
1957 $a_xml_writer->xmlElement(
"Property", $attrs);
1960 $attrs = array(
"Name" =>
"ProgressIcons",
"Value" =>
1962 $a_xml_writer->xmlElement(
"Property", $attrs);
1965 $attrs = array(
"Name" =>
"StoreTries",
"Value" =>
1967 $a_xml_writer->xmlElement(
"Property", $attrs);
1970 $attrs = array(
"Name" =>
"RestrictForwardNavigation",
"Value" =>
1972 $a_xml_writer->xmlElement(
"Property", $attrs);
1975 $attrs = array(
"Name" =>
"DisableDefaultFeedback",
"Value" =>
1977 $a_xml_writer->xmlElement(
"Property", $attrs);
1979 $a_xml_writer->xmlEndTag(
"Properties");
1989 $types = array(
"xml",
"html",
"scorm");
1991 foreach ($types as
$type) {
1994 if (!@is_dir($dir) or
1995 !is_writeable($dir)) {
2005 while ($entry = $cdir->read()) {
2006 if ($entry !=
"." and
2008 substr($entry, -4) ==
".zip" and
2009 preg_match(
"~^[0-9]{10}_{2}[0-9]+_{2}(lm_)*[0-9]+\.zip\$~", $entry)) {
2011 "size" => filesize($dir .
"/" . $entry));
2033 $this->public_export_file[
$a_type] = $a_file;
2045 return $this->public_export_file[
$a_type];
2054 if (!@is_dir($dir) or
2055 !is_writeable($dir)) {
2066 while ($entry = $dir->read()) {
2067 if ($entry !=
"." and
2069 substr($entry, -4) ==
".pdf" and
2070 preg_match(
"~^[0-9]{10}_{2}[0-9]+_{2}(lm_)*[0-9]+\.pdf\$~", $entry)) {
2098 include(
"./Modules/LearningModule/classes/class.ilLMContObjectManifestBuilder.php");
2100 $man_builder->buildManifest();
2101 $man_builder->dump($a_target_dir);
2104 copy(
"Modules/LearningModule/scorm_xsd/adlcp_rootv1p2.xsd", $a_target_dir .
"/adlcp_rootv1p2.xsd");
2105 copy(
"Modules/LearningModule/scorm_xsd/imscp_rootv1p1p2.xsd", $a_target_dir .
"/imscp_rootv1p1p2.xsd");
2106 copy(
"Modules/LearningModule/scorm_xsd/imsmd_rootv1p2p1.xsd", $a_target_dir .
"/imsmd_rootv1p2p1.xsd");
2107 copy(
"Modules/LearningModule/scorm_xsd/ims_xml.xsd", $a_target_dir .
"/ims_xml.xsd");
2111 $zip_file = $a_target_dir .
"/" . $date .
"__" . IL_INST_ID .
"__" .
2115 $a_target_dir .
"/imsmanifest.xml",
2116 $a_target_dir .
"/adlcp_rootv1p2.xsd",
2117 $a_target_dir .
"/imscp_rootv1p1p2.xsd",
2118 $a_target_dir .
"/ims_xml.xsd",
2119 $a_target_dir .
"/imsmd_rootv1p2p1.xsd"), $zip_file);
2121 $dest_file = $this->
getExportDirectory(
"scorm") .
"/" . $date .
"__" . IL_INST_ID .
"__" .
2124 rename($zip_file, $dest_file);
2132 public function exportHTML($a_target_dir,
$log, $a_zip_file =
true, $a_export_format =
"html", $a_lang =
"")
2138 $user_lang =
$ilUser->getLanguage();
2143 $mob_dir = $a_target_dir .
"/mobs";
2145 $file_dir = $a_target_dir .
"/files";
2147 $teximg_dir = $a_target_dir .
"/teximg";
2149 $style_dir = $a_target_dir .
"/style";
2151 $style_img_dir = $a_target_dir .
"/style/images";
2153 $content_style_dir = $a_target_dir .
"/content_style";
2155 $content_style_img_dir = $a_target_dir .
"/content_style/images";
2159 include_once
'./Services/MathJax/classes/class.ilMathJax.php';
2164 $style_name =
$ilUser->prefs[
"style"] .
".css";
2165 copy($location_stylesheet, $style_dir .
"/" . $style_name);
2166 $fh = fopen($location_stylesheet,
"r");
2167 $css = fread(
$fh, filesize($location_stylesheet));
2168 preg_match_all(
"/url\(([^\)]*)\)/", $css,
$files);
2169 foreach (array_unique(
$files[1]) as $fileref) {
2170 $css_fileref = str_replace(array(
"'",
'"'),
"", $fileref);
2171 $fileref = dirname($location_stylesheet) .
"/" . $css_fileref;
2172 if (is_file($fileref)) {
2176 copy($fileref, $style_dir .
"/" . $css_fileref);
2184 $cont_stylesheet =
"./Services/COPage/css/content.css";
2186 $css = fread(fopen($cont_stylesheet,
'r'), filesize($cont_stylesheet));
2187 preg_match_all(
"/url\(([^\)]*)\)/", $css,
$files);
2188 foreach (array_unique(
$files[1]) as $fileref) {
2189 if (is_file(str_replace(
"..",
".", $fileref))) {
2190 copy(str_replace(
"..",
".", $fileref), $content_style_img_dir .
"/" . basename($fileref));
2192 $css = str_replace($fileref,
"images/" . basename($fileref), $css);
2194 fwrite(fopen($content_style_dir .
"/content.css",
'w'), $css);
2197 $style->writeCSSFile($content_style_dir .
"/content.css",
"images");
2198 $style->copyImagesToDir($content_style_img_dir);
2203 copy($syn_stylesheet, $a_target_dir .
"/syntaxhighlight.css");
2206 include_once(
"./Modules/LearningModule/classes/class.ilLMPresentationGUI.php");
2207 $_GET[
"cmd"] =
"nop";
2208 $get_transl =
$_GET[
"transl"];
2209 $_GET[
"transl"] =
"";
2211 $lm_gui->setOfflineMode(
true, ($a_lang ==
"all"));
2212 $lm_gui->setOfflineDirectory($a_target_dir);
2213 $lm_gui->setExportFormat($a_export_format);
2217 if ($a_lang !=
"all") {
2218 $langs = array($a_lang);
2220 $ot_langs = $ot->getLanguages();
2221 foreach ($ot_langs as $otl) {
2222 $langs[] = $otl[
"lang_code"];
2227 $this->offline_mobs = array();
2228 $this->offline_int_links = array();
2229 $this->offline_files = array();
2232 foreach ($langs as
$lang) {
2237 $ilUser->setLanguage($user_lang);
2238 $ilUser->setCurrentLanguage($user_lang);
2242 if (
$lang == $ot->getMasterLanguage()) {
2245 $lm_gui->lang =
$lang;
2251 $this->
exportHTMLPages($lm_gui, $a_target_dir, $lm_gui->lang, ($a_lang ==
"all"));
2254 $ilLocator->clearItems();
2260 $lm_gui->tpl =
$tpl;
2261 $content = $lm_gui->showTableOfContents();
2263 if ($a_lang ==
"all") {
2264 $file = $a_target_dir .
"/table_of_contents_" .
$lang .
".html";
2266 $file = $a_target_dir .
"/table_of_contents.html";
2270 if (!($fp = @fopen(
$file,
"w+"))) {
2271 die(
"<b>Error</b>: Could not open \"" .
$file .
"\" for writing" .
2272 " in <b>" . __FILE__ .
"</b> on line <b>" . __LINE__ .
"</b><br />");
2275 fwrite($fp, $content);
2284 $linked_mobs = array();
2285 foreach ($this->offline_mobs as $mob) {
2287 $this->
exportHTMLMOB($a_target_dir, $lm_gui, $mob,
"_blank", $linked_mobs);
2290 $linked_mobs2 = array();
2291 foreach ($linked_mobs as $mob) {
2293 $this->
exportHTMLMOB($a_target_dir, $lm_gui, $mob,
"_blank", $linked_mobs2);
2296 $_GET[
"obj_type"] =
"MediaObject";
2297 $_GET[
"obj_id"] = $a_mob_id;
2301 foreach ($this->offline_files as
$file) {
2306 if (count($this->q_ids) > 0) {
2307 foreach ($this->q_ids as $q_id) {
2311 $a_target_dir .
"/assessment/0/" . $q_id .
"/images"
2317 $image_dir = $a_target_dir .
"/images";
2322 $image_dir .
"/enlarge.svg"
2326 $image_dir .
"/browser/plus.png"
2330 $image_dir .
"/browser/minus.png"
2334 $image_dir .
"/browser/blank.png"
2338 $image_dir .
"/spacer.png"
2342 $image_dir .
"/icon_st.svg"
2346 $image_dir .
"/icon_pg.svg"
2350 $image_dir .
"/icon_lm.svg"
2354 $image_dir .
"/nav_arr_L.png"
2358 $image_dir .
"/nav_arr_R.png"
2362 $services_dir = $a_target_dir .
"/Services";
2364 $media_service_dir = $services_dir .
"/MediaObjects";
2366 include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
2369 $mp3_dir = $media_service_dir .
"/flash_mp3_player";
2374 include_once(
"./Services/UIComponent/Explorer2/classes/class.ilExplorerBaseGUI.php");
2382 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
2383 foreach (self::getSupplyingExportFiles($a_target_dir) as $f) {
2384 if ($f[
"source"] !=
"") {
2386 copy($f[
"source"], $f[
"target"]);
2391 $tpl->setVariable(
"LOCATION_STYLESHEET", $location_stylesheet);
2392 $tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
2394 if ($a_lang !=
"") {
2395 $ilUser->setLanguage($user_lang);
2396 $ilUser->setCurrentLanguage($user_lang);
2401 if ($a_lang ==
"") {
2410 $zip_file = $zip_target_dir .
"/" . $date .
"__" . IL_INST_ID .
"__" .
2426 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
2427 include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
2428 include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
2429 include_once(
"./Services/UIComponent/Explorer2/classes/class.ilExplorerBaseGUI.php");
2432 "target" => $a_target_dir .
'/js/yahoo/yahoo-min.js',
2435 "target" => $a_target_dir .
'/js/yahoo/yahoo-dom-event.js',
2438 "target" => $a_target_dir .
'/js/yahoo/animation-min.js',
2440 array(
"source" =>
'./Services/JavaScript/js/Basic.js',
2441 "target" => $a_target_dir .
'/js/Basic.js',
2443 array(
"source" =>
'./Services/Accordion/js/accordion.js',
2444 "target" => $a_target_dir .
'/js/accordion.js',
2446 array(
"source" =>
'./Services/Accordion/css/accordion.css',
2447 "target" => $a_target_dir .
'/css/accordion.css',
2450 "target" => $a_target_dir .
'/js/jquery.js',
2453 "target" => $a_target_dir .
'/js/maphilight.js',
2456 "target" => $a_target_dir .
'/js/jquery-ui-min.js',
2458 array(
"source" =>
'./Services/COPage/js/ilCOPagePres.js',
2459 "target" => $a_target_dir .
'/js/ilCOPagePres.js',
2461 array(
"source" =>
'./Modules/Scorm2004/scripts/questions/pure.js',
2462 "target" => $a_target_dir .
'/js/pure.js',
2464 array(
"source" =>
'./Modules/Scorm2004/scripts/questions/question_handling.js',
2465 "target" => $a_target_dir .
'/js/question_handling.js',
2467 array(
"source" =>
'./Modules/TestQuestionPool/js/ilMatchingQuestion.js',
2468 "target" => $a_target_dir .
'/js/ilMatchingQuestion.js',
2470 array(
"source" =>
'./Modules/Scorm2004/templates/default/question_handling.css',
2471 "target" => $a_target_dir .
'/css/question_handling.css',
2473 array(
"source" =>
'./Modules/TestQuestionPool/templates/default/test_javascript.css',
2474 "target" => $a_target_dir .
'/css/test_javascript.css',
2476 array(
"source" =>
'./Modules/TestQuestionPool/js/ilAssMultipleChoice.js',
2477 "target" => $a_target_dir .
'/js/ilAssMultipleChoice.js',
2491 array(
"source" =>
'./Modules/LearningModule/js/LearningModule.js',
2492 "target" => $a_target_dir .
'/js/LearningModule.js',
2499 $scripts[] = array(
"source" =>
"",
2505 include_once(
"./Services/Link/classes/class.ilLinkifyUtil.php");
2507 if (is_int(strpos($p,
"ExtLink"))) {
2508 $scripts[] = array(
"source" => $p,
2509 "target" => $a_target_dir .
'/js/ilExtLink.js',
2512 if (is_int(strpos($p,
"linkify"))) {
2513 $scripts[] = array(
"source" => $p,
2514 "target" => $a_target_dir .
'/js/linkify.js',
2527 $file_dir = $a_target_dir .
"/files/file_" . $a_file_id;
2529 include_once(
"./Modules/File/classes/class.ilObjFile.php");
2530 $file_obj =
new ilObjFile($a_file_id,
false);
2531 $source_file = $file_obj->getDirectory($file_obj->getVersion()) .
"/" . $file_obj->getFileName();
2532 if (!is_file($source_file)) {
2533 $source_file = $file_obj->getDirectory() .
"/" . $file_obj->getFileName();
2535 if (is_file($source_file)) {
2536 copy($source_file, $file_dir .
"/" . $file_obj->getFileName());
2543 public function exportHTMLMOB($a_target_dir, &$a_lm_gui, $a_mob_id, $a_frame, &$a_linked_mobs)
2547 $mob_dir = $a_target_dir .
"/mobs";
2550 if (@is_dir($source_dir)) {
2556 $tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
2557 $_GET[
"obj_type"] =
"MediaObject";
2558 $_GET[
"mob_id"] = $a_mob_id;
2559 $_GET[
"frame"] = $a_frame;
2561 $content = $a_lm_gui->media();
2562 $file = $a_target_dir .
"/media_" . $a_mob_id .
".html";
2565 if (!($fp = @fopen(
$file,
"w+"))) {
2566 die(
"<b>Error</b>: Could not open \"" .
$file .
"\" for writing" .
2567 " in <b>" . __FILE__ .
"</b> on line <b>" . __LINE__ .
"</b><br />");
2570 fwrite($fp, $content);
2574 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2576 if ($mob_obj->hasFullscreenItem()) {
2578 $tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
2579 $_GET[
"obj_type"] =
"";
2580 $_GET[
"frame"] =
"";
2581 $_GET[
"mob_id"] = $a_mob_id;
2582 $_GET[
"cmd"] =
"fullscreen";
2583 $content = $a_lm_gui->fullscreen();
2584 $file = $a_target_dir .
"/fullscreen_" . $a_mob_id .
".html";
2587 if (!($fp = @fopen(
$file,
"w+"))) {
2588 die(
"<b>Error</b>: Could not open \"" .
$file .
"\" for writing" .
2589 " in <b>" . __FILE__ .
"</b> on line <b>" . __LINE__ .
"</b><br />");
2592 fwrite($fp, $content);
2595 $linked_mobs = $mob_obj->getLinkedMediaObjects();
2596 foreach ($linked_mobs as
$id) {
2600 $a_linked_mobs = array_merge($a_linked_mobs, $linked_mobs);
2610 foreach ($this->offline_int_links as $int_link) {
2611 $ilLocator->clearItems();
2612 if ($int_link[
"type"] ==
"git") {
2614 $tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
2616 $_GET[
"obj_id"] = $int_link[
"id"];
2617 $_GET[
"frame"] =
"_blank";
2618 $content = $a_lm_gui->glossary();
2619 $file = $a_target_dir .
"/term_" . $int_link[
"id"] .
".html";
2622 if (!($fp = @fopen(
$file,
"w+"))) {
2623 die(
"<b>Error</b>: Could not open \"" .
$file .
"\" for writing" .
2624 " in <b>" . __FILE__ .
"</b> on line <b>" . __LINE__ .
"</b><br />");
2627 fwrite($fp, $content);
2631 include_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
2633 foreach ($defs as
$def) {
2635 foreach ($def_mobs as $def_mob) {
2636 $this->offline_mobs[$def_mob] = $def_mob;
2637 include_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
2644 $this->offline_files = array_merge($this->offline_files, $def_files);
2653 public function exportHTMLPages(&$a_lm_gui, $a_target_dir, $a_lang =
"", $a_all_languages =
false)
2661 $this->first_page_id = $first_page[
"child"];
2665 $int_links = array();
2666 $this->offline_files = array();
2668 include_once(
"./Services/COPage/classes/class.ilPageContentUsage.php");
2669 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2673 $exp_id_map = array();
2675 if (
$lm_set->get(
"html_export_ids")) {
2676 foreach ($pages as $page) {
2678 if (trim($exp_id) !=
"") {
2679 $exp_id_map[$page[
"obj_id"]] = trim($exp_id);
2684 if ($a_lang ==
"") {
2689 foreach ($pages as $page) {
2691 $ilLocator->clearItems();
2704 foreach ($pcs as $pc) {
2705 if ($pc[
"type"] ==
"incl") {
2707 foreach ($incl_mobs as $incl_mob) {
2708 $mobs[$incl_mob] = $incl_mob;
2709 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
2710 $this->log->debug(
"HTML Export: Add media object $incl_mob (" .
ilObject::_lookupTitle($incl_mob) .
") " .
2711 " due to snippet " . $pc[
"id"] .
" in page " . $page[
"obj_id"] .
" (" .
ilLMObject::_lookupTitle($page[
"obj_id"]) .
").");
2718 foreach ($pg_mobs as $pg_mob) {
2719 $mobs[$pg_mob] = $pg_mob;
2720 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
2727 $int_links = array_merge($int_links, $pg_links);
2730 include_once(
"./Modules/File/classes/class.ilObjFile.php");
2732 $this->offline_files = array_merge($this->offline_files, $pg_files);
2735 include_once(
"./Services/COPage/classes/class.ilPCQuestion.php");
2737 foreach ($q_ids as $q_id) {
2738 $this->q_ids[$q_id] = $q_id;
2743 $this->offline_mobs[
$m] =
$m;
2745 foreach ($int_links as $k => $v) {
2746 $this->offline_int_links[$k] = $v;
2760 $a_exp_id_map = array(),
2762 $a_all_languages =
false
2767 if ($a_lang !=
"-" && $a_lang !=
"" && $a_all_languages) {
2768 $lang_suffix =
"_" . $a_lang;
2774 $tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
2776 include_once(
"./Services/COPage/classes/class.ilPCQuestion.php");
2779 $_GET[
"obj_id"] = $a_lm_page_id;
2780 $_GET[
"frame"] = $a_frame;
2782 if ($a_frame ==
"") {
2784 if (is_array($a_exp_id_map) && isset($a_exp_id_map[$a_lm_page_id])) {
2785 $file = $a_target_dir .
"/lm_pg_" . $a_exp_id_map[$a_lm_page_id] . $lang_suffix .
".html";
2787 $file = $a_target_dir .
"/lm_pg_" . $a_lm_page_id . $lang_suffix .
".html";
2790 if ($a_frame !=
"toc") {
2791 $file = $a_target_dir .
"/frame_" . $a_lm_page_id .
"_" . $a_frame . $lang_suffix .
".html";
2793 $file = $a_target_dir .
"/frame_" . $a_frame . $lang_suffix .
".html";
2798 if (@is_file(
$file)) {
2802 $content = $a_lm_gui->layout(
"main.xml",
false);
2805 if (!($fp = @fopen(
$file,
"w+"))) {
2806 die(
"<b>Error</b>: Could not open \"" .
$file .
"\" for writing" .
2807 " in <b>" . __FILE__ .
"</b> on line <b>" . __LINE__ .
"</b><br />");
2814 fwrite($fp, $content);
2819 if ($this->first_page_id == $a_lm_page_id && $a_frame ==
"") {
2820 copy(
$file, $a_target_dir .
"/index" . $lang_suffix .
".html");
2824 $frameset = $a_lm_gui->getCurrentFrameSet();
2826 foreach ($frameset as $frame) {
2827 $this->
exportPageHTML($a_lm_gui, $a_target_dir, $a_lm_page_id, $frame);
2837 public function exportFO(&$a_xml_writer, $a_target_dir)
2841 $attrs[
"xmlns:fo"] =
"http://www.w3.org/1999/XSL/Format";
2842 $a_xml_writer->xmlStartTag(
"fo:root", $attrs);
2846 $a_xml_writer->xmlStartTag(
"fo:layout-master-set", $attrs);
2850 $attrs[
"master-name"] =
"DinA4";
2851 $attrs[
"page-height"] =
"29.7cm";
2852 $attrs[
"page-width"] =
"21cm";
2853 $attrs[
"margin-top"] =
"4cm";
2854 $attrs[
"margin-bottom"] =
"1cm";
2855 $attrs[
"margin-left"] =
"2.8cm";
2856 $attrs[
"margin-right"] =
"7.3cm";
2857 $a_xml_writer->xmlStartTag(
"fo:simple-page-master", $attrs);
2861 $attrs[
"margin-top"] =
"0cm";
2862 $attrs[
"margin-bottom"] =
"1.25cm";
2863 $a_xml_writer->xmlElement(
"fo:region-body", $attrs);
2867 $attrs[
"extent"] =
"1cm";
2868 $a_xml_writer->xmlElement(
"fo:region-before", $attrs);
2872 $attrs[
"extent"] =
"1cm";
2873 $a_xml_writer->xmlElement(
"fo:region-after", $attrs);
2876 $a_xml_writer->xmlEndTag(
"fo:simple-page-master");
2879 $a_xml_writer->xmlEndTag(
"fo:layout-master-set");
2883 $attrs[
"master-reference"] =
"DinA4";
2884 $a_xml_writer->xmlStartTag(
"fo:page-sequence", $attrs);
2888 $attrs[
"flow-name"] =
"xsl-region-body";
2889 $a_xml_writer->xmlStartTag(
"fo:flow", $attrs);
2896 $a_xml_writer->xmlEndTag(
"fo:flow");
2899 $a_xml_writer->xmlEndTag(
"fo:page-sequence");
2902 $a_xml_writer->xmlEndTag(
"fo:root");
2913 $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
2914 foreach ($childs as $child) {
2915 if ($child[
"type"] !=
"st") {
2920 $structure_obj->exportFO($a_xml_writer, $expLog);
2921 unset($structure_obj);
2927 include_once(
"./Modules/LearningModule/classes/class.ilContObjectExport.php");
2931 $export_file = $cont_exp->buildExportFile();
2932 return $export_file;
2946 $lmtree->setTableNames(
'lm_tree',
'lm_data');
2947 $lmtree->setTreeTablePK(
"lm_id");
2950 $source_obj->setLMId($this->
getId());
2952 if (!$first_child) {
2954 $target_obj->setLMId($this->
getId());
2955 $target_parent = $lmtree->getParentId(
$target_id);
2959 if ($source_obj->getType() ==
"pg") {
2961 if ($lmtree->isInTree($source_obj->getId())) {
2962 $node_data = $lmtree->getNodeData($source_obj->getId());
2965 if ($movecopy ==
"move") {
2966 $parent_id = $lmtree->getParentId($source_obj->getId());
2967 $lmtree->deleteTree($node_data);
2970 require_once(
"./Services/History/classes/class.ilHistory.php");
2972 $source_obj->getId(),
2981 $this->getType() .
":st"
2985 $new_page = $source_obj->copy();
2986 $source_id = $new_page->getId();
2987 $source_obj = $new_page;
2991 if (!$lmtree->isInTree($source_obj->getId())) {
2995 } elseif ($as_subitem) {
2998 $pg_childs = $lmtree->getChildsByType($parent,
"pg");
2999 if (count($pg_childs) != 0) {
3000 $target_pos = $pg_childs[count($pg_childs) - 1][
"obj_id"];
3004 $parent = $target_parent;
3008 $lmtree->insertNode(
3009 $source_obj->getId(),
3015 if ($movecopy ==
"move") {
3017 include_once(
"./Services/History/classes/class.ilHistory.php");
3019 $source_obj->getId(),
3028 $this->getType() .
":st"
3036 if ($source_obj->getType() ==
"st") {
3038 $source_node = $lmtree->getNodeData($source_id);
3039 $subnodes = $lmtree->getSubtree($source_node);
3042 foreach ($subnodes as $subnode) {
3054 $pg_childs = $lmtree->getChildsByType($target_parent,
"pg");
3055 if (count($pg_childs) != 0) {
3056 $target_pos = $pg_childs[count($pg_childs) - 1][
"obj_id"];
3058 } elseif ($as_subitem) {
3061 $childs = $lmtree->getChilds($target_parent);
3062 if (count($childs) != 0) {
3063 $target_pos = $childs[count($childs) - 1][
"obj_id"];
3088 if ($movecopy ==
"move") {
3089 $lmtree->deleteTree($source_node);
3092 $new_chapter = $source_obj->copy($lmtree, $target_parent, $target_pos);
3095 if (!$lmtree->isInTree($source_id)) {
3096 $lmtree->insertNode($source_id, $target_parent, $target_pos);
3099 if ($movecopy ==
"move") {
3100 foreach ($subnodes as $node) {
3101 if ($node[
"obj_id"] != $source_id) {
3102 $lmtree->insertNode($node[
"obj_id"], $node[
"parent"]);
3120 include_once
"./Modules/LearningModule/classes/class.ilLMPageObject.php";
3121 include_once
"./Modules/LearningModule/classes/class.ilLMPage.php";
3126 foreach ($pages as $page) {
3128 $cpage =
new ilLMPage($page[
"obj_id"]);
3130 $error = @$cpage->validateDom();
3133 $this->lng->loadLanguageModule(
"content");
3137 $mess.= $this->lng->txt(
"obj_pg") .
": " .
$title;
3138 $mess.=
'<div class="small">';
3140 $err_mess = implode($e,
" - ");
3141 if (!is_int(strpos($err_mess,
":0:"))) {
3142 $mess.= htmlentities($err_mess) .
"<br />";
3164 $a_import_into_help_module = 0
3172 $file = pathinfo($a_filename);
3175 ilUtil::moveUploadedFile(
3184 $subdir = basename(
$file[
"basename"],
"." .
$file[
"extension"]);
3211 $this->log->debug(
"import from directory " . $a_directory);
3214 $subdir = basename($a_directory);
3215 $xml_file = $a_directory .
"/" . $subdir .
".xml";
3218 if (!is_dir($a_directory)) {
3219 $this->log->error(
sprintf(
$lng->txt(
"cont_no_subdir_in_zip"), $subdir));
3220 return sprintf(
$lng->txt(
"cont_no_subdir_in_zip"), $subdir);
3224 if (!is_file($xml_file)) {
3225 $this->log->error(
sprintf(
$lng->txt(
"cont_zip_file_invalid"), $subdir .
"/" . $subdir .
".xml"));
3226 return sprintf(
$lng->txt(
"cont_zip_file_invalid"), $subdir .
"/" . $subdir .
".xml");
3230 $this->log->debug(
"import qti");
3231 $qti_file = $a_directory .
"/qti.xml";
3233 if (is_file($qti_file)) {
3234 include_once
"./Services/QTI/classes/class.ilQTIParser.php";
3235 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
3242 $result = $qtiParser->startParsing();
3243 $founditems = &$qtiParser->getFoundItems();
3245 if (count($founditems) > 0) {
3247 $qtiParser->setTestObject($testObj);
3248 $result = $qtiParser->startParsing();
3249 $qtis = array_merge($qtis, $qtiParser->getImportMapping());
3253 $this->log->debug(
"get ilContObjParser");
3254 include_once(
"./Modules/LearningModule/classes/class.ilContObjParser.php");
3256 $contParser =
new ilContObjParser($this, $xml_file, $subdir, $a_directory);
3258 $contParser->setImportMapping($a_mapping);
3259 $contParser->setQuestionMapping($qtis);
3260 $contParser->startParsing();
3265 $style_file = $a_directory .
"/style.xml";
3266 $style_zip_file = $a_directory .
"/style.zip";
3267 if (is_file($style_zip_file)) {
3268 require_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
3270 $style->import($style_zip_file);
3272 } elseif (is_file($style_file)) {
3273 require_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
3275 $style->import($style_file);
3286 include_once(
"./Modules/LearningModule/classes/class.ilLMPage.php");
3305 public function cloneObject($a_target_id, $a_copy_id = 0, $a_omit_tree =
false)
3307 $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
3314 if (!$cp_options->isRootNode($this->getRefId())) {
3315 $new_obj->setOnline($this->
getOnline());
3321 $new_obj->setLayout($this->
getLayout());
3335 $new_obj->setRating($this->
hasRating());
3345 $new_obj->createLMTree();
3348 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
3353 $new_id = $style_obj->ilClone();
3354 $new_obj->setStyleSheetId($new_id);
3365 $new_obj->setHeaderPage($new_page_header);
3368 $new_obj->setFooterPage($new_page_footer);
3373 include_once(
'Services/Tracking/classes/class.ilLPObjSettings.php');
3375 $obj_settings->cloneSettings($new_obj->getId());
3376 unset($obj_settings);
3379 include_once(
"./Services/Object/classes/class.ilObjectTranslation.php");
3381 $ot->copy($new_obj->getId());
3384 include_once
'./Modules/LearningModule/classes/class.ilLMMenuEditor.php';
3386 $menu->setObjId($this->
getId());
3388 $new_menu->setObjId($new_obj->getId());
3389 foreach ($menu->getMenuEntries() as $entry) {
3397 $new_menu->setTarget($entry[
"link"]);
3398 $new_menu->setTitle($entry[
"title"]);
3399 $new_menu->setLinkType($entry[
"type"]);
3400 $new_menu->setLinkRefId($entry[
"ref_id"]);
3401 $new_menu->create();
3416 $parent_id = $a_target_obj->lm_tree->readRootId();
3418 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
3419 include_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
3422 $chapters = $this->lm_tree->getChildsByType($this->lm_tree->readRootId(),
"st");
3423 $copied_nodes = array();
3425 foreach ($chapters as $chap) {
3441 foreach ($pages as $p) {
3442 if (!$this->lm_tree->isInTree($p[
"obj_id"])) {
3444 $target_item = $item->copy($a_target_obj);
3445 $copied_nodes[$item->getId()] = $target_item->getId();
3450 include_once
'./Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
3452 foreach ($copied_nodes as $old_id => $new_id) {
3455 $a_target_obj->getRefId() .
'_' . $new_id
3461 $a_target_obj->checkTree();
3463 return $copied_nodes;
3480 $set =
$ilDB->query(
3481 "SELECT * FROM lm_glossaries " .
3482 " WHERE lm_id = " .
$ilDB->quote($a_lm_id,
"integer")
3485 while ($rec =
$ilDB->fetchAssoc($set)) {
3486 $glos[] = $rec[
"glo_id"];
3500 include_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
3504 include_once(
"./Modules/LearningModule/classes/class.ilLMPage.php");
3508 $found_pages = array();
3509 foreach ($pages as $p) {
3511 $c = $pg->getXMLContent();
3512 foreach ($terms as
$t) {
3513 if (is_int(stripos($c,
$t[
"term"]))) {
3514 $found_pages[$p[
"id"]][
"terms"][] =
$t;
3515 if (!is_object($found_pages[$p[
"id"]][
"page"])) {
3516 $found_pages[$p[
"id"]][
"page"] = $pg;
3524 include_once(
"./Services/COPage/classes/class.ilPCParagraph.php");
3525 foreach ($found_pages as
$id => $fp) {
3542 if (!$a_as_obj_id && $a_id > 0 && $a_id == OH_REF_ID) {
3553 $this->rating = (bool) $a_value;
3563 $this->rating_pages = (bool) $a_value;
3574 parent::MDUpdateListener($a_element);
3576 include_once
'Services/MetaData/classes/class.ilMD.php';
3578 switch ($a_element) {
3580 include_once(
"./Services/Object/classes/class.ilObjectLP.php");
3583 $obj_lp->getCurrentMode(),
3586 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
3595 if (!is_object($md_gen = $md->getGeneral())) {
3599 include_once(
"./Services/Object/classes/class.ilObjectTranslation.php");
3601 if ($ot->getContentActivated()) {
3602 $ot->setDefaultTitle($md_gen->getTitle());
3604 foreach ($md_gen->getDescriptionIds() as
$id) {
3605 $md_des = $md_gen->getDescription(
$id);
3606 $ot->setDefaultDescription($md_des->getDescription());
3624 $dirs = array(
"xml",
"scorm");
3625 $export_files = array();
3627 include_once(
"./Services/Object/classes/class.ilObjectTranslation.php");
3629 if ($ot->getContentActivated()) {
3630 $langs = $ot->getLanguages();
3631 foreach ($langs as
$l => $ldata) {
3632 $dirs[] =
"html_" .
$l;
3634 $dirs[] =
"html_all";
3639 foreach ($dirs as $dir) {
3640 $type = explode(
"_", $dir);
3647 $export_files[] = array(
"type" =>
$type,
3655 return $export_files;
sprintf('%.4f', $callTime)
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
if(strpos( $jquery_path, './')===0) elseif(strpos($jquery_path, '.')===0) $mathJaxSetting
if(!isset( $_REQUEST[ 'ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
An exception for terminatinating execution or to throw for unit testing.
error($a_errmsg)
set error message @access public
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
static _checkCondition($a_id, $a_usr_id=0)
checks wether a single condition is fulfilled every trigger object type must implement a static metho...
static _getConditionsOfTarget($a_target_ref_id, $a_target_obj_id, $a_target_type="")
get all conditions of target object
Export class for content objects.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
static getLocalExplorerJsPath()
Get local path of explorer js.
static getLocalJsTreeJsPath()
Get local path of jsTree js.
static createHTMLExportDirs($a_target_dir)
Create html export directories.
static getDefinitionList($a_term_id)
static
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.
static _lookGlossaryTerm($term_id)
get glossary term
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.
static _getTargetsOfSource($a_source_type, $a_source_id, $a_source_lang="-")
Get all targets of a source object (e.g., a page)
Content Object (ILIAS native learning module / digilib book) Manifest export class.
static getInstance(&$a_content_obj, $a_id=0, $a_halt=true)
static getExportId($a_lm_id, $a_lmobj_id, $a_type="pg")
Get export ID.
static updateInternalLinks($a_copied_nodes, $a_parent_type="lm")
Update internal links, after multiple pages have been copied.
static _lookupTitle($a_obj_id)
Lookup title.
static putInTree($a_obj, $a_parent_id="", $a_target_node_id="")
put this object into content object tree
static _deleteAllObjectData(&$a_cobj)
delete all objects of content object (digi book / learning module)
static pasteTree( $a_target_lm, $a_item_id, $a_parent_id, $a_target, $a_insert_time, &$a_copied_nodes, $a_as_copy=false, $a_source_lm=null)
Paste item (tree) from clipboard to current lm.
static getPageList($lm_id)
static
Extension of ilPageObject for learning modules.
Class ilLMPresentationGUI.
const LP_MODE_COLLECTION_TLT
static _refreshStatus($a_obj_id, $a_users=null)
Set dirty.
static getLocalJsPaths()
Get paths of necessary js files.
static getLogger($a_component_id)
Get component logger.
static getInstance()
Singleton: get instance.
static commentsActivated($a_rep_obj_id, $a_obj_id, $a_obj_type)
Are comments activated for object?
static activateComments($a_rep_obj_id, $a_obj_id, $a_obj_type, $a_activate=true)
Activate notes feature.
Class ilObjContentObject.
exportXMLMediaObjects(&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
export media objects to xml (see ilias_co.dtd)
exportFO(&$a_xml_writer, $a_target_dir)
export object to fo
exportHTML($a_target_dir, $log, $a_zip_file=true, $a_export_format="html", $a_lang="")
export html package
exportHTMLGlossaryTerms(&$a_lm_gui, $a_target_dir)
export glossary terms
static lookupAutoGlossaries($a_lm_id)
Lookup auto glossaries.
putInTree($a_parent)
put content object in main tree
__construct($a_id=0, $a_call_by_reference=true)
Constructor @access public.
updateProperties()
Update content object properties.
setAutoGlossaries($a_val)
Set auto glossaries.
setTitle($a_title)
set title of content object
exportFileItems($a_target_dir, &$expLog)
export files of file itmes
exportHTMLPages(&$a_lm_gui, $a_target_dir, $a_lang="", $a_all_languages=false)
export all pages of learning module to html file
setActiveLMMenu($a_act_lm_menu)
getLayoutPerPage()
Get layout per page.
createProperties()
create new properties record
& getLMTree()
get content object tree
static _getNrLMsIndividualStyles()
get number of learning modules with individual styles
setForTranslation($a_val)
Set for translation.
static getAvailableLayouts()
get all available lm layouts
exportSCORM($a_target_dir, $log)
export scorm package
isActiveHistoryUserComments()
getRestrictForwardNavigation()
Get restrict forward navigation.
getDataDirectory()
get data directory
getHideHeaderFooterPrint()
Get hide header footer in print mode.
exportHTMLFile($a_target_dir, $a_file_id)
export file object
copyAllPagesAndChapters($a_target_obj, $a_copy_id=0)
Copy all pages and chapters.
setActiveDownloadsPublic($a_down)
update()
update complete object (meta data and properties)
getTOCMode()
get toc mode ("chapters" | "pages")
exportXMLPageObjects(&$a_xml_writer, $a_inst, &$expLog)
export page objects to xml (see ilias_co.dtd)
getExportDirectory($a_type="xml")
get export directory of lm
exportXMLMetaData(&$a_xml_writer)
export content objects meta data to xml (see ilias_co.dtd)
static _lookupRestrictForwardNavigation($a_obj_id)
Lookup forward restriction navigation.
static writeHeaderPage($a_lm_id, $a_page_id)
Write header page.
setActiveNumbering($a_num)
setImportDirectory($a_import_dir)
Set import directory for further use in ilContObjParser.
getForTranslation()
Get for translation.
importFromDirectory($a_directory, $a_validate=true, $a_mapping=null)
Import lm from directory.
getTitle()
get title of content object
static _lookupStoreTries($a_id)
Lookup disable default feedback.
createImportDirectory()
creates data directory for import files (data_dir/lm_data/lm_<id>/import, depending on data directory...
create($a_no_meta_data=false)
create content object
getAutoGlossaries()
Get auto glossaries.
static getSupplyingExportFiles($a_target_dir=".")
Get supplying export files.
static _lookupStyleSheetId($a_cont_obj_id)
lookup style sheet ID
isActivePreventGlossaryAppendix()
static _getNrLMsNoStyle()
get number of learning modules assigned no style
static writeFooterPage($a_lm_id, $a_page_id)
Write footer page.
static _getMissingPreconditionsTopChapter($cont_obj_ref_id, $cont_obj_id, $page_id)
get top chapter of page for that any precondition is missing
writeStyleSheetId($a_style_id)
write ID of assigned style sheet object to db
setPageHeader($a_pg_header=IL_CHAPTER_TITLE)
set page header mode
setHistoryUserComments($a_comm)
removeAutoGlossary($a_glo_id)
Remove auto glossary.
setProgressIcons($a_val)
Set progress icons.
setLayoutPerPage($a_val)
Set layout per page.
autoLinkGlossaryTerms($a_glo_ref_id)
Auto link glossary terms.
createLMTree()
create content object tree (that stores structure object hierarchie)
importFromZipFile( $a_tmp_file, $a_filename, $a_validate=true, $a_import_into_help_module=0)
Import lm from zip file.
getExportFiles()
get export files
getLayout()
get default page layout of content object (see directory layouts/)
getDescription()
get description of content object
exportHTMLMOB($a_target_dir, &$a_lm_gui, $a_mob_id, $a_frame, &$a_linked_mobs)
export media object to html
getPageHeader()
get page header mode (IL_CHAPTER_TITLE | IL_PAGE_TITLE | IL_NO_HEADER)
exportXMLProperties($a_xml_writer, &$expLog)
export properties of content object
static _lookup($a_obj_id, $a_field)
Lookup property.
getPublicAccessMode()
get public access mode ("complete" | "selected")
setRestrictForwardNavigation($a_val)
Set restrict forward navigation.
getImportDirectory()
get import directory of lm
setDisableDefaultFeedback($a_val)
Set disable default feedback for questions.
checkStructure()
Check tree (this has been copied from fixTree due to a bug fixing, should be reorganised)
addFirstChapterAndPage()
Add first chapter and page.
setImportId($a_id)
set import id
readProperties()
read content object properties
getStyleSheetId()
get ID of assigned style sheet object
setHideHeaderFooterPrint($a_val)
Set hide header footer in print mode.
exportXMLStructureObjects(&$a_xml_writer, $a_inst, &$expLog)
export structure objects to xml (see ilias_co.dtd)
MDUpdateListener($a_element)
Meta data update listener.
static hasSuccessorPage($a_cont_obj_id, $a_page_id)
checks if page has a successor page
static _lookupOnline($a_id)
check wether content object is online
static _checkPreconditionsOfPage($cont_ref_id, $cont_obj_id, $page_id)
checks wether the preconditions of a page are fulfilled or not
setDescription($a_description)
set description of content 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
executeDragDrop($source_id, $target_id, $first_child, $as_subitem=false, $movecopy="move")
Execute Drag Drop Action.
setPublicExportFile($a_type, $a_file)
specify public export file for type
validatePages()
Validate all pages.
static _lookupContObjIdByStyleId($a_style_id)
lookup style sheet ID
isActiveDownloadsPublic()
getStoreTries()
Get store tries.
read()
read data of content object
setActivePrintView($a_print)
exportFOStructureObjects(&$a_xml_writer)
export structure objects to fo
updateAutoGlossaries()
Update auto glossaries.
createExportDirectory($a_type="xml")
creates data directory for export files (data_dir/lm_data/lm_<id>/export, depending on data directory...
setStoreTries($a_val)
Set store tries.
setTOCMode($a_toc_mode="chapters")
set toc mode
getProgressIcons()
Get progress icons.
setPublicNotes($a_pub_notes)
static _getMissingPreconditionsOfPage($cont_ref_id, $cont_obj_id, $page_id)
gets all missing preconditions of page
setStyleSheetId($a_style_id)
set ID of assigned style sheet object
static isOnlineHelpModule($a_id, $a_as_obj_id=false)
Is module an online module.
static _getNrOfAssignedLMs($a_style_id)
gets the number of learning modules assigned to a content style
static _lookupDisableDefaultFeedback($a_id)
Lookup disable default feedback.
setActiveDownloads($a_down)
static _deleteStyleAssignments($a_style_id)
delete all style references to style
exportXML(&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
export object to xml (see ilias_co.dtd)
getPublicExportFiles()
Get public export files.
setActivePreventGlossaryAppendix($a_print)
setLayout($a_layout)
set default page layout
setPublicAccessMode($a_mode)
cloneObject($a_target_id, $a_copy_id=0, $a_omit_tree=false)
Clone learning module.
getImportId()
get import id
static _moveLMStyles($a_from_style, $a_to_style)
move learning modules from one style to another
getOfflineFiles($dir)
get offline files
getDisableDefaultFeedback()
Get disable default feedback for questions.
getPublicExportFile($a_type)
get public export file
static _getFilesOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_usage_lang="-")
get all files of an object
static _lookupStandard($a_id)
Lookup standard flag.
static getSyntaxStylePath()
get syntax style path
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static getInstance($a_obj_id)
static getInstance($a_obj_id)
Get instance.
Class ilObject Basic functions for all objects.
static _writeImportId($a_obj_id, $a_import_id)
write import id to db (static)
getType()
get object type @access public
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
deleteMetaData()
delete meta data entry
updateMetaData()
update meta data entry
createMetaData()
create meta data entry
getRefId()
get reference id @access public
cloneMetaData($target_obj)
Copy meta data.
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data@access public
getId()
get object id @access public
static _lookupType($a_id, $a_reference=false)
lookup object type
static autoLinkGlossariesPage($a_page, $a_terms)
Auto link glossary of whole page.
static resetInitialState()
Reset initial state (for exports)
static _getQuestionIdsForPage($a_parent_type, $a_page_id, $a_lang="-")
Get all questions of a page.
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.
static _handleImportRepositoryLinks($a_rep_import_id, $a_rep_type, $a_rep_ref_id)
Change targest of repository links.
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
static getAllPages($a_parent_type, $a_parent_id, $a_lang="-")
Get all pages for parent object.
static getLocalMediaElementJsPath()
Get local path of jQuery file.
static getFlashVideoPlayerDirectory()
Get flash video player directory.
static getLocalMediaElementCssPath()
Get local path of jQuery file.
static copyPlayerFilesToTargetDirectory($a_target_dir)
Copy css files to target dir.
special template class to simplify handling of ITX/PEAR
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
static getDataDir()
get data directory (outside webspace)
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static tf2yn($a_tf)
convert true/false to "y"/"n"
static getWebspaceDir($mode="filesystem")
get webspace directory
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file
static yn2tf($a_yn)
convert "y"/"n" to true/false
static makeDirParents($a_dir)
Create a new directory and all parent directories.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static getLocalPath($a_name="")
Get local path of a YUI js file.
static getLocaljQueryUIPath()
static getLocaljQueryPath()
static getLocalMaphilightPath()
Get local path of maphilight file.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
update($pash, $contents, Config $config)
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file
foreach($_POST as $key=> $value) $res