25 protected \ILIAS\Notes\Service
$notes;
68 bool $a_call_by_reference =
true
71 $this->main_tpl =
$DIC->ui()->mainTemplate();
73 $this->
user = $DIC->user();
74 $this->db =
$DIC->database();
75 $this->tree =
$DIC->repositoryTree();
76 $this->
lng = $DIC->language();
77 $this->
error = $DIC[
"ilErr"];
78 if (isset(
$DIC[
"ilLocator"])) {
79 $this->
locator = $DIC[
"ilLocator"];
82 $this->notes =
$DIC->notes();
93 $this->mob_ids = array();
94 $this->file_ids = array();
95 $this->q_ids = array();
96 $cs =
$DIC->contentStyle();
97 $this->content_style_domain = $cs->domain();
104 bool $a_no_meta_data =
false
107 $id = parent::create();
111 if (!$a_no_meta_data) {
128 $this->readProperties();
132 "SELECT * FROM lm_glossaries " .
133 " WHERE lm_id = " .
$ilDB->quote($this->getId(),
"integer")
136 while ($rec =
$ilDB->fetchAssoc($set)) {
137 $glos[] = $rec[
"glo_id"];
139 $this->setAutoGlossaries($glos);
144 $this->layout_per_page = $a_val;
149 return $this->layout_per_page;
157 $this->disable_def_feedback = $a_val;
162 return $this->disable_def_feedback;
167 $this->progr_icons = $a_val;
172 return $this->progr_icons;
177 $this->store_tries = $a_val;
182 return $this->store_tries;
187 $this->restrict_forw_nav = $a_val;
192 return $this->restrict_forw_nav;
197 return $this->lm_tree;
202 $this->updateMetaData();
204 $this->updateProperties();
205 $this->updateAutoGlossaries();
215 "DELETE FROM lm_glossaries WHERE " .
216 " lm_id = " .
$ilDB->quote($this->getId(),
"integer")
218 foreach ($this->getAutoGlossaries() as $glo_id) {
219 $ilDB->manipulate(
"INSERT INTO lm_glossaries " .
220 "(lm_id, glo_id) VALUES (" .
221 $ilDB->quote($this->getId(),
"integer") .
"," .
222 $ilDB->quote($glo_id,
"integer") .
231 public function import():
void
239 $this->lm_tree->addTree($this->
getId(), 1);
244 $this->auto_glossaries = array();
245 if (is_array($a_val)) {
246 foreach ($a_val as $v) {
249 !in_array($v, $this->auto_glossaries)) {
250 $this->auto_glossaries[] = $v;
258 return $this->auto_glossaries;
264 foreach ($this->getAutoGlossaries() as $g) {
265 if ($g != $a_glo_id) {
269 $this->setAutoGlossaries($glo_ids);
272 public function addFirstChapterAndPage(): void
277 $root_id = $this->lm_tree->getRootId();
281 $chap->setType(
"st");
282 $chap->setTitle(
$lng->txt(
"cont_new_chap"));
283 $chap->setLMId($this->
getId());
291 $page->setType(
"pg");
292 $page->setTitle(
$lng->txt(
"cont_new_page"));
293 $page->setLMId($this->
getId());
303 $this->for_translation = $a_val;
308 return $this->for_translation;
313 return $this->lm_tree;
327 if (!is_writable($lm_data_dir)) {
328 $ilErr->raiseError(
"Content object Data Directory (" . $lm_data_dir
329 .
") not writeable.",
$ilErr->FATAL);
333 $lm_dir = $lm_data_dir .
"/lm_" . $this->
getId();
335 if (!is_dir($lm_dir)) {
336 $ilErr->raiseError(
"Creation of Learning Module Directory failed.",
$ilErr->FATAL);
340 $import_dir = $lm_dir .
"/import";
342 if (!is_dir($import_dir)) {
343 $ilErr->raiseError(
"Creation of Import Directory failed.",
$ilErr->FATAL);
350 "/lm_" . $this->
getId();
355 if (strlen($this->import_dir)) {
356 return $this->import_dir;
360 "/lm_" . $this->
getId() .
"/import";
361 if (is_dir($import_dir)) {
369 $this->import_dir = $a_import_dir;
379 string $a_type =
"xml"
385 $lm_dir = $lm_data_dir .
"/lm_" . $this->
getId();
387 if (!is_dir($lm_dir)) {
388 $ilErr->raiseError(
"Creation of Learning Module Directory failed.",
$ilErr->FATAL);
393 if (substr($a_type, 0, 4) ==
"html") {
394 $export_dir = $lm_dir .
"/export_" . $a_type;
396 $export_dir = $lm_dir .
"/export";
402 if (!is_dir($export_dir)) {
403 $ilErr->raiseError(
"Creation of Export Directory failed.",
$ilErr->FATAL);
408 string $a_type =
"xml"
412 if (substr($a_type, 0, 4) ==
"html") {
431 public function delete():
bool
436 if (!parent::delete()) {
446 $this->deleteMetaData();
450 $this->lm_tree->removeTree($this->lm_tree->getTreeId());
456 $q =
"DELETE FROM content_object WHERE id = " .
458 $ilDB->manipulate($q);
461 $q =
"DELETE FROM lm_menu WHERE lm_id = " .
463 $ilDB->manipulate($q);
467 "DELETE FROM lm_glossaries WHERE " .
468 " lm_id = " .
$ilDB->quote($this->getId(),
"integer")
477 return $this->layout;
482 $this->layout = $a_layout;
494 "UPDATE content_object SET " .
495 " header_page = " .
$ilDB->quote($a_page_id,
"integer") .
496 " WHERE id = " .
$ilDB->quote($a_lm_id,
"integer")
509 "UPDATE content_object SET " .
510 " footer_page = " .
$ilDB->quote($a_page_id,
"integer") .
511 " WHERE id = " .
$ilDB->quote($a_lm_id,
"integer")
527 if ($a_from_style < 0) {
528 $q =
"SELECT stylesheet FROM content_object, style_data " .
529 " WHERE content_object.stylesheet = style_data.id " .
530 " AND style_data.standard = " .
$ilDB->quote(0,
"integer") .
531 " AND content_object.stylesheet > " .
$ilDB->quote(0,
"integer");
532 $style_set =
$ilDB->query($q);
533 while ($style_rec =
$ilDB->fetchAssoc($style_set)) {
535 $q =
"UPDATE content_object SET " .
536 " stylesheet = " .
$ilDB->quote($a_to_style,
"integer") .
537 " WHERE stylesheet = " .
$ilDB->quote($style_rec[
"stylesheet"],
"integer");
538 $ilDB->manipulate($q);
542 $style_obj->delete();
545 $q =
"UPDATE content_object SET " .
546 " stylesheet = " .
$ilDB->quote($a_to_style,
"integer") .
547 " WHERE stylesheet = " .
$ilDB->quote($a_from_style,
"integer");
548 $ilDB->manipulate($q);
560 $q =
"SELECT " . $a_field .
" FROM content_object " .
561 " WHERE id = " .
$ilDB->quote($a_obj_id,
"integer");
566 return $rec[$a_field];
572 return self::_lookup($a_obj_id,
"restrict_forw_nav");
581 $q =
"SELECT stylesheet FROM content_object " .
582 " WHERE id = " .
$ilDB->quote($a_cont_obj_id,
"integer");
586 return (
int) $sheet[
"stylesheet"];
595 $q =
"SELECT id FROM content_object " .
596 " WHERE stylesheet = " .
$ilDB->quote($a_style_id,
"integer");
599 while ($cont =
$ilDB->fetchAssoc(
$res)) {
600 $obj_ids[] = (
int) $cont[
"id"];
611 $q =
"SELECT disable_def_feedback FROM content_object " .
612 " WHERE id = " .
$ilDB->quote($a_id,
"integer");
616 return (
bool) ($rec[
"disable_def_feedback"] ??
false);
625 $q =
"SELECT store_tries FROM content_object " .
626 " WHERE id = " .
$ilDB->quote($a_id,
"integer");
630 return (
bool) ($rec[
"store_tries"] ??
false);
643 $q =
"SELECT count(*) as cnt FROM content_object " .
644 " WHERE stylesheet = " .
$ilDB->quote($a_style_id,
"integer");
645 $cset =
$ilDB->query($q);
646 $crow =
$ilDB->fetchAssoc($cset);
648 return (
int) ($crow[
"cnt"] ?? 0);
662 $q =
"SELECT count(*) as cnt FROM content_object, style_data " .
663 " WHERE stylesheet = style_data.id " .
664 " AND standard = " .
$ilDB->quote(0,
"integer");
665 $cset =
$ilDB->query($q);
666 $crow =
$ilDB->fetchAssoc($cset);
668 return (
int) $crow[
"cnt"];
680 $q =
"SELECT count(*) as cnt FROM content_object " .
681 " WHERE stylesheet = " .
$ilDB->quote(0,
"integer");
682 $cset =
$ilDB->query($q);
683 $crow =
$ilDB->fetchAssoc($cset);
685 return (
int) $crow[
"cnt"];
698 $q =
"UPDATE content_object SET " .
699 " stylesheet = " .
$ilDB->quote(0,
"integer") .
700 " WHERE stylesheet = " .
$ilDB->quote($a_style_id,
"integer");
702 $ilDB->manipulate($q);
710 return $this->pg_header;
720 $this->pg_header = $a_pg_header;
728 return $this->toc_mode;
736 return $this->public_access_mode;
743 public function setTOCMode(
string $a_toc_mode =
"chapters"): void
745 $this->toc_mode = $a_toc_mode;
750 $this->lm_menu_active = $a_act_lm_menu;
755 return $this->lm_menu_active;
760 $this->toc_active = $a_toc;
765 return $this->toc_active;
770 $this->numbering = $a_num;
775 return $this->numbering;
780 $this->print_view_active = $a_print;
785 return $this->print_view_active;
790 $this->prevent_glossary_appendix_active = $a_print;
795 return $this->prevent_glossary_appendix_active;
803 $this->hide_header_footer_print = $a_val;
808 return $this->hide_header_footer_print;
813 $this->downloads_active = $a_down;
818 return $this->downloads_active;
823 $this->downloads_public_active = $a_down;
828 return $this->downloads_public_active;
833 $this->pub_notes = $a_pub_notes;
838 return $this->pub_notes;
843 $this->clean_frames = $a_clean;
848 return $this->clean_frames;
853 $this->user_comments = $a_comm;
858 $this->public_access_mode = $a_mode;
863 return $this->user_comments;
868 $this->header_page = $a_pg;
873 return $this->header_page;
878 $this->footer_page = $a_pg;
883 return $this->footer_page;
890 $q =
"SELECT * FROM content_object WHERE id = " .
894 $this->setLayout((
string) $lm_rec[
"default_layout"]);
895 $this->setPageHeader((
string) $lm_rec[
"page_header"]);
896 $this->setTOCMode((
string) $lm_rec[
"toc_mode"]);
898 $this->setActiveNumbering(
ilUtil::yn2tf($lm_rec[
"numbering"]));
899 $this->setActivePrintView(
ilUtil::yn2tf($lm_rec[
"print_view_active"]));
900 $this->setActivePreventGlossaryAppendix(
ilUtil::yn2tf($lm_rec[
"no_glo_appendix"]));
901 $this->setHideHeaderFooterPrint((
bool) $lm_rec[
"hide_head_foot_print"]);
902 $this->setActiveDownloads(
ilUtil::yn2tf($lm_rec[
"downloads_active"]));
903 $this->setActiveDownloadsPublic(
ilUtil::yn2tf($lm_rec[
"downloads_public_active"]));
904 $this->setActiveLMMenu(
ilUtil::yn2tf($lm_rec[
"lm_menu_active"]));
905 $this->setCleanFrames(
ilUtil::yn2tf($lm_rec[
"clean_frames"]));
906 $this->setHeaderPage((
int) $lm_rec[
"header_page"]);
907 $this->setFooterPage((
int) $lm_rec[
"footer_page"]);
908 $this->setHistoryUserComments(
ilUtil::yn2tf($lm_rec[
"hist_user_comments"]));
909 $this->setPublicAccessMode((
string) $lm_rec[
"public_access_mode"]);
910 $this->setPublicExportFile(
"xml", (
string) $lm_rec[
"public_xml_file"]);
911 $this->setPublicExportFile(
"html", (
string) $lm_rec[
"public_html_file"]);
912 $this->setLayoutPerPage((
bool) $lm_rec[
"layout_per_page"]);
913 $this->setRating((
bool) $lm_rec[
"rating"]);
914 $this->setRatingPages((
bool) $lm_rec[
"rating_pages"]);
915 $this->setDisableDefaultFeedback((
bool) $lm_rec[
"disable_def_feedback"]);
916 $this->setProgressIcons((
bool) $lm_rec[
"progr_icons"]);
917 $this->setStoreTries((
bool) $lm_rec[
"store_tries"]);
918 $this->setRestrictForwardNavigation((
bool) $lm_rec[
"restrict_forw_nav"]);
921 $this->setPublicNotes($this->notes->domain()->commentsActive($this->getId()));
923 $this->setForTranslation((
bool) $lm_rec[
"for_translation"]);
931 if ($this->getLayoutPerPage()) {
932 $this->setCleanFrames(
true);
935 $q =
"UPDATE content_object SET " .
936 " default_layout = " .
$ilDB->quote($this->getLayout(),
"text") .
", " .
937 " page_header = " .
$ilDB->quote($this->getPageHeader(),
"text") .
"," .
938 " toc_mode = " .
$ilDB->quote($this->getTOCMode(),
"text") .
"," .
940 " numbering = " .
$ilDB->quote(
ilUtil::tf2yn($this->isActiveNumbering()),
"text") .
"," .
941 " print_view_active = " .
$ilDB->quote(
ilUtil::tf2yn($this->isActivePrintView()),
"text") .
"," .
942 " no_glo_appendix = " .
$ilDB->quote(
ilUtil::tf2yn($this->isActivePreventGlossaryAppendix()),
"text") .
"," .
943 " hide_head_foot_print = " .
$ilDB->quote($this->getHideHeaderFooterPrint(),
"integer") .
"," .
944 " downloads_active = " .
$ilDB->quote(
ilUtil::tf2yn($this->isActiveDownloads()),
"text") .
"," .
945 " downloads_public_active = " .
$ilDB->quote(
ilUtil::tf2yn($this->isActiveDownloadsPublic()),
"text") .
"," .
946 " clean_frames = " .
$ilDB->quote(
ilUtil::tf2yn($this->cleanFrames()),
"text") .
"," .
947 " hist_user_comments = " .
$ilDB->quote(
ilUtil::tf2yn($this->isActiveHistoryUserComments()),
"text") .
"," .
948 " public_access_mode = " .
$ilDB->quote($this->getPublicAccessMode(),
"text") .
"," .
949 " public_xml_file = " .
$ilDB->quote($this->getPublicExportFile(
"xml"),
"text") .
"," .
950 " public_html_file = " .
$ilDB->quote($this->getPublicExportFile(
"html"),
"text") .
"," .
951 " header_page = " .
$ilDB->quote($this->getHeaderPage(),
"integer") .
"," .
952 " footer_page = " .
$ilDB->quote($this->getFooterPage(),
"integer") .
"," .
953 " lm_menu_active = " .
$ilDB->quote(
ilUtil::tf2yn($this->isActiveLMMenu()),
"text") .
", " .
954 " layout_per_page = " .
$ilDB->quote($this->getLayoutPerPage(),
"integer") .
", " .
955 " rating = " .
$ilDB->quote($this->hasRating(),
"integer") .
", " .
956 " rating_pages = " .
$ilDB->quote($this->hasRatingPages(),
"integer") .
", " .
957 " disable_def_feedback = " .
$ilDB->quote($this->getDisableDefaultFeedback(),
"integer") .
", " .
958 " progr_icons = " .
$ilDB->quote($this->getProgressIcons(),
"integer") .
", " .
959 " store_tries = " .
$ilDB->quote($this->getStoreTries(),
"integer") .
", " .
960 " restrict_forw_nav = " .
$ilDB->quote($this->getRestrictForwardNavigation(),
"integer") .
", " .
961 " for_translation = " .
$ilDB->quote((
int) $this->getForTranslation(),
"integer") .
" " .
962 " WHERE id = " .
$ilDB->quote($this->
getId(),
"integer");
963 $ilDB->manipulate($q);
965 $this->notes->domain()->activateComments($this->
getId(), $this->publicNotes());
975 $this->db->insert(
"content_object", [
976 "id" => [
"integer", $this->
getId()],
981 $this->notes->domain()->activateComments($this->
getId());
983 $this->readProperties();
992 $dir = opendir(
"./Modules/LearningModule/layouts/lm");
996 while ($file = readdir($dir)) {
997 if ($file !=
"." && $file !=
".." && $file !=
"CVS" && $file !=
".svn") {
999 if (is_dir(
"./Modules/LearningModule/layouts/lm/" . $file)) {
1000 $layouts[$file] = $file;
1008 'toc2win' =>
'toc2win',
1009 'toc2windyn' =>
'toc2windyn',
1010 '1window' =>
'1window',
1011 '2window' =>
'2window',
1012 '3window' =>
'3window',
1013 'presentation' =>
'presentation',
1014 'fullscreen' =>
'fullscreen'
1017 foreach ($layouts as $l) {
1018 if (!in_array($l, $ret)) {
1034 $lm_tree = new
ilTree($cont_obj_id);
1038 if ($lm_tree->
isInTree($page_id)) {
1040 foreach (
$path as $node) {
1041 if ($node[
"type"] ==
"st") {
1060 $lm_tree = new
ilTree($cont_obj_id);
1065 if ($lm_tree->
isInTree($page_id)) {
1068 foreach (
$path as $node) {
1069 if ($node[
"type"] ==
"st") {
1072 foreach ($tconds as $tcond) {
1089 int $cont_obj_ref_id,
1093 $lm_tree = new
ilTree($cont_obj_id);
1097 if ($lm_tree->
isInTree($page_id)) {
1100 foreach (
$path as $node) {
1101 if ($node[
"type"] ==
"st") {
1104 foreach ($tconds as $tcond) {
1107 return (
int) $node[
"child"];
1124 $tree = new
ilTree($a_cont_obj_id);
1126 $tree->setTreeTablePK(
"lm_id");
1127 if ($tree->isInTree($a_page_id)) {
1128 $succ = $tree->fetchSuccessorNode($a_page_id,
"pg");
1143 $tree->checkTreeChilds();
1150 $tree = $this->getLMTree();
1155 $set =
$ilDB->query(
1156 "SELECT DISTINCT l1.lm_id" .
1157 " FROM lm_tree l1" .
1158 " JOIN lm_tree l2 ON ( l1.child = l2.parent" .
1159 " AND l1.lm_id = l2.lm_id )" .
1160 " JOIN lm_data ON ( l1.child = lm_data.obj_id )" .
1161 " WHERE (l2.lft < l1.lft" .
1162 " OR l2.rgt > l1.rgt OR l2.lft > l1.rgt OR l2.rgt < l1.lft)" .
1163 " AND l1.lm_id = " .
$ilDB->quote($this->getId(),
"integer") .
1164 " ORDER BY lm_data.create_date DESC"
1166 if ($rec =
$ilDB->fetchAssoc($set)) {
1171 $set =
$ilDB->query(
"SELECT * FROM lm_tree WHERE lm_tree.lm_id = " .
$ilDB->quote($this->getId(),
"integer"));
1172 while ($node =
$ilDB->fetchAssoc($set)) {
1173 $q =
"SELECT * FROM lm_data WHERE obj_id = " .
1174 $ilDB->quote($node[
"child"],
"integer");
1175 $obj_set =
$ilDB->query($q);
1176 $obj_rec =
$ilDB->fetchAssoc($obj_set);
1178 $node_data = $tree->getNodeData($node[
"child"]);
1179 $node_data[
"child"] = $node[
"child"];
1180 $tree->deleteTree($node_data);
1185 $nodes = $tree->getSubTree($tree->getNodeData($tree->getRootId()));
1186 foreach ($nodes as $node) {
1187 $q =
"SELECT * FROM lm_data WHERE obj_id = " .
1188 $ilDB->quote($node[
"parent"],
"integer");
1189 $obj_set =
$ilDB->query($q);
1190 $obj_rec =
$ilDB->fetchAssoc($obj_set);
1191 if (($obj_rec[
"type"] ??
"") ==
"pg") {
1192 $node_data = $tree->getNodeData($node[
"child"]);
1193 if ($tree->isInTree($node[
"child"])) {
1194 $tree->deleteTree($node_data);
1201 $set =
$ilDB->query(
"SELECT DISTINCT l1.lm_id" .
1202 " FROM lm_tree l1" .
1203 " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )" .
1204 " JOIN lm_data ON (l1.child = lm_data.obj_id)" .
1205 " WHERE l1.child <> 1" .
1206 " AND l1.lm_id <> lm_data.lm_id" .
1207 " AND l1.lm_id = " .
$ilDB->quote($this->getId(),
"integer"));
1208 if ($rec =
$ilDB->fetchAssoc($set)) {
1209 $set =
$ilDB->query(
"SELECT DISTINCT l1.child " .
1210 " FROM lm_tree l1" .
1211 " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )" .
1212 " JOIN lm_data ON (l1.child = lm_data.obj_id)" .
1213 " WHERE l1.child <> 1" .
1214 " AND l1.lm_id <> lm_data.lm_id" .
1215 " AND l1.lm_id = " .
$ilDB->quote($this->getId(),
"integer"));
1216 while ($rec =
$ilDB->fetchAssoc($set)) {
1219 if (is_object($cobj)) {
1220 if ($cobj->getType() ==
"pg") {
1222 $pg_copy = $cobj->copy($this->lm);
1226 "UPDATE lm_tree SET " .
1227 " child = " .
$ilDB->quote($pg_copy->getId(),
"integer") .
1228 " WHERE child = " .
$ilDB->quote($cobj->getId(),
"integer") .
1229 " AND lm_id = " .
$ilDB->quote($this->getId(),
"integer")
1231 } elseif ($cobj->getType() ==
"st") {
1233 $st_copy = $cobj->copy($this->lm);
1237 "UPDATE lm_tree SET " .
1238 " child = " .
$ilDB->quote($st_copy->getId(),
"integer") .
1239 " WHERE child = " .
$ilDB->quote($cobj->getId(),
"integer") .
1240 " AND lm_id = " .
$ilDB->quote($this->getId(),
"integer")
1245 "UPDATE lm_tree SET " .
1246 " parent = " .
$ilDB->quote($st_copy->getId(),
"integer") .
1247 " WHERE parent = " .
$ilDB->quote($cobj->getId(),
"integer") .
1248 " AND lm_id = " .
$ilDB->quote($this->getId(),
"integer")
1256 $set =
$ilDB->queryF(
1257 "SELECT * FROM lm_data " .
1258 " WHERE lm_id = %s AND type = %s",
1259 array(
"integer",
"text"),
1260 array($this->
getId(),
"pg")
1262 while ($rec =
$ilDB->fetchAssoc($set)) {
1265 $lm_page->setId($rec[
"obj_id"]);
1266 $lm_page->setParentId($this->
getId());
1267 $lm_page->create(
false);
1280 $tree = $this->getLMTree();
1285 $set =
$ilDB->query(
1286 "SELECT l1.child, l1.lft l1lft, l1.rgt l1rgt, l2.parent, l2.lft l2lft, l2.rgt l2rgt" .
1287 " FROM lm_tree l1" .
1288 " JOIN lm_tree l2 ON ( l1.child = l2.parent" .
1289 " AND l1.lm_id = l2.lm_id )" .
1290 " JOIN lm_data ON ( l1.child = lm_data.obj_id )" .
1291 " WHERE (l2.lft < l1.lft" .
1292 " OR l2.rgt > l1.rgt OR l2.lft > l1.rgt OR l2.rgt < l1.lft)" .
1293 " AND l1.lm_id = " .
$ilDB->quote($this->getId(),
"integer") .
1294 " ORDER BY lm_data.create_date DESC"
1296 while ($rec =
$ilDB->fetchAssoc($set)) {
1297 $issues[] =
"Tree numbering: " . print_r($rec,
true);
1301 $set =
$ilDB->query(
"SELECT * FROM lm_tree WHERE lm_tree.lm_id = " .
$ilDB->quote($this->getId(),
"integer"));
1302 while ($node =
$ilDB->fetchAssoc($set)) {
1303 $q =
"SELECT * FROM lm_data WHERE obj_id = " .
1304 $ilDB->quote($node[
"child"],
"integer");
1305 $obj_set =
$ilDB->query($q);
1306 $obj_rec =
$ilDB->fetchAssoc($obj_set);
1308 $issues[] =
"Tree entry without data entry: " . print_r($node,
true);
1313 $nodes = $tree->getSubTree($tree->getNodeData($tree->getRootId()));
1314 foreach ($nodes as $node) {
1315 $q =
"SELECT * FROM lm_data WHERE obj_id = " .
1316 $ilDB->quote($node[
"parent"],
"integer");
1317 $obj_set =
$ilDB->query($q);
1318 $obj_rec =
$ilDB->fetchAssoc($obj_set);
1319 if (($obj_rec[
"type"] ??
"") ==
"pg") {
1320 $node_data = $tree->getNodeData($node[
"child"]);
1321 if ($tree->isInTree($node[
"child"])) {
1322 $issues[] =
"Subtree with page parent: " . print_r($node_data,
true);
1329 $set =
$ilDB->query(
"SELECT DISTINCT l1.lm_id" .
1330 " FROM lm_tree l1" .
1331 " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )" .
1332 " JOIN lm_data ON (l1.child = lm_data.obj_id)" .
1333 " WHERE l1.child <> 1" .
1334 " AND l1.lm_id <> lm_data.lm_id" .
1335 " AND l1.lm_id = " .
$ilDB->quote($this->getId(),
"integer"));
1336 if ($rec =
$ilDB->fetchAssoc($set)) {
1337 $set =
$ilDB->query(
"SELECT DISTINCT l1.child " .
1338 " FROM lm_tree l1" .
1339 " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )" .
1340 " JOIN lm_data ON (l1.child = lm_data.obj_id)" .
1341 " WHERE l1.child <> 1" .
1342 " AND l1.lm_id <> lm_data.lm_id" .
1343 " AND l1.lm_id = " .
$ilDB->quote($this->getId(),
"integer"));
1344 while ($rec =
$ilDB->fetchAssoc($set)) {
1345 $set3 =
$ilDB->queryF(
1346 "SELECT * FROM lm_tree " .
1347 " WHERE child = %s ",
1349 array($rec[
"child"])
1351 while ($rec3 =
$ilDB->fetchAssoc($set3)) {
1352 $issues[] =
"Multi-reference item: " . print_r($rec3,
true);
1358 $set =
$ilDB->queryF(
1359 "SELECT * FROM lm_data " .
1360 " WHERE lm_id = %s AND type = %s",
1361 array(
"integer",
"text"),
1362 array($this->
getId(),
"pg")
1364 while ($rec =
$ilDB->fetchAssoc($set)) {
1366 $issues[] =
"Missing COPage: " . print_r($rec,
true);
1377 string $a_target_dir,
1381 switch ($this->getType()) {
1383 $attrs[
"Type"] =
"LearningModule";
1386 $a_xml_writer->
xmlStartTag(
"ContentObject", $attrs);
1389 $this->exportXMLMetaData($a_xml_writer);
1393 $expLog->
write(date(
"[y-m-d H:i:s] ") .
"Start Export Structure Objects");
1394 $this->exportXMLStructureObjects($a_xml_writer, $a_inst, $expLog);
1395 $expLog->
write(date(
"[y-m-d H:i:s] ") .
"Finished Export Structure Objects");
1398 $expLog->
write(date(
"[y-m-d H:i:s] ") .
"Start Export Page Objects");
1399 $this->exportXMLPageObjects($a_xml_writer, $a_inst, $expLog);
1400 $expLog->
write(date(
"[y-m-d H:i:s] ") .
"Finished Export Page Objects");
1403 $expLog->
write(date(
"[y-m-d H:i:s] ") .
"Start Export Media Objects");
1404 $this->exportXMLMediaObjects($a_xml_writer, $a_inst, $a_target_dir, $expLog);
1405 $expLog->
write(date(
"[y-m-d H:i:s] ") .
"Finished Export Media Objects");
1408 $expLog->
write(date(
"[y-m-d H:i:s] ") .
"Start Export File Items");
1409 $this->exportFileItems($a_target_dir, $expLog);
1410 $expLog->
write(date(
"[y-m-d H:i:s] ") .
"Finished Export File Items");
1413 if (count($this->q_ids) > 0) {
1414 $qti_file = fopen($a_target_dir .
"/qti.xml",
"w");
1416 fwrite($qti_file, $pool->questionsToXML($this->q_ids));
1422 $expLog->
write(date(
"[y-m-d H:i:s] ") .
"Start Export Properties");
1423 $this->exportXMLProperties($a_xml_writer, $expLog);
1424 $expLog->
write(date(
"[y-m-d H:i:s] ") .
"Finished Export Properties");
1426 $a_xml_writer->
xmlEndTag(
"ContentObject");
1432 $md2xml = new
ilMD2XML($this->
getId(), 0, $this->getType());
1434 $md2xml->startExport();
1435 $a_xml_writer->
appendXML($md2xml->getXML());
1443 $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
1444 foreach ($childs as $child) {
1445 if ($child[
"type"] !=
"st") {
1450 $structure_obj->exportXML($a_xml_writer, $a_inst, $expLog);
1451 unset($structure_obj);
1461 foreach ($pages as $page) {
1463 $expLog->
write(date(
"[y-m-d H:i:s] ") .
"Page Object " . $page[
"obj_id"]);
1467 $page_obj->exportXML($a_xml_writer,
"normal", $a_inst);
1470 $mob_ids = $page_obj->getMediaObjectIds();
1471 foreach ($mob_ids as $mob_id) {
1472 $this->mob_ids[$mob_id] = $mob_id;
1476 $file_ids = $page_obj->getFileItemIds();
1477 foreach ($file_ids as $file_id) {
1478 $this->file_ids[$file_id] = $file_id;
1482 $q_ids = $page_obj->getQuestionIds();
1483 foreach ($q_ids as $q_id) {
1484 $this->q_ids[$q_id] = $q_id;
1495 string $a_target_dir,
1498 $linked_mobs = array();
1501 foreach ($this->mob_ids as $mob_id) {
1503 $expLog->
write(date(
"[y-m-d H:i:s] ") .
"Media Object " . $mob_id);
1505 $media_obj->exportXML($a_xml_writer, $a_inst);
1506 $media_obj->exportFiles($a_target_dir);
1508 $lmobs = $media_obj->getLinkedMediaObjects($this->mob_ids);
1509 $linked_mobs = array_merge($linked_mobs, $lmobs);
1516 foreach ($linked_mobs as $mob_id) {
1518 $expLog->
write(date(
"[y-m-d H:i:s] ") .
"Media Object " . $mob_id);
1520 $media_obj->exportXML($a_xml_writer, $a_inst);
1521 $media_obj->exportFiles($a_target_dir);
1528 string $a_target_dir,
1531 foreach ($this->file_ids as $file_id) {
1532 $expLog->
write(date(
"[y-m-d H:i:s] ") .
"File Item " . $file_id);
1533 $file_obj =
new ilObjFile($file_id,
false);
1534 $file_obj->export($a_target_dir);
1547 $attrs = array(
"Name" =>
"Layout",
"Value" => $this->getLayout());
1548 $a_xml_writer->
xmlElement(
"Property", $attrs);
1551 $attrs = array(
"Name" =>
"PageHeader",
"Value" => $this->getPageHeader());
1552 $a_xml_writer->
xmlElement(
"Property", $attrs);
1555 $attrs = array(
"Name" =>
"TOCMode",
"Value" => $this->getTOCMode());
1556 $a_xml_writer->
xmlElement(
"Property", $attrs);
1559 $attrs = array(
"Name" =>
"ActiveLMMenu",
"Value" =>
1561 $a_xml_writer->
xmlElement(
"Property", $attrs);
1564 $attrs = array(
"Name" =>
"ActiveNumbering",
"Value" =>
1566 $a_xml_writer->
xmlElement(
"Property", $attrs);
1569 $attrs = array(
"Name" =>
"ActiveTOC",
"Value" =>
1571 $a_xml_writer->
xmlElement(
"Property", $attrs);
1574 $attrs = array(
"Name" =>
"ActivePrintView",
"Value" =>
1576 $a_xml_writer->
xmlElement(
"Property", $attrs);
1582 $attrs = array(
"Name" =>
"CleanFrames",
"Value" =>
1584 $a_xml_writer->
xmlElement(
"Property", $attrs);
1587 $attrs = array(
"Name" =>
"PublicNotes",
"Value" =>
1589 $a_xml_writer->
xmlElement(
"Property", $attrs);
1592 $attrs = array(
"Name" =>
"HistoryUserComments",
"Value" =>
1594 $a_xml_writer->
xmlElement(
"Property", $attrs);
1597 $attrs = array(
"Name" =>
"Rating",
"Value" =>
1599 $a_xml_writer->
xmlElement(
"Property", $attrs);
1600 $attrs = array(
"Name" =>
"RatingPages",
"Value" =>
1602 $a_xml_writer->
xmlElement(
"Property", $attrs);
1605 if ($this->getHeaderPage() > 0) {
1606 $attrs = array(
"Name" =>
"HeaderPage",
"Value" =>
1607 "il_" .
IL_INST_ID .
"_pg_" . $this->getHeaderPage());
1608 $a_xml_writer->
xmlElement(
"Property", $attrs);
1612 if ($this->getFooterPage() > 0) {
1613 $attrs = array(
"Name" =>
"FooterPage",
"Value" =>
1614 "il_" .
IL_INST_ID .
"_pg_" . $this->getFooterPage());
1615 $a_xml_writer->
xmlElement(
"Property", $attrs);
1619 $attrs = array(
"Name" =>
"LayoutPerPage",
"Value" =>
1620 $this->getLayoutPerPage());
1621 $a_xml_writer->
xmlElement(
"Property", $attrs);
1624 $attrs = array(
"Name" =>
"ProgressIcons",
"Value" =>
1625 $this->getProgressIcons());
1626 $a_xml_writer->
xmlElement(
"Property", $attrs);
1629 $attrs = array(
"Name" =>
"StoreTries",
"Value" =>
1630 $this->getStoreTries());
1631 $a_xml_writer->
xmlElement(
"Property", $attrs);
1634 $attrs = array(
"Name" =>
"RestrictForwardNavigation",
"Value" =>
1635 $this->getRestrictForwardNavigation());
1636 $a_xml_writer->
xmlElement(
"Property", $attrs);
1639 $attrs = array(
"Name" =>
"DisableDefaultFeedback",
"Value" =>
1640 $this->getDisableDefaultFeedback());
1641 $a_xml_writer->
xmlElement(
"Property", $attrs);
1650 $types = array(
"xml",
"html");
1652 foreach ($types as
$type) {
1653 $dir = $this->getExportDirectory(
$type);
1655 if (!is_dir($dir) or
1656 !is_writeable($dir)) {
1666 while ($entry = $cdir->read()) {
1667 if ($entry !=
"." and
1669 substr($entry, -4) ==
".zip" and
1670 preg_match(
"~^[0-9]{10}_{2}[0-9]+_{2}(lm_)*[0-9]+\.zip\$~", $entry)) {
1671 $file[$entry .
$type] = array(
"type" =>
$type,
"file" => $entry,
1672 "size" => filesize($dir .
"/" . $entry));
1692 $this->public_export_file[$a_type] = $a_file;
1697 return $this->public_export_file[$a_type] ??
"";
1704 if (!is_dir($dir) or
1705 !is_writeable($dir)) {
1716 while ($entry = $dir->read()) {
1717 if ($entry !=
"." and
1719 substr($entry, -4) ==
".pdf" and
1720 preg_match(
"~^[0-9]{10}_{2}[0-9]+_{2}(lm_)*[0-9]+\.pdf\$~", $entry)) {
1735 string $a_target_dir
1737 throw new
ilException(
"Export FO is deprecated.");
1809 $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
1810 foreach ($childs as $child) {
1811 if ($child[
"type"] !=
"st") {
1816 $structure_obj->exportFO($a_xml_writer);
1817 unset($structure_obj);
1825 bool $as_subitem =
false,
1826 string $movecopy =
"move"
1832 $lmtree->setTableNames(
'lm_tree',
'lm_data');
1833 $lmtree->setTreeTablePK(
"lm_id");
1836 $source_obj->setLMId($this->
getId());
1838 if (!$first_child) {
1840 $target_obj->setLMId($this->
getId());
1841 $target_parent = $lmtree->getParentId(
$target_id);
1845 if ($source_obj->getType() ==
"pg") {
1847 if ($lmtree->isInTree($source_obj->getId())) {
1848 $node_data = $lmtree->getNodeData($source_obj->getId());
1851 if ($movecopy ==
"move") {
1852 $parent_id = $lmtree->getParentId($source_obj->getId());
1853 $lmtree->deleteTree($node_data);
1857 $source_obj->getId(),
1860 $this->getType() .
":pg"
1866 $this->getType() .
":st"
1870 $new_page = $source_obj->copy($this->lm);
1871 $source_id = $new_page->getId();
1872 $source_obj = $new_page;
1876 if (!$lmtree->isInTree($source_obj->getId())) {
1880 } elseif ($as_subitem) {
1883 $pg_childs = $lmtree->getChildsByType($parent,
"pg");
1884 if (count($pg_childs) != 0) {
1885 $target_pos = $pg_childs[count($pg_childs) - 1][
"obj_id"];
1889 $parent = $target_parent;
1893 $lmtree->insertNode(
1894 $source_obj->getId(),
1900 if ($movecopy ==
"move") {
1903 $source_obj->getId(),
1906 $this->getType() .
":pg"
1912 $this->getType() .
":st"
1920 if ($source_obj->getType() ==
"st") {
1922 $source_node = $lmtree->getNodeData($source_id);
1923 $subnodes = $lmtree->getSubTree($source_node);
1926 foreach ($subnodes as $subnode) {
1938 $pg_childs = $lmtree->getChildsByType($target_parent,
"pg");
1939 if (count($pg_childs) != 0) {
1940 $target_pos = $pg_childs[count($pg_childs) - 1][
"obj_id"];
1942 } elseif ($as_subitem) {
1945 $childs = $lmtree->getChilds($target_parent);
1946 if (count($childs) != 0) {
1947 $target_pos = $childs[count($childs) - 1][
"obj_id"];
1952 if ($movecopy ==
"move") {
1953 $lmtree->deleteTree($source_node);
1956 throw new ilException(
"ilObjContentObject: Not implemented");
1960 if (!$lmtree->isInTree($source_id)) {
1961 $lmtree->insertNode($source_id, $target_parent, $target_pos);
1964 foreach ($subnodes as $node) {
1965 if ($node[
"obj_id"] != $source_id) {
1966 $lmtree->insertNode($node[
"obj_id"], $node[
"parent"]);
1986 foreach ($pages as $page) {
1988 $cpage =
new ilLMPage($page[
"obj_id"]);
1990 $error = $cpage->validateDom();
1993 $this->
lng->loadLanguageModule(
"content");
1994 $this->main_tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"cont_import_validation_errors"));
1997 $mess .= $this->
lng->txt(
"obj_pg") .
": " . $title;
1998 $mess .=
'<div class="small">';
1999 foreach ($error as
$e) {
2000 $err_mess = implode(
" - ",
$e);
2001 if (!is_int(strpos($err_mess,
":0:"))) {
2002 $mess .= htmlentities($err_mess) .
"<br />";
2014 public function cloneObject(
int $target_id,
int $copy_id = 0,
bool $omit_tree =
false): ?
ilObject
2017 $new_obj = parent::cloneObject(
$target_id, $copy_id, $omit_tree);
2018 $this->cloneMetaData($new_obj);
2024 if (!$cp_options->isRootNode($this->getRefId())) {
2025 $new_obj->setOfflineStatus($this->getOfflineStatus());
2029 $new_obj->setDescription($this->getDescription());
2030 $new_obj->setLayoutPerPage($this->getLayoutPerPage());
2031 $new_obj->setLayout($this->getLayout());
2032 $new_obj->setTOCMode($this->getTOCMode());
2033 $new_obj->setActiveLMMenu($this->isActiveLMMenu());
2034 $new_obj->setActiveTOC($this->isActiveTOC());
2035 $new_obj->setActiveNumbering($this->isActiveNumbering());
2036 $new_obj->setActivePrintView($this->isActivePrintView());
2037 $new_obj->setActivePreventGlossaryAppendix($this->isActivePreventGlossaryAppendix());
2038 $new_obj->setActiveDownloads($this->isActiveDownloads());
2039 $new_obj->setActiveDownloadsPublic($this->isActiveDownloadsPublic());
2040 $new_obj->setPublicNotes($this->publicNotes());
2041 $new_obj->setCleanFrames($this->cleanFrames());
2042 $new_obj->setHistoryUserComments($this->isActiveHistoryUserComments());
2043 $new_obj->setPublicAccessMode($this->getPublicAccessMode());
2044 $new_obj->setPageHeader($this->getPageHeader());
2045 $new_obj->setRating($this->hasRating());
2046 $new_obj->setRatingPages($this->hasRatingPages());
2047 $new_obj->setDisableDefaultFeedback($this->getDisableDefaultFeedback());
2048 $new_obj->setProgressIcons($this->getProgressIcons());
2049 $new_obj->setStoreTries($this->getStoreTries());
2050 $new_obj->setRestrictForwardNavigation($this->getRestrictForwardNavigation());
2051 $new_obj->setAutoGlossaries($this->getAutoGlossaries());
2055 $new_obj->createLMTree();
2058 $style = $this->content_style_domain->styleForObjId($this->
getId());
2059 $style->cloneTo($new_obj->getId());
2064 $copied_nodes = $this->copyAllPagesAndChapters($new_obj, $copy_id);
2067 if ($this->getHeaderPage() > 0 && ($new_page_header = $copied_nodes[$this->getHeaderPage()]) > 0) {
2068 $new_obj->setHeaderPage($new_page_header);
2070 if ($this->getFooterPage() > 0 && ($new_page_footer = $copied_nodes[$this->getFooterPage()]) > 0) {
2071 $new_obj->setFooterPage($new_page_footer);
2077 $obj_settings->cloneSettings($new_obj->getId());
2078 unset($obj_settings);
2082 $ot->copy($new_obj->getId());
2086 $menu->setObjId($this->
getId());
2088 $new_menu->setObjId($new_obj->getId());
2089 foreach ($menu->getMenuEntries() as $entry) {
2097 $new_menu->setTarget($entry[
"link"]);
2098 $new_menu->setTitle($entry[
"title"]);
2099 $new_menu->setLinkType($entry[
"type"]);
2100 $new_menu->setLinkRefId($entry[
"ref_id"]);
2101 $new_menu->create();
2113 $parent_id = $a_target_obj->lm_tree->readRootId();
2117 $chapters = $this->lm_tree->getChildsByType($this->lm_tree->readRootId(),
"st");
2118 $copied_nodes = array();
2120 foreach ($chapters as $chap) {
2121 $cid = ilLMObject::pasteTree(
2136 foreach ($pages as $p) {
2137 if (!$this->lm_tree->isInTree($p[
"obj_id"])) {
2139 $target_item = $item->copy($a_target_obj);
2140 $copied_nodes[$item->getId()] = $target_item->getId();
2146 foreach ($copied_nodes as $old_id => $new_id) {
2147 $options->appendMapping(
2148 $this->getRefId() .
'_' . $old_id,
2149 $a_target_obj->
getRefId() .
'_' . $new_id
2157 return $copied_nodes;
2168 $set =
$ilDB->query(
2169 "SELECT * FROM lm_glossaries " .
2170 " WHERE lm_id = " .
$ilDB->quote($a_lm_id,
"integer")
2173 while ($rec =
$ilDB->fetchAssoc($set)) {
2174 $glos[] = $rec[
"glo_id"];
2189 $found_pages = array();
2190 foreach ($pages as $p) {
2192 $c = $pg->getXMLContent();
2193 foreach ($terms as $t) {
2194 if (is_int(stripos(
$c, $t[
"term"]))) {
2195 $found_pages[$p[
"id"]][
"terms"][] = $t;
2196 if (!is_object($found_pages[$p[
"id"]][
"page"] ??
null)) {
2197 $found_pages[$p[
"id"]][
"page"] = $pg;
2205 foreach ($found_pages as
$id => $fp) {
2221 bool $a_as_obj_id =
false
2223 if (!$a_as_obj_id && $a_id > 0 && $a_id === (
int) OH_REF_ID) {
2234 $this->rating = $a_value;
2239 return $this->rating;
2244 $this->rating_pages = $a_value;
2249 return $this->rating_pages;
2256 switch ($a_element) {
2260 $obj_lp->getCurrentMode(),
2270 $md =
new ilMD($this->
getId(), 0, $this->getType());
2271 if (!is_object($md_gen = $md->getGeneral())) {
2276 if ($ot->getContentActivated()) {
2277 $ot->setDefaultTitle($md_gen->getTitle());
2279 foreach ($md_gen->getDescriptionIds() as
$id) {
2280 $md_des = $md_gen->getDescription(
$id);
2281 $ot->setDefaultDescription($md_des->getDescription());
2298 $dirs = array(
"xml");
2299 $export_files = array();
2302 if ($ot->getContentActivated()) {
2303 $langs = $ot->getLanguages();
2304 foreach ($langs as $l => $ldata) {
2305 $dirs[] =
"html_" . $l;
2307 $dirs[] =
"html_all";
2312 foreach ($dirs as $dir) {
2313 $type = explode(
"_", $dir);
2315 if ($this->getPublicExportFile(
$type) !=
"") {
2316 if (is_file($this->getExportDirectory($dir) .
"/" .
2317 $this->getPublicExportFile(
$type))) {
2318 $size = filesize($this->getExportDirectory($dir) .
"/" .
2319 $this->getPublicExportFile(
$type));
2320 $export_files[] = array(
"type" =>
$type,
2322 "file" => $this->getPublicExportFile(
$type),
2328 return $export_files;
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
static _getPersistedConditionsOfTarget(int $a_target_ref_id, int $a_target_obj_id, string $a_target_type="")
get all persisted conditions of target object
static _checkCondition(array $condition, int $a_usr_id=0)
checks wether a single condition is fulfilled every trigger object type must implement a static metho...
static _checkAllConditionsOfTarget(int $a_target_ref_id, int $a_target_id, string $a_target_type="", int $a_usr_id=0)
checks wether all conditions of a target object are fulfilled
static _getInstance(int $a_copy_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
static makeDir(string $a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static getDataDir()
get data directory (outside webspace)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _createEntry(int $a_obj_id, string $a_action, array $a_info_params=[], string $a_obj_type="", string $a_user_comment="", bool $a_update_last=false)
Creates a new history entry for an object.
static getInstance(ilObjLearningModule $a_content_obj, int $a_id=0, bool $a_halt=true)
static _lookupTitle(int $a_obj_id)
static updateInternalLinks(array $a_copied_nodes, string $a_parent_type="lm")
Update internal links, after multiple pages have been copied.
static putInTree(ilLMObject $a_obj, int $a_parent_id=0, int $a_target_node_id=0)
put this object into content object tree
static _deleteAllObjectData(ilObjLearningModule $a_cobj)
delete all objects of content object (digi book / learning module)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getPageList(int $lm_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const LP_MODE_COLLECTION_TLT
static _refreshStatus(int $a_obj_id, ?array $a_users=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
write(string $a_msg, $a_log_level=null)
logging
static getLogger(string $a_component_id)
Get component logger.
setExportMode(bool $a_export_mode=true)
static isInfoEnabled(int $obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getMissingPreconditionsTopChapter(int $cont_obj_ref_id, int $cont_obj_id, int $page_id)
get top chapter of page for that any precondition is missing
array $public_export_file
static writeFooterPage(int $a_lm_id, int $a_page_id)
setPublicAccessMode(string $a_mode)
ILIAS Notes Service $notes
exportFileItems(string $a_target_dir, ilLog $expLog)
setRestrictForwardNavigation(bool $a_val)
setPublicExportFile(string $a_type, string $a_file)
specify public export file for type
doMDUpdateListener(string $a_element)
createProperties()
create new properties record
static _lookupStoreTries(int $a_id)
static _getNrOfAssignedLMs(int $a_style_id)
gets the number of learning modules assigned to a content style
setActiveDownloads(bool $a_down)
static _getNrLMsIndividualStyles()
get number of learning modules with individual styles
exportXMLStructureObjects(ilXmlWriter $a_xml_writer, int $a_inst, ilLog $expLog)
static getAvailableLayouts()
get all available lm layouts
setCleanFrames(bool $a_clean)
isActiveHistoryUserComments()
getRestrictForwardNavigation()
static writeHeaderPage(int $a_lm_id, int $a_page_id)
copyAllPagesAndChapters(ilObjLearningModule $a_target_obj, int $a_copy_id=0)
getHideHeaderFooterPrint()
setForTranslation(bool $a_val)
Set for translation (lm has been imported for translation purposes)
setHideHeaderFooterPrint(bool $a_val)
Set hide header footer in print mode.
getPublicExportFile(string $a_type)
getTOCMode()
get toc mode ("chapters" | "pages")
setDisableDefaultFeedback(bool $a_val)
Set disable default feedback for questions.
getOfflineFiles(string $dir)
setHistoryUserComments(bool $a_comm)
setActiveLMMenu(bool $a_act_lm_menu)
createImportDirectory()
creates data directory for import files (data_dir/lm_data/lm_<id>/import, depending on data directory...
isActivePreventGlossaryAppendix()
static _getNrLMsNoStyle()
get number of learning modules assigned no style
setProgressIcons(bool $a_val)
bool $disable_def_feedback
static _checkPreconditionsOfPage(int $cont_ref_id, int $cont_obj_id, int $page_id)
checks whether the preconditions of a page are fulfilled or not
executeDragDrop(int $source_id, int $target_id, bool $first_child, bool $as_subitem=false, string $movecopy="move")
exportFO(ilXmlWriter $a_xml_writer, string $a_target_dir)
static _moveLMStyles(int $a_from_style, int $a_to_style)
move learning modules from one style to another
removeAutoGlossary(int $a_glo_id)
getExportDirectory(string $a_type="xml")
setPublicNotes(bool $a_pub_notes)
bool $prevent_glossary_appendix_active
exportXML(ilXmlWriter $a_xml_writer, int $a_inst, string $a_target_dir, ilLog $expLog)
static _deleteStyleAssignments(int $a_style_id)
delete all style references to style
setLayoutPerPage(bool $a_val)
getPageHeader()
get page header mode (ilLMOBject::CHAPTER_TITLE | ilLMOBject::PAGE_TITLE | ilLMOBject::NO_HEADER)
getPublicAccessMode()
get public access mode ("complete" | "selected")
setAutoGlossaries(array $a_val)
create(bool $a_no_meta_data=false)
create content object
static _lookup(int $a_obj_id, string $a_field)
checkStructure()
Check tree (this has been copied from fixTree due to a bug fixing, should be reorganised)
setActiveTOC(bool $a_toc)
setActivePrintView(bool $a_print)
exportFOStructureObjects(ilXmlWriter $a_xml_writer)
exportXMLProperties(ilXmlWriter $a_xml_writer, ilLog $expLog)
validatePages()
Validate all pages.
static _lookupStyleSheetId(int $a_cont_obj_id)
exportXMLPageObjects(ilXmlWriter $a_xml_writer, int $a_inst, ilLog $expLog)
isActiveDownloadsPublic()
setActiveNumbering(bool $a_num)
static lookupAutoGlossaries(int $a_lm_id)
setTOCMode(string $a_toc_mode="chapters")
set toc mode
setActivePreventGlossaryAppendix(bool $a_print)
static hasSuccessorPage(int $a_cont_obj_id, int $a_page_id)
checks if page has a successor page
string $public_access_mode
exportXMLMediaObjects(ilXmlWriter $a_xml_writer, int $a_inst, string $a_target_dir, ilLog $expLog)
ILIAS Style Content DomainService $content_style_domain
setPageHeader(string $a_pg_header=ilLMObject::CHAPTER_TITLE)
set page header mode
bool $hide_header_footer_print
createExportDirectory(string $a_type="xml")
creates data directory for export files (data_dir/lm_data/lm_<id>/export, depending on data directory...
static _lookupContObjIdByStyleId(int $a_style_id)
ilGlobalTemplateInterface $main_tpl
setActiveDownloadsPublic(bool $a_down)
autoLinkGlossaryTerms(int $a_glo_ref_id)
setRatingPages(bool $a_value)
static _lookupDisableDefaultFeedback(int $a_id)
setImportDirectory(string $a_import_dir)
setStoreTries(bool $a_val)
getPublicExportFiles()
Get public export files.
static isOnlineHelpModule(int $a_id, bool $a_as_obj_id=false)
Is module an online module.
static _lookupRestrictForwardNavigation(int $a_obj_id)
exportXMLMetaData(ilXmlWriter $a_xml_writer)
bool $downloads_public_active
setLayout(string $a_layout)
static _getMissingPreconditionsOfPage(int $cont_ref_id, int $cont_obj_id, int $page_id)
gets all missing preconditions of page
getDisableDefaultFeedback()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
static getInstance(int $obj_id)
static getInstance(int $obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupType(int $id, bool $reference=false)
__construct(int $id=0, bool $reference=true)
setOfflineStatus(bool $status)
static _lookupObjId(int $ref_id)
static autoLinkGlossariesPage(ilPageObject $a_page, array $a_terms)
Auto link glossary of whole page.
static getAllPages(string $a_parent_type, int $a_parent_id, string $a_lang="-")
Get all pages for parent object.
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
isInTree(?int $a_node_id)
get all information of a node.
getPathFull(int $a_endnode_id, int $a_startnode_id=0)
get path from a given startnode to a given endnode if startnode is not given the rootnode is startnod...
setTreeTablePK(string $a_column_name)
set column containing primary key in tree table
setTableNames(string $a_table_tree, string $a_table_obj_data, string $a_table_obj_reference="")
set table names The primary key of the table containing your object_data must be 'obj_id' You may use...
static yn2tf(string $a_yn)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
xmlEndTag(string $tag)
Writes an endtag.
appendXML(string $a_str)
append xml string to document
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
if(!file_exists(getcwd() . '/ilias.ini.php'))
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
return['3gp', '7z', 'ai', 'aif', 'aifc', 'aiff', 'au', 'arw', 'avi', 'backup', 'bak', 'bas', 'bpmn', 'bpmn2', 'bmp', 'bib', 'bibtex', 'bz', 'bz2', 'c', 'c++', 'cc', 'cct', 'cdf', 'cer', 'class', 'cls', 'conf', 'cpp', 'crt', 'crs', 'crw', 'cr2', 'css', 'cst', 'csv', 'cur', 'db', 'dcr', 'des', 'dng', 'doc', 'docx', 'dot', 'dotx', 'dtd', 'dvi', 'el', 'eps', 'epub', 'f', 'f77', 'f90', 'flv', 'for', 'g3', 'gif', 'gl', 'gan', 'ggb', 'gsd', 'gsm', 'gtar', 'gz', 'gzip', 'h', 'hpp', 'htm', 'html', 'htmls', 'ibooks', 'ico', 'ics', 'ini', 'ipynb', 'java', 'jbf', 'jpeg', 'jpg', 'js', 'jsf', 'jso', 'json', 'latex', 'lang', 'less', 'log', 'lsp', 'ltx', 'm1v', 'm2a', 'm2v', 'm3u', 'm4a', 'm4v', 'markdown', 'm', 'mat', 'md', 'mdl', 'mdown', 'mid', 'min', 'midi', 'mobi', 'mod', 'mov', 'movie', 'mp2', 'mp3', 'mp4', 'mpa', 'mpeg', 'mpg', 'mph', 'mpga', 'mpp', 'mpt', 'mpv', 'mpx', 'mv', 'mw', 'mv4', 'nb', 'nbp', 'nef', 'nif', 'niff', 'obj', 'obm', 'odt', 'ods', 'odp', 'odg', 'odf', 'oga', 'ogg', 'ogv', 'old', 'p', 'pas', 'pbm', 'pcl', 'pct', 'pcx', 'pdf', 'pgm', 'pic', 'pict', 'png', 'por', 'pov', 'project', 'properties', 'ppa', 'ppm', 'pps', 'ppsx', 'ppt', 'pptx', 'ppz', 'ps', 'psd', 'pwz', 'qt', 'qtc', 'qti', 'qtif', 'r', 'ra', 'ram', 'rar', 'rast', 'rda', 'rev', 'rexx', 'ris', 'rf', 'rgb', 'rm', 'rmd', 'rmi', 'rmm', 'rmp', 'rt', 'rtf', 'rtx', 'rv', 's', 's3m', 'sav', 'sbs', 'sec', 'sdml', 'sgm', 'sgml', 'smi', 'smil', 'srt', 'sps', 'spv', 'stl', 'svg', 'swa', 'swf', 'swz', 'tar', 'tex', 'texi', 'texinfo', 'text', 'tgz', 'tif', 'tiff', 'ttf', 'txt', 'tmp', 'uvproj', 'vdf', 'vimeo', 'viv', 'vivo', 'vrml', 'vsdx', 'wav', 'webm', 'wmv', 'wmx', 'wmz', 'woff', 'wwd', 'xhtml', 'xif', 'xls', 'xlsx', 'xmind', 'xml', 'xsl', 'xsd', 'zip']
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc