57 public function __construct($a_id = 0, $a_call_by_reference =
true)
61 $this->
user = $DIC->user();
62 $this->db =
$DIC->database();
63 $this->tree =
$DIC->repositoryTree();
64 $this->lng =
$DIC->language();
65 $this->
error = $DIC[
"ilErr"];
66 if (isset(
$DIC[
"ilLocator"])) {
67 $this->locator =
$DIC[
"ilLocator"];
75 $this->mob_ids = array();
76 $this->file_ids = array();
77 $this->q_ids = array();
83 public function create($a_no_meta_data =
false)
90 if (!$a_no_meta_data) {
108 # echo "Content<br>\n";
111 $this->lm_tree->setTableNames(
'lm_tree',
'lm_data');
112 $this->lm_tree->setTreeTablePK(
"lm_id");
118 "SELECT * FROM lm_glossaries " .
119 " WHERE lm_id = " .
$ilDB->quote($this->getId(),
"integer")
122 while ($rec =
$ilDB->fetchAssoc($set)) {
123 $glos[] = $rec[
"glo_id"];
137 return parent::getTitle();
145 parent::setTitle($a_title);
156 return parent::getDescription();
164 parent::setDescription($a_description);
176 $this->import_id = $a_id;
186 $this->layout_per_page = $a_val;
196 return $this->layout_per_page;
206 $this->disable_def_feedback = $a_val;
216 return $this->disable_def_feedback;
226 $this->progr_icons = $a_val;
236 return $this->progr_icons;
246 $this->store_tries = $a_val;
256 return $this->store_tries;
266 $this->restrict_forw_nav = $a_val;
276 return $this->restrict_forw_nav;
308 "DELETE FROM lm_glossaries WHERE " .
309 " lm_id = " .
$ilDB->quote($this->getId(),
"integer")
312 $ilDB->manipulate(
"INSERT INTO lm_glossaries " .
313 "(lm_id, glo_id) VALUES (" .
314 $ilDB->quote($this->getId(),
"integer") .
"," .
315 $ilDB->quote($glo_id,
"integer") .
324 public function import()
340 parent::putInTree($a_parent);
355 $this->lm_tree->setTreeTablePK(
"lm_id");
356 $this->lm_tree->setTableNames(
'lm_tree',
'lm_data');
357 $this->lm_tree->addTree($this->
getId(), 1);
367 $this->auto_glossaries = array();
368 if (is_array($a_val)) {
369 foreach ($a_val as $v) {
372 !in_array($v, $this->auto_glossaries)) {
373 $this->auto_glossaries[] = $v;
399 if ($g != $a_glo_id) {
415 $root_id = $this->lm_tree->getRootId();
419 $chap->setType(
"st");
420 $chap->setTitle(
$lng->txt(
"cont_new_chap"));
421 $chap->setLMId($this->
getId());
427 $page->setType(
"pg");
428 $page->setTitle(
$lng->txt(
"cont_new_page"));
429 $page->setLMId($this->
getId());
441 $this->for_translation = $a_val;
473 if (!is_writable($lm_data_dir)) {
474 $ilErr->raiseError(
"Content object Data Directory (" . $lm_data_dir
475 .
") not writeable.",
$ilErr->FATAL);
479 $lm_dir = $lm_data_dir .
"/lm_" . $this->
getId();
481 if (!@is_dir($lm_dir)) {
482 $ilErr->raiseError(
"Creation of Learning Module Directory failed.",
$ilErr->FATAL);
489 $ilErr->raiseError(
"Creation of Import Directory failed.",
$ilErr->FATAL);
499 "/lm_" . $this->
getId();
507 if (strlen($this->import_dir)) {
512 "/lm_" . $this->
getId() .
"/import";
528 $this->import_dir = $a_import_dir;
543 $lm_dir = $lm_data_dir .
"/lm_" . $this->
getId();
545 if (!@is_dir($lm_dir)) {
546 $ilErr->raiseError(
"Creation of Learning Module Directory failed.",
$ilErr->FATAL);
552 $export_dir = $lm_dir .
"/export_scorm";
556 if (substr($a_type, 0, 4) ==
"html") {
557 $export_dir = $lm_dir .
"/export_" . $a_type;
559 $export_dir = $lm_dir .
"/export";
565 if (!@is_dir($export_dir)) {
566 $ilErr->raiseError(
"Creation of Export Directory failed.",
$ilErr->FATAL);
581 if (substr($a_type, 0, 4) ==
"html") {
602 public function delete()
607 if (!parent::delete()) {
619 $this->lm_tree->removeTree($this->lm_tree->getTreeId());
625 $q =
"DELETE FROM content_object WHERE id = " .
627 $ilDB->manipulate($q);
630 $q =
"DELETE FROM lm_menu WHERE lm_id = " .
632 $ilDB->manipulate($q);
636 "DELETE FROM lm_glossaries WHERE " .
637 " lm_id = " .
$ilDB->quote($this->getId(),
"integer")
662 $this->layout = $a_layout;
678 $this->style_id = $a_style_id;
688 $q =
"UPDATE content_object SET " .
689 " stylesheet = " .
$ilDB->quote((
int) $a_style_id,
"integer") .
690 " WHERE id = " .
$ilDB->quote($this->
getId(),
"integer");
691 $ilDB->manipulate($q);
693 $this->style_id = $a_style_id;
709 "UPDATE content_object SET " .
710 " header_page = " .
$ilDB->quote($a_page_id,
"integer") .
711 " WHERE id = " .
$ilDB->quote($a_lm_id,
"integer")
728 "UPDATE content_object SET " .
729 " footer_page = " .
$ilDB->quote($a_page_id,
"integer") .
730 " WHERE id = " .
$ilDB->quote($a_lm_id,
"integer")
744 if ($a_from_style < 0) {
745 $q =
"SELECT stylesheet FROM content_object, style_data " .
746 " WHERE content_object.stylesheet = style_data.id " .
747 " AND style_data.standard = " .
$ilDB->quote(0,
"integer") .
748 " AND content_object.stylesheet > " .
$ilDB->quote(0,
"integer");
749 $style_set =
$ilDB->query($q);
750 while ($style_rec =
$ilDB->fetchAssoc($style_set)) {
752 $q =
"UPDATE content_object SET " .
753 " stylesheet = " .
$ilDB->quote((
int) $a_to_style,
"integer") .
754 " WHERE stylesheet = " .
$ilDB->quote($style_rec[
"stylesheet"],
"integer");
755 $ilDB->manipulate($q);
759 $style_obj->delete();
762 $q =
"UPDATE content_object SET " .
763 " stylesheet = " .
$ilDB->quote((
int) $a_to_style,
"integer") .
764 " WHERE stylesheet = " .
$ilDB->quote($a_from_style,
"integer");
765 $ilDB->manipulate($q);
776 protected static function _lookup($a_obj_id, $a_field)
781 $ilLog =
$DIC[
"ilLog"];
783 $q =
"SELECT " . $a_field .
" FROM content_object " .
784 " WHERE id = " .
$ilDB->quote($a_obj_id,
"integer");
789 return $rec[$a_field];
812 $q =
"SELECT stylesheet FROM content_object " .
813 " WHERE id = " .
$ilDB->quote($a_cont_obj_id,
"integer");
817 return $sheet[
"stylesheet"];
829 $q =
"SELECT id FROM content_object " .
830 " WHERE stylesheet = " .
$ilDB->quote($a_style_id,
"integer");
833 while ($cont =
$ilDB->fetchAssoc(
$res)) {
834 $obj_ids[] = $cont[
"id"];
848 $q =
"SELECT disable_def_feedback FROM content_object " .
849 " WHERE id = " .
$ilDB->quote($a_id,
"integer");
853 return $rec[
"disable_def_feedback"];
865 $q =
"SELECT store_tries FROM content_object " .
866 " WHERE id = " .
$ilDB->quote($a_id,
"integer");
870 return $rec[
"store_tries"];
885 $q =
"SELECT count(*) as cnt FROM content_object " .
886 " WHERE stylesheet = " .
$ilDB->quote($a_style_id,
"integer");
887 $cset =
$ilDB->query($q);
888 $crow =
$ilDB->fetchAssoc($cset);
890 return (
int) $crow[
"cnt"];
904 $q =
"SELECT count(*) as cnt FROM content_object, style_data " .
905 " WHERE stylesheet = style_data.id " .
906 " AND standard = " .
$ilDB->quote(0,
"integer");
907 $cset =
$ilDB->query($q);
908 $crow =
$ilDB->fetchAssoc($cset);
910 return (
int) $crow[
"cnt"];
922 $q =
"SELECT count(*) as cnt FROM content_object " .
923 " WHERE stylesheet = " .
$ilDB->quote(0,
"integer");
924 $cset =
$ilDB->query($q);
925 $crow =
$ilDB->fetchAssoc($cset);
927 return (
int) $crow[
"cnt"];
941 $q =
"UPDATE content_object SET " .
942 " stylesheet = " .
$ilDB->quote(0,
"integer") .
943 " WHERE stylesheet = " .
$ilDB->quote((
int) $a_style_id,
"integer");
945 $ilDB->manipulate($q);
963 $this->pg_header = $a_pg_header;
971 return $this->toc_mode;
979 return $this->public_access_mode;
989 $this->toc_mode = $a_toc_mode;
994 $this->lm_menu_active = $a_act_lm_menu;
999 return $this->lm_menu_active;
1004 $this->toc_active = $a_toc;
1009 return $this->toc_active;
1014 $this->numbering = $a_num;
1019 return $this->numbering;
1024 $this->print_view_active = $a_print;
1029 return $this->print_view_active;
1034 $this->prevent_glossary_appendix_active = $a_print;
1039 return $this->prevent_glossary_appendix_active;
1049 $this->hide_header_footer_print = $a_val;
1059 return $this->hide_header_footer_print;
1064 $this->downloads_active = $a_down;
1069 return $this->downloads_active;
1074 $this->downloads_public_active = $a_down;
1079 return $this->downloads_public_active;
1084 $this->pub_notes = $a_pub_notes;
1089 return $this->pub_notes;
1094 $this->clean_frames = $a_clean;
1099 return $this->clean_frames;
1104 $this->user_comments = $a_comm;
1109 $this->public_access_mode = $a_mode;
1114 return $this->user_comments;
1119 $this->header_page = $a_pg;
1124 return $this->header_page;
1129 $this->footer_page = $a_pg;
1134 return $this->footer_page;
1144 $q =
"SELECT * FROM content_object WHERE id = " .
1148 $this->
setLayout($lm_rec[
"default_layout"]);
1194 $q =
"UPDATE content_object SET " .
1195 " default_layout = " .
$ilDB->quote($this->
getLayout(),
"text") .
", " .
1216 " rating = " .
$ilDB->quote($this->
hasRating(),
"integer") .
", " .
1223 " WHERE id = " .
$ilDB->quote($this->
getId(),
"integer");
1224 $ilDB->manipulate($q);
1236 $q =
"INSERT INTO content_object (id) VALUES (" .
$ilDB->quote($this->
getId(),
"integer") .
")";
1237 $ilDB->manipulate($q);
1251 $dir = opendir(
"./Modules/LearningModule/layouts/lm");
1255 while ($file = readdir($dir)) {
1256 if ($file !=
"." && $file !=
".." && $file !=
"CVS" && $file !=
".svn") {
1258 if (@is_dir(
"./Modules/LearningModule/layouts/lm/" . $file)) {
1259 $layouts[$file] = $file;
1267 'toc2win' =>
'toc2win',
1268 'toc2windyn' =>
'toc2windyn',
1269 '1window' =>
'1window',
1270 '2window' =>
'2window',
1271 '3window' =>
'3window',
1272 'presentation' =>
'presentation',
1273 'fullscreen' =>
'fullscreen'
1276 foreach ($layouts as $l) {
1277 if (!in_array($l,
$ret)) {
1296 $lm_tree->setTableNames(
'lm_tree',
'lm_data');
1299 if (
$lm_tree->isInTree($page_id)) {
1301 foreach ($path as $node) {
1302 if ($node[
"type"] ==
"st") {
1319 $lm_tree->setTableNames(
'lm_tree',
'lm_data');
1323 if (
$lm_tree->isInTree($page_id)) {
1326 foreach ($path as $node) {
1327 if ($node[
"type"] ==
"st") {
1330 foreach ($tconds as $tcond) {
1349 $lm_tree->setTableNames(
'lm_tree',
'lm_data');
1353 if (
$lm_tree->isInTree($page_id)) {
1356 foreach ($path as $node) {
1357 if ($node[
"type"] ==
"st") {
1360 foreach ($tconds as $tcond) {
1363 return $node[
"child"];
1379 $tree->setTableNames(
'lm_tree',
'lm_data');
1380 $tree->setTreeTablePK(
"lm_id");
1381 if (
$tree->isInTree($a_page_id)) {
1382 $succ =
$tree->fetchSuccessorNode($a_page_id,
"pg");
1394 $tree->setTableNames(
'lm_tree',
'lm_data');
1395 $tree->setTreeTablePK(
"lm_id");
1397 $tree->checkTreeChilds();
1413 $set =
$ilDB->query(
1414 "SELECT DISTINCT l1.lm_id" .
1415 " FROM lm_tree l1" .
1416 " JOIN lm_tree l2 ON ( l1.child = l2.parent" .
1417 " AND l1.lm_id = l2.lm_id )" .
1418 " JOIN lm_data ON ( l1.child = lm_data.obj_id )" .
1419 " WHERE (l2.lft < l1.lft" .
1420 " OR l2.rgt > l1.rgt OR l2.lft > l1.rgt OR l2.rgt < l1.lft)" .
1421 " AND l1.lm_id = " .
$ilDB->quote($this->getId(),
"integer") .
1422 " ORDER BY lm_data.create_date DESC"
1424 if ($rec =
$ilDB->fetchAssoc($set)) {
1429 $set =
$ilDB->query(
"SELECT * FROM lm_tree WHERE lm_tree.lm_id = " .
$ilDB->quote($this->getId(),
"integer"));
1430 while ($node =
$ilDB->fetchAssoc($set)) {
1431 $q =
"SELECT * FROM lm_data WHERE obj_id = " .
1432 $ilDB->quote($node[
"child"],
"integer");
1433 $obj_set =
$ilDB->query($q);
1434 $obj_rec =
$ilDB->fetchAssoc($obj_set);
1436 $node_data =
$tree->getNodeData($node[
"child"]);
1437 $node_data[
"child"] = $node[
"child"];
1438 $tree->deleteTree($node_data);
1444 foreach ($nodes as $node) {
1445 $q =
"SELECT * FROM lm_data WHERE obj_id = " .
1446 $ilDB->quote($node[
"parent"],
"integer");
1447 $obj_set =
$ilDB->query($q);
1448 $obj_rec =
$ilDB->fetchAssoc($obj_set);
1449 if ($obj_rec[
"type"] ==
"pg") {
1450 $node_data =
$tree->getNodeData($node[
"child"]);
1451 if (
$tree->isInTree($node[
"child"])) {
1452 $tree->deleteTree($node_data);
1459 $set =
$ilDB->query(
"SELECT DISTINCT l1.lm_id" .
1460 " FROM lm_tree l1" .
1461 " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )" .
1462 " JOIN lm_data ON (l1.child = lm_data.obj_id)" .
1463 " WHERE l1.child <> 1" .
1464 " AND l1.lm_id <> lm_data.lm_id" .
1465 " AND l1.lm_id = " .
$ilDB->quote($this->getId(),
"integer"));
1466 if ($rec =
$ilDB->fetchAssoc($set)) {
1467 $set =
$ilDB->query(
"SELECT DISTINCT l1.child " .
1468 " FROM lm_tree l1" .
1469 " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )" .
1470 " JOIN lm_data ON (l1.child = lm_data.obj_id)" .
1471 " WHERE l1.child <> 1" .
1472 " AND l1.lm_id <> lm_data.lm_id" .
1473 " AND l1.lm_id = " .
$ilDB->quote($this->getId(),
"integer"));
1474 while ($rec =
$ilDB->fetchAssoc($set)) {
1477 if (is_object($cobj)) {
1478 if ($cobj->getType() ==
"pg") {
1480 $pg_copy = $cobj->copy($this);
1484 "UPDATE lm_tree SET " .
1485 " child = " .
$ilDB->quote($pg_copy->getId(),
"integer") .
1486 " WHERE child = " .
$ilDB->quote($cobj->getId(),
"integer") .
1487 " AND lm_id = " .
$ilDB->quote($this->getId(),
"integer")
1489 } elseif ($cobj->getType() ==
"st") {
1491 $st_copy = $cobj->copy($this);
1495 "UPDATE lm_tree SET " .
1496 " child = " .
$ilDB->quote($st_copy->getId(),
"integer") .
1497 " WHERE child = " .
$ilDB->quote($cobj->getId(),
"integer") .
1498 " AND lm_id = " .
$ilDB->quote($this->getId(),
"integer")
1503 "UPDATE lm_tree SET " .
1504 " parent = " .
$ilDB->quote($st_copy->getId(),
"integer") .
1505 " WHERE parent = " .
$ilDB->quote($cobj->getId(),
"integer") .
1506 " AND lm_id = " .
$ilDB->quote($this->getId(),
"integer")
1514 $set =
$ilDB->queryF(
1515 "SELECT * FROM lm_data " .
1516 " WHERE lm_id = %s AND type = %s",
1517 array(
"integer",
"text"),
1518 array($this->
getId(),
"pg")
1520 while ($rec =
$ilDB->fetchAssoc($set)) {
1523 $lm_page->setId($rec[
"obj_id"]);
1524 $lm_page->setParentId($this->
getId());
1543 $set =
$ilDB->query(
1544 "SELECT l1.child, l1.lft l1lft, l1.rgt l1rgt, l2.parent, l2.lft l2lft, l2.rgt l2rgt" .
1545 " FROM lm_tree l1" .
1546 " JOIN lm_tree l2 ON ( l1.child = l2.parent" .
1547 " AND l1.lm_id = l2.lm_id )" .
1548 " JOIN lm_data ON ( l1.child = lm_data.obj_id )" .
1549 " WHERE (l2.lft < l1.lft" .
1550 " OR l2.rgt > l1.rgt OR l2.lft > l1.rgt OR l2.rgt < l1.lft)" .
1551 " AND l1.lm_id = " .
$ilDB->quote($this->getId(),
"integer") .
1552 " ORDER BY lm_data.create_date DESC"
1554 while ($rec =
$ilDB->fetchAssoc($set)) {
1555 $issues[] =
"Tree numbering: " . print_r($rec,
true);
1559 $set =
$ilDB->query(
"SELECT * FROM lm_tree WHERE lm_tree.lm_id = " .
$ilDB->quote($this->getId(),
"integer"));
1560 while ($node =
$ilDB->fetchAssoc($set)) {
1561 $q =
"SELECT * FROM lm_data WHERE obj_id = " .
1562 $ilDB->quote($node[
"child"],
"integer");
1563 $obj_set =
$ilDB->query($q);
1564 $obj_rec =
$ilDB->fetchAssoc($obj_set);
1566 $issues[] =
"Tree entry without data entry: " . print_r($node,
true);
1572 foreach ($nodes as $node) {
1573 $q =
"SELECT * FROM lm_data WHERE obj_id = " .
1574 $ilDB->quote($node[
"parent"],
"integer");
1575 $obj_set =
$ilDB->query($q);
1576 $obj_rec =
$ilDB->fetchAssoc($obj_set);
1577 if ($obj_rec[
"type"] ==
"pg") {
1578 $node_data =
$tree->getNodeData($node[
"child"]);
1579 if (
$tree->isInTree($node[
"child"])) {
1580 $issues[] =
"Subtree with page parent: " . print_r($node_data,
true);
1587 $set =
$ilDB->query(
"SELECT DISTINCT l1.lm_id" .
1588 " FROM lm_tree l1" .
1589 " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )" .
1590 " JOIN lm_data ON (l1.child = lm_data.obj_id)" .
1591 " WHERE l1.child <> 1" .
1592 " AND l1.lm_id <> lm_data.lm_id" .
1593 " AND l1.lm_id = " .
$ilDB->quote($this->getId(),
"integer"));
1594 if ($rec =
$ilDB->fetchAssoc($set)) {
1595 $set =
$ilDB->query(
"SELECT DISTINCT l1.child " .
1596 " FROM lm_tree l1" .
1597 " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )" .
1598 " JOIN lm_data ON (l1.child = lm_data.obj_id)" .
1599 " WHERE l1.child <> 1" .
1600 " AND l1.lm_id <> lm_data.lm_id" .
1601 " AND l1.lm_id = " .
$ilDB->quote($this->getId(),
"integer"));
1602 while ($rec =
$ilDB->fetchAssoc($set)) {
1603 $set3 =
$ilDB->queryF(
1604 "SELECT * FROM lm_tree " .
1605 " WHERE child = %s ",
1607 array($rec[
"child"])
1609 while ($rec3 =
$ilDB->fetchAssoc($set3)) {
1610 $issues[] =
"Multi-reference item: " . print_r($rec3,
true);
1616 $set =
$ilDB->queryF(
1617 "SELECT * FROM lm_data " .
1618 " WHERE lm_id = %s AND type = %s",
1619 array(
"integer",
"text"),
1620 array($this->
getId(),
"pg")
1622 while ($rec =
$ilDB->fetchAssoc($set)) {
1624 $issues[] =
"Missing COPage: " . print_r($rec,
true);
1638 public function exportXML(&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
1643 $attrs[
"Type"] =
"LearningModule";
1646 $a_xml_writer->xmlStartTag(
"ContentObject", $attrs);
1653 $expLog->write(date(
"[y-m-d H:i:s] ") .
"Start Export Structure Objects");
1655 $expLog->write(date(
"[y-m-d H:i:s] ") .
"Finished Export Structure Objects");
1658 $expLog->write(date(
"[y-m-d H:i:s] ") .
"Start Export Page Objects");
1660 $expLog->write(date(
"[y-m-d H:i:s] ") .
"Finished Export Page Objects");
1663 $expLog->write(date(
"[y-m-d H:i:s] ") .
"Start Export Media Objects");
1665 $expLog->write(date(
"[y-m-d H:i:s] ") .
"Finished Export Media Objects");
1668 $expLog->write(date(
"[y-m-d H:i:s] ") .
"Start Export File Items");
1670 $expLog->write(date(
"[y-m-d H:i:s] ") .
"Finished Export File Items");
1673 if (count($this->q_ids) > 0) {
1674 $qti_file = fopen($a_target_dir .
"/qti.xml",
"w");
1676 fwrite($qti_file, $pool->questionsToXML($this->q_ids));
1682 $expLog->write(date(
"[y-m-d H:i:s] ") .
"Start Export Properties");
1684 $expLog->write(date(
"[y-m-d H:i:s] ") .
"Finished Export Properties");
1686 $a_xml_writer->xmlEndTag(
"ContentObject");
1698 $md2xml->setExportMode(
true);
1699 $md2xml->startExport();
1700 $a_xml_writer->appendXML($md2xml->getXML());
1711 $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
1712 foreach ($childs as $child) {
1713 if ($child[
"type"] !=
"st") {
1718 $structure_obj->exportXML($a_xml_writer, $a_inst, $expLog);
1719 unset($structure_obj);
1733 foreach ($pages as $page) {
1735 $expLog->write(date(
"[y-m-d H:i:s] ") .
"Page Object " . $page[
"obj_id"]);
1739 $page_obj->exportXML($a_xml_writer,
"normal", $a_inst);
1742 $mob_ids = $page_obj->getMediaObjectIDs();
1743 foreach ($mob_ids as $mob_id) {
1744 $this->mob_ids[$mob_id] = $mob_id;
1748 $file_ids = $page_obj->getFileItemIds();
1749 foreach ($file_ids as $file_id) {
1750 $this->file_ids[$file_id] = $file_id;
1754 $q_ids = $page_obj->getQuestionIds();
1755 foreach ($q_ids as $q_id) {
1756 $this->q_ids[$q_id] = $q_id;
1772 $linked_mobs = array();
1775 foreach ($this->mob_ids as $mob_id) {
1777 $expLog->write(date(
"[y-m-d H:i:s] ") .
"Media Object " . $mob_id);
1779 $media_obj->exportXML($a_xml_writer, $a_inst);
1780 $media_obj->exportFiles($a_target_dir);
1782 $lmobs = $media_obj->getLinkedMediaObjects($this->mob_ids);
1783 $linked_mobs = array_merge($linked_mobs, $lmobs);
1790 foreach ($linked_mobs as $mob_id) {
1792 $expLog->write(date(
"[y-m-d H:i:s] ") .
"Media Object " . $mob_id);
1794 $media_obj->exportXML($a_xml_writer, $a_inst);
1795 $media_obj->exportFiles($a_target_dir);
1807 foreach ($this->file_ids as $file_id) {
1808 $expLog->write(date(
"[y-m-d H:i:s] ") .
"File Item " . $file_id);
1809 $file_obj =
new ilObjFile($file_id,
false);
1810 $file_obj->export($a_target_dir);
1822 $a_xml_writer->xmlStartTag(
"Properties", $attrs);
1825 $attrs = array(
"Name" =>
"Layout",
"Value" => $this->
getLayout());
1826 $a_xml_writer->xmlElement(
"Property", $attrs);
1829 $attrs = array(
"Name" =>
"PageHeader",
"Value" => $this->
getPageHeader());
1830 $a_xml_writer->xmlElement(
"Property", $attrs);
1833 $attrs = array(
"Name" =>
"TOCMode",
"Value" => $this->
getTOCMode());
1834 $a_xml_writer->xmlElement(
"Property", $attrs);
1837 $attrs = array(
"Name" =>
"ActiveLMMenu",
"Value" =>
1839 $a_xml_writer->xmlElement(
"Property", $attrs);
1842 $attrs = array(
"Name" =>
"ActiveNumbering",
"Value" =>
1844 $a_xml_writer->xmlElement(
"Property", $attrs);
1847 $attrs = array(
"Name" =>
"ActiveTOC",
"Value" =>
1849 $a_xml_writer->xmlElement(
"Property", $attrs);
1852 $attrs = array(
"Name" =>
"ActivePrintView",
"Value" =>
1854 $a_xml_writer->xmlElement(
"Property", $attrs);
1860 $attrs = array(
"Name" =>
"CleanFrames",
"Value" =>
1862 $a_xml_writer->xmlElement(
"Property", $attrs);
1865 $attrs = array(
"Name" =>
"PublicNotes",
"Value" =>
1867 $a_xml_writer->xmlElement(
"Property", $attrs);
1870 $attrs = array(
"Name" =>
"HistoryUserComments",
"Value" =>
1872 $a_xml_writer->xmlElement(
"Property", $attrs);
1875 $attrs = array(
"Name" =>
"Rating",
"Value" =>
1877 $a_xml_writer->xmlElement(
"Property", $attrs);
1878 $attrs = array(
"Name" =>
"RatingPages",
"Value" =>
1880 $a_xml_writer->xmlElement(
"Property", $attrs);
1884 $attrs = array(
"Name" =>
"HeaderPage",
"Value" =>
1886 $a_xml_writer->xmlElement(
"Property", $attrs);
1891 $attrs = array(
"Name" =>
"FooterPage",
"Value" =>
1893 $a_xml_writer->xmlElement(
"Property", $attrs);
1897 $attrs = array(
"Name" =>
"LayoutPerPage",
"Value" =>
1899 $a_xml_writer->xmlElement(
"Property", $attrs);
1902 $attrs = array(
"Name" =>
"ProgressIcons",
"Value" =>
1904 $a_xml_writer->xmlElement(
"Property", $attrs);
1907 $attrs = array(
"Name" =>
"StoreTries",
"Value" =>
1909 $a_xml_writer->xmlElement(
"Property", $attrs);
1912 $attrs = array(
"Name" =>
"RestrictForwardNavigation",
"Value" =>
1914 $a_xml_writer->xmlElement(
"Property", $attrs);
1917 $attrs = array(
"Name" =>
"DisableDefaultFeedback",
"Value" =>
1919 $a_xml_writer->xmlElement(
"Property", $attrs);
1921 $a_xml_writer->xmlEndTag(
"Properties");
1931 $types = array(
"xml",
"html",
"scorm");
1933 foreach ($types as
$type) {
1936 if (!@is_dir($dir) or
1937 !is_writeable($dir)) {
1947 while ($entry = $cdir->read()) {
1948 if ($entry !=
"." and
1950 substr($entry, -4) ==
".zip" and
1951 preg_match(
"~^[0-9]{10}_{2}[0-9]+_{2}(lm_)*[0-9]+\.zip\$~", $entry)) {
1952 $file[$entry .
$type] = array(
"type" =>
$type,
"file" => $entry,
1953 "size" => filesize($dir .
"/" . $entry));
1975 $this->public_export_file[$a_type] = $a_file;
1987 return $this->public_export_file[$a_type];
1996 if (!@is_dir($dir) or
1997 !is_writeable($dir)) {
2008 while ($entry = $dir->read()) {
2009 if ($entry !=
"." and
2011 substr($entry, -4) ==
".pdf" and
2012 preg_match(
"~^[0-9]{10}_{2}[0-9]+_{2}(lm_)*[0-9]+\.pdf\$~", $entry)) {
2079 public function exportFO(&$a_xml_writer, $a_target_dir)
2083 $attrs[
"xmlns:fo"] =
"http://www.w3.org/1999/XSL/Format";
2084 $a_xml_writer->xmlStartTag(
"fo:root", $attrs);
2088 $a_xml_writer->xmlStartTag(
"fo:layout-master-set", $attrs);
2092 $attrs[
"master-name"] =
"DinA4";
2093 $attrs[
"page-height"] =
"29.7cm";
2094 $attrs[
"page-width"] =
"21cm";
2095 $attrs[
"margin-top"] =
"4cm";
2096 $attrs[
"margin-bottom"] =
"1cm";
2097 $attrs[
"margin-left"] =
"2.8cm";
2098 $attrs[
"margin-right"] =
"7.3cm";
2099 $a_xml_writer->xmlStartTag(
"fo:simple-page-master", $attrs);
2103 $attrs[
"margin-top"] =
"0cm";
2104 $attrs[
"margin-bottom"] =
"1.25cm";
2105 $a_xml_writer->xmlElement(
"fo:region-body", $attrs);
2109 $attrs[
"extent"] =
"1cm";
2110 $a_xml_writer->xmlElement(
"fo:region-before", $attrs);
2114 $attrs[
"extent"] =
"1cm";
2115 $a_xml_writer->xmlElement(
"fo:region-after", $attrs);
2118 $a_xml_writer->xmlEndTag(
"fo:simple-page-master");
2121 $a_xml_writer->xmlEndTag(
"fo:layout-master-set");
2125 $attrs[
"master-reference"] =
"DinA4";
2126 $a_xml_writer->xmlStartTag(
"fo:page-sequence", $attrs);
2130 $attrs[
"flow-name"] =
"xsl-region-body";
2131 $a_xml_writer->xmlStartTag(
"fo:flow", $attrs);
2138 $a_xml_writer->xmlEndTag(
"fo:flow");
2141 $a_xml_writer->xmlEndTag(
"fo:page-sequence");
2144 $a_xml_writer->xmlEndTag(
"fo:root");
2155 $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
2156 foreach ($childs as $child) {
2157 if ($child[
"type"] !=
"st") {
2162 $structure_obj->exportFO($a_xml_writer, $expLog);
2163 unset($structure_obj);
2171 $export_file = $cont_exp->buildExportFile();
2172 return $export_file;
2186 $lmtree->setTableNames(
'lm_tree',
'lm_data');
2187 $lmtree->setTreeTablePK(
"lm_id");
2190 $source_obj->setLMId($this->
getId());
2192 if (!$first_child) {
2194 $target_obj->setLMId($this->
getId());
2195 $target_parent = $lmtree->getParentId(
$target_id);
2199 if ($source_obj->getType() ==
"pg") {
2201 if ($lmtree->isInTree($source_obj->getId())) {
2202 $node_data = $lmtree->getNodeData($source_obj->getId());
2205 if ($movecopy ==
"move") {
2206 $parent_id = $lmtree->getParentId($source_obj->getId());
2207 $lmtree->deleteTree($node_data);
2211 $source_obj->getId(),
2220 $this->getType() .
":st"
2224 $new_page = $source_obj->copy();
2225 $source_id = $new_page->getId();
2226 $source_obj = $new_page;
2230 if (!$lmtree->isInTree($source_obj->getId())) {
2234 } elseif ($as_subitem) {
2237 $pg_childs = $lmtree->getChildsByType($parent,
"pg");
2238 if (count($pg_childs) != 0) {
2239 $target_pos = $pg_childs[count($pg_childs) - 1][
"obj_id"];
2243 $parent = $target_parent;
2247 $lmtree->insertNode(
2248 $source_obj->getId(),
2254 if ($movecopy ==
"move") {
2257 $source_obj->getId(),
2266 $this->getType() .
":st"
2274 if ($source_obj->getType() ==
"st") {
2276 $source_node = $lmtree->getNodeData($source_id);
2277 $subnodes = $lmtree->getSubtree($source_node);
2280 foreach ($subnodes as $subnode) {
2292 $pg_childs = $lmtree->getChildsByType($target_parent,
"pg");
2293 if (count($pg_childs) != 0) {
2294 $target_pos = $pg_childs[count($pg_childs) - 1][
"obj_id"];
2296 } elseif ($as_subitem) {
2299 $childs = $lmtree->getChilds($target_parent);
2300 if (count($childs) != 0) {
2301 $target_pos = $childs[count($childs) - 1][
"obj_id"];
2326 if ($movecopy ==
"move") {
2327 $lmtree->deleteTree($source_node);
2330 $new_chapter = $source_obj->copy($lmtree, $target_parent, $target_pos);
2333 if (!$lmtree->isInTree($source_id)) {
2334 $lmtree->insertNode($source_id, $target_parent, $target_pos);
2337 if ($movecopy ==
"move") {
2338 foreach ($subnodes as $node) {
2339 if ($node[
"obj_id"] != $source_id) {
2340 $lmtree->insertNode($node[
"obj_id"], $node[
"parent"]);
2361 foreach ($pages as $page) {
2363 $cpage =
new ilLMPage($page[
"obj_id"]);
2365 $error = @$cpage->validateDom();
2368 $this->lng->loadLanguageModule(
"content");
2372 $mess .= $this->lng->txt(
"obj_pg") .
": " .
$title;
2373 $mess .=
'<div class="small">';
2375 $err_mess = implode(
" - ",
$e);
2376 if (!is_int(strpos($err_mess,
":0:"))) {
2377 $mess .= htmlentities($err_mess) .
"<br />";
2399 $a_import_into_help_module = 0
2407 $file = pathinfo($a_filename);
2419 $subdir = basename($file[
"basename"],
"." . $file[
"extension"]);
2446 $this->log->debug(
"import from directory " . $a_directory);
2449 $subdir = basename($a_directory);
2450 $xml_file = $a_directory .
"/" . $subdir .
".xml";
2453 if (!is_dir($a_directory)) {
2454 $this->log->error(sprintf(
$lng->txt(
"cont_no_subdir_in_zip"), $subdir));
2455 return sprintf(
$lng->txt(
"cont_no_subdir_in_zip"), $subdir);
2459 if (!is_file($xml_file)) {
2460 $this->log->error(sprintf(
$lng->txt(
"cont_zip_file_invalid"), $subdir .
"/" . $subdir .
".xml"));
2461 return sprintf(
$lng->txt(
"cont_zip_file_invalid"), $subdir .
"/" . $subdir .
".xml");
2465 $this->log->debug(
"import qti");
2466 $qti_file = $a_directory .
"/qti.xml";
2468 if (is_file($qti_file)) {
2475 $result = $qtiParser->startParsing();
2476 $founditems = &$qtiParser->getFoundItems();
2478 if (count($founditems) > 0) {
2480 $qtiParser->setTestObject($testObj);
2481 $result = $qtiParser->startParsing();
2482 $qtis = array_merge($qtis, $qtiParser->getImportMapping());
2486 $this->log->debug(
"get ilContObjParser");
2488 $contParser =
new ilContObjParser($this, $xml_file, $subdir, $a_directory);
2490 $contParser->setImportMapping($a_mapping);
2491 $contParser->setQuestionMapping($qtis);
2492 $contParser->startParsing();
2497 $style_file = $a_directory .
"/style.xml";
2498 $style_zip_file = $a_directory .
"/style.zip";
2499 if (is_file($style_zip_file)) {
2501 $style->import($style_zip_file);
2503 } elseif (is_file($style_file)) {
2505 $style->import($style_file);
2534 public function cloneObject($a_target_id, $a_copy_id = 0, $a_omit_tree =
false)
2536 $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
2543 if (!$cp_options->isRootNode($this->getRefId())) {
2550 $new_obj->setLayout($this->
getLayout());
2564 $new_obj->setRating($this->
hasRating());
2574 $new_obj->createLMTree();
2581 $new_id = $style_obj->ilClone();
2582 $new_obj->setStyleSheetId($new_id);
2593 $new_obj->setHeaderPage($new_page_header);
2596 $new_obj->setFooterPage($new_page_footer);
2602 $obj_settings->cloneSettings($new_obj->getId());
2603 unset($obj_settings);
2607 $ot->copy($new_obj->getId());
2611 $menu->setObjId($this->
getId());
2613 $new_menu->setObjId($new_obj->getId());
2614 foreach ($menu->getMenuEntries() as $entry) {
2622 $new_menu->setTarget($entry[
"link"]);
2623 $new_menu->setTitle($entry[
"title"]);
2624 $new_menu->setLinkType($entry[
"type"]);
2625 $new_menu->setLinkRefId($entry[
"ref_id"]);
2626 $new_menu->create();
2641 $parent_id = $a_target_obj->lm_tree->readRootId();
2644 $chapters = $this->lm_tree->getChildsByType($this->lm_tree->readRootId(),
"st");
2645 $copied_nodes = array();
2647 foreach ($chapters as $chap) {
2663 foreach ($pages as $p) {
2664 if (!$this->lm_tree->isInTree($p[
"obj_id"])) {
2666 $target_item = $item->copy($a_target_obj);
2667 $copied_nodes[$item->getId()] = $target_item->getId();
2673 foreach ($copied_nodes as $old_id => $new_id) {
2674 $options->appendMapping(
2676 $a_target_obj->getRefId() .
'_' . $new_id
2682 $a_target_obj->checkTree();
2684 return $copied_nodes;
2701 $set =
$ilDB->query(
2702 "SELECT * FROM lm_glossaries " .
2703 " WHERE lm_id = " .
$ilDB->quote($a_lm_id,
"integer")
2706 while ($rec =
$ilDB->fetchAssoc($set)) {
2707 $glos[] = $rec[
"glo_id"];
2727 $found_pages = array();
2728 foreach ($pages as $p) {
2730 $c = $pg->getXMLContent();
2731 foreach ($terms as $t) {
2732 if (is_int(stripos(
$c, $t[
"term"]))) {
2733 $found_pages[$p[
"id"]][
"terms"][] = $t;
2734 if (!is_object($found_pages[$p[
"id"]][
"page"])) {
2735 $found_pages[$p[
"id"]][
"page"] = $pg;
2743 foreach ($found_pages as
$id => $fp) {
2760 if (!$a_as_obj_id && $a_id > 0 && $a_id == OH_REF_ID) {
2771 $this->rating = (bool) $a_value;
2781 $this->rating_pages = (bool) $a_value;
2792 parent::MDUpdateListener($a_element);
2794 switch ($a_element) {
2798 $obj_lp->getCurrentMode(),
2809 if (!is_object($md_gen = $md->getGeneral())) {
2814 if ($ot->getContentActivated()) {
2815 $ot->setDefaultTitle($md_gen->getTitle());
2817 foreach ($md_gen->getDescriptionIds() as
$id) {
2818 $md_des = $md_gen->getDescription(
$id);
2819 $ot->setDefaultDescription($md_des->getDescription());
2837 $dirs = array(
"xml",
"scorm");
2838 $export_files = array();
2841 if ($ot->getContentActivated()) {
2842 $langs = $ot->getLanguages();
2843 foreach ($langs as $l => $ldata) {
2844 $dirs[] =
"html_" . $l;
2846 $dirs[] =
"html_all";
2851 foreach ($dirs as $dir) {
2852 $type = explode(
"_", $dir);
2859 $export_files[] = array(
"type" =>
$type,
2867 return $export_files;
An exception for terminatinating execution or to throw for unit testing.
error($a_errmsg)
set error message @access public
static _checkCondition($condition, $a_usr_id=0)
checks wether a single condition is fulfilled every trigger object type must implement a static metho...
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 _getPersistedConditionsOfTarget($a_target_ref_id, $a_target_obj_id, $a_target_type="")
get all persisted conditions of target object
Export class for content objects.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
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 _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 getInstance(&$a_content_obj, $a_id=0, $a_halt=true)
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.
const LP_MODE_COLLECTION_TLT
static _refreshStatus($a_obj_id, $a_users=null)
Set dirty.
static getLogger($a_component_id)
Get component logger.
static commentsActivated($a_rep_obj_id, $a_obj_id, $a_obj_type, $a_news_id=0)
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 scorm package
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
setActiveLMMenu($a_act_lm_menu)
getLayoutPerPage()
Get layout per page.
createProperties()
create new properties record
static _getNrLMsIndividualStyles()
get number of learning modules with individual styles
setForTranslation($a_val)
Set for translation.
static getAvailableLayouts()
get all available lm layouts
isActiveHistoryUserComments()
getRestrictForwardNavigation()
Get restrict forward navigation.
getDataDirectory()
get data directory
getHideHeaderFooterPrint()
Get hide header footer in print mode.
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")
setPageHeader($a_pg_header=ilLMObject::CHAPTER_TITLE)
set page header mode
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 _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
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
getPageHeader()
get page header mode (ilLMOBject::CHAPTER_TITLE | ilLMOBject::PAGE_TITLE | ilLMOBject::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 _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
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.
getLMTree()
get content object tree
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 _lookupStandard($a_id)
Lookup standard flag.
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)
setOfflineStatus($a_status)
Set offline status.
deleteMetaData()
delete meta data entry
updateMetaData()
update meta data entry
getOfflineStatus()
Get offline status.
createMetaData()
create meta data entry
getRefId()
get reference id @access public
cloneMetaData($target_obj)
Copy meta data.
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 _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.
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 moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
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 unzip(string $path_to_zip_file, bool $overwrite_existing=false, bool $unpack_flat=false)
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 makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
foreach($_POST as $key=> $value) $res