52 $this->
user = $DIC->user();
54 $this->db = $DIC->database();
80 $md_gen = $md->getGeneral();
84 foreach ($md_gen->getDescriptionIds() as
$id) {
85 $md_des = $md_gen->getDescription($id);
94 $obj_lp->getCurrentMode(),
109 public static function _lookupNID(
int $a_lm_id,
int $a_lm_obj_id,
string $a_type): ?string
111 $md =
new ilMD($a_lm_id, $a_lm_obj_id, $a_type);
112 $md_gen = $md->getGeneral();
113 if (is_object($md_gen)) {
114 foreach ($md_gen->getIdentifierIds() as
$id) {
115 $md_id = $md_gen->getIdentifier($id);
116 if ($md_id->getCatalog() ==
"ILIAS_NID") {
117 return $md_id->getEntry();
134 $md_creator->setTitle($this->
getTitle());
135 $md_creator->setTitleLanguage($ilUser->getPref(
'language'));
137 $md_creator->setDescriptionLanguage($ilUser->getPref(
'language'));
138 $md_creator->setKeywordLanguage($ilUser->getPref(
'language'));
139 $md_creator->setLanguage($ilUser->getPref(
'language'));
140 $md_creator->create();
149 $md_gen = $md->getGeneral();
150 $md_gen->setTitle($this->
getTitle());
153 $md_des_ids = $md_gen->getDescriptionIds();
154 if (count($md_des_ids) > 0) {
155 $md_des = $md_gen->getDescription($md_des_ids[0]);
180 $this->data_record = $a_record;
187 if (!isset($this->data_record)) {
188 $query =
"SELECT * FROM lm_data WHERE obj_id = " .
189 $ilDB->quote($this->
id,
"integer");
190 $obj_set =
$ilDB->query($query);
191 $this->data_record =
$ilDB->fetchAssoc($obj_set);
194 $this->type = $this->data_record[
"type"];
195 $this->
setImportId((
string) $this->data_record[
"import_id"]);
196 $this->
setTitle((
string) $this->data_record[
"title"]);
197 $this->
setShortTitle((
string) $this->data_record[
"short_title"]);
198 $this->
setLayout((
string) $this->data_record[
"layout"]);
210 $ilDB = $DIC->database();
213 "SELECT * FROM lm_data " .
214 " WHERE lm_id = " .
$ilDB->quote($a_lm_id,
"integer")
216 while ($rec =
$ilDB->fetchAssoc($set)) {
217 self::$data_records[$rec[
"obj_id"]] = $rec;
219 return count(self::$data_records);
224 $this->title = $a_title;
234 $this->short_title = $a_title;
242 protected static function _lookup(
int $a_obj_id,
string $a_field): string
246 $ilDB = $DIC->database();
248 if (isset(self::$data_records[$a_obj_id])) {
249 return self::$data_records[$a_obj_id][$a_field] ??
"";
252 $query =
"SELECT " . $a_field .
" FROM lm_data WHERE obj_id = " .
253 $ilDB->quote($a_obj_id,
"integer");
254 $obj_set =
$ilDB->query($query);
255 $obj_rec =
$ilDB->fetchAssoc($obj_set);
257 return $obj_rec[$a_field] ??
"";
262 return self::_lookup($a_obj_id,
"title");
267 return self::_lookup($a_obj_id,
"short_title");
270 public static function _lookupType(
int $a_obj_id,
int $a_lm_id = 0): string
274 $ilDB = $DIC->database();
276 if (isset(self::$data_records[$a_obj_id])) {
277 if ($a_lm_id == 0 || self::$data_records[$a_obj_id][
"lm_id"] == $a_lm_id) {
278 return self::$data_records[$a_obj_id][
"type"];
284 $and =
' AND lm_id = ' .
$ilDB->quote($a_lm_id,
'integer');
287 $query =
"SELECT type FROM lm_data WHERE obj_id = " .
$ilDB->quote($a_obj_id,
"integer") . $and;
288 $obj_set =
$ilDB->query($query);
289 $obj_rec =
$ilDB->fetchAssoc($obj_set);
291 return $obj_rec[
"type"] ??
"";
295 public static function _writeTitle(
int $a_obj_id,
string $a_title): void
299 $ilDB = $DIC->database();
301 $query =
"UPDATE lm_data SET " .
302 " title = " .
$ilDB->quote($a_title,
"text") .
303 " WHERE obj_id = " .
$ilDB->quote($a_obj_id,
"integer");
304 $ilDB->manipulate($query);
310 $this->description = $a_description;
320 $this->type = $a_type;
330 $this->lm_id = $a_lm_id;
340 $this->content_object = $a_content_obj;
348 public function setId(
int $a_id): void
365 $this->import_id = $a_id;
370 $this->layout = $a_val;
382 $ilDB = $DIC->database();
384 $q =
"UPDATE lm_data " .
386 "import_id = " .
$ilDB->quote($a_import_id,
"text") .
"," .
387 "last_update = " .
$ilDB->now() .
" " .
388 "WHERE obj_id = " .
$ilDB->quote($a_id,
"integer");
393 public function create(
bool $a_upload =
false): void
399 $query =
"INSERT INTO lm_data (obj_id, title, type, layout, lm_id, import_id, short_title, create_date) " .
401 $ilDB->quote($this->
getId(),
"integer") .
"," .
408 ", " .
$ilDB->now() .
")";
409 $ilDB->manipulate($query);
416 $this->content_object->getType() .
":" . $this->
getType()
430 $query =
"UPDATE lm_data SET " .
431 " lm_id = " .
$ilDB->quote($this->
getLMId(),
"integer") .
435 " WHERE obj_id = " .
$ilDB->quote($this->
getId(),
"integer");
437 $ilDB->manipulate($query);
450 $ilDB = $DIC->database();
451 $ilLog = $DIC[
"ilLog"];
454 if (!is_array($a_pages)) {
458 if (empty($a_cont_obj_id)) {
459 $message =
'ilLMObject::_writePublicAccessStatus(): Invalid parameter! $a_cont_obj_id is empty';
460 $ilLog->write(
$message, $ilLog->WARNING);
466 $lm_tree =
new ilTree($a_cont_obj_id);
467 $lm_tree->setTableNames(
'lm_tree',
'lm_data');
468 $lm_tree->setTreeTablePK(
"lm_id");
469 $lm_tree->readRootId();
472 $q =
"SELECT obj_id FROM lm_data " .
473 "WHERE lm_id = " .
$ilDB->quote($a_cont_obj_id,
"integer") .
" " .
478 while ($row =
$ilDB->fetchAssoc(
$r)) {
479 $childs = $lm_tree->getChilds($row[
"obj_id"]);
481 foreach ($childs as $page) {
482 if ($page[
"type"] ===
"pg" and in_array($page[
"obj_id"], $a_pages)) {
483 $a_pages[] = $row[
"obj_id"];
490 $q =
"UPDATE lm_data SET " .
491 "public_access = CASE " .
492 "WHEN " .
$ilDB->in(
"obj_id", $a_pages,
false,
"integer") .
" " .
493 "THEN " .
$ilDB->quote(
"y",
"text") .
494 "ELSE " .
$ilDB->quote(
"n",
"text") .
496 "WHERE lm_id = " .
$ilDB->quote($a_cont_obj_id,
"integer") .
" " .
497 "AND " .
$ilDB->in(
"type", array(
"pg",
"st"),
false,
"text");
503 bool $a_check_public_mode =
false 507 $ilDB = $DIC->database();
508 $ilLog = $DIC[
"ilLog"];
510 if (empty($a_node_id)) {
511 $message =
'ilLMObject::_isPagePublic(): Invalid parameter! $a_node_id is empty';
512 $ilLog->write(
$message, $ilLog->WARNING);
516 if ($a_check_public_mode ===
true) {
519 $q =
"SELECT public_access_mode FROM content_object WHERE id = " .
520 $ilDB->quote($lm_id,
"integer");
524 if ($row[
"public_access_mode"] ==
"complete") {
529 $q =
"SELECT public_access FROM lm_data WHERE obj_id=" .
530 $ilDB->quote($a_node_id,
"integer");
537 public function delete(
bool $a_delete_meta_data =
true):
void 541 $query =
"DELETE FROM lm_data WHERE obj_id = " .
543 $ilDB->manipulate($query);
559 $ilDB = $DIC->database();
560 $help_module = $DIC->help()->internal()->domain()->module();
562 $q =
"SELECT obj_id FROM lm_data WHERE import_id = " .
563 $ilDB->quote($a_import_id,
"text") .
" " .
564 " ORDER BY create_date DESC";
566 while ($obj_rec =
$ilDB->fetchAssoc($obj_set)) {
572 $help_module->isHelpLM($lm_id)) {
573 return $obj_rec[
"obj_id"];
591 $ilDB = $DIC->database();
593 $where = ($a_in_lm > 0)
594 ?
" AND lm_id = " .
$ilDB->quote($a_in_lm,
"integer") .
" " 597 $q =
"SELECT * FROM lm_data WHERE import_id = " .
598 $ilDB->quote($a_import_id,
"text") .
" " .
600 " ORDER BY create_date DESC";
604 while ($obj_rec =
$ilDB->fetchAssoc($obj_set)) {
617 public static function _exists(
int $a_id): bool
621 $ilDB = $DIC->database();
623 if (is_int(strpos($a_id,
"_"))) {
627 $q =
"SELECT * FROM lm_data WHERE obj_id = " .
628 $ilDB->quote($a_id,
"integer");
630 if ($obj_rec =
$ilDB->fetchAssoc($obj_set)) {
643 $ilDB = $DIC->database();
645 $type_str = ($type !=
"")
646 ?
"AND type = " .
$ilDB->quote($type,
"text") .
" " 649 $query =
"SELECT * FROM lm_data " .
650 "WHERE lm_id= " .
$ilDB->quote($lm_id,
"integer") .
" " .
653 $obj_set =
$ilDB->query($query);
655 while ($obj_rec =
$ilDB->fetchAssoc($obj_set)) {
656 $obj_list[] = array(
"obj_id" => $obj_rec[
"obj_id"],
657 "title" => $obj_rec[
"title"],
658 "import_id" => $obj_rec[
"import_id"],
659 "type" => $obj_rec[
"type"]);
673 $ilDB = $DIC->database();
675 $query =
"SELECT * FROM lm_data " .
676 "WHERE lm_id= " .
$ilDB->quote($a_cobj->
getId(),
"integer");
677 $obj_set =
$ilDB->query($query);
679 while ($obj_rec =
$ilDB->fetchAssoc($obj_set)) {
682 if (is_object($lm_obj)) {
683 $lm_obj->delete(
true);
695 $ilDB = $DIC->database();
697 if (isset(self::$data_records[$a_id])) {
698 return self::$data_records[$a_id][
"lm_id"];
701 $query =
"SELECT lm_id FROM lm_data WHERE obj_id = " .
702 $ilDB->quote($a_id,
"integer");
703 $obj_set =
$ilDB->query($query);
704 $obj_rec =
$ilDB->fetchAssoc($obj_set);
706 return (
int) ($obj_rec[
"lm_id"] ?? 0);
714 int $a_parent_id = 0,
715 int $a_target_node_id = 0
719 $ilLog = $DIC[
"ilLog"];
724 $parent_id = ($a_parent_id != 0)
729 if ($a_target_node_id != 0) {
730 $target = $a_target_node_id;
733 if ($a_obj->
getType() ==
"st") {
734 $s_types = array(
"st",
"pg");
735 $childs = $tree->getChildsByTypeFilter($parent_id, $s_types);
738 $childs = $tree->getChildsByType($parent_id, $s_types);
741 if (count($childs) == 0) {
744 $target = $childs[count($childs) - 1][
"obj_id"];
748 if ($tree->isInTree($parent_id) && !$tree->isInTree($a_obj->
getId())) {
749 $ilLog->write(
"LMObject::putInTree: insertNode, ID: " . $a_obj->
getId() .
750 "Parent ID: " . $parent_id .
", Target: " . $target);
752 $tree->insertNode($a_obj->
getId(), $parent_id, $target);
762 $tree =
new ilLMTree($a_cont_obj_id);
778 if (!is_array($a_ids)) {
782 foreach ($a_ids as $id) {
783 $path = $tree->getPathId($id);
785 foreach (
$path as $path_id) {
786 if ($path_id != $id && in_array($path_id, $a_ids)) {
801 foreach ($cut_ids as $id) {
802 $curnode = $tree->getNodeData($id);
803 if ($tree->isInTree($id)) {
804 $tree->deleteTree($curnode);
818 $ilUser = $DIC->user();
822 $ilUser->clipboardDeleteObjectsOfType(
"pg");
823 $ilUser->clipboardDeleteObjectsOfType(
"st");
826 $time = date(
"Y-m-d H:i:s", time());
828 foreach ($a_ids as $id) {
830 if ($tree->isInTree($id)) {
831 $curnode = $tree->getNodeData($id);
832 $subnodes = $tree->getSubTree($curnode);
833 foreach ($subnodes as $subnode) {
834 if ($subnode[
"child"] != $id) {
835 $ilUser->addObjectToClipboard(
846 $order = (($curnode[
"lft"] ?? 0) > 0)
848 : (
int) ($order + 1);
849 $ilUser->addObjectToClipboard(
851 self::_lookupType($id),
863 public static function pasteTree(
868 string $a_insert_time,
869 array &$a_copied_nodes,
870 bool $a_as_copy =
false,
876 $ilUser = $DIC->user();
877 $ilLog = $DIC[
"ilLog"];
883 if ($item_type ==
"st") {
885 } elseif ($item_type ==
"pg") {
889 $ilLog->write(
"Getting from clipboard type " . $item_type .
", " .
890 "Item ID: " . $a_item_id .
", of original LM: " . $item_lm_id);
892 if ($item_lm_id != $a_target_lm->
getId() && !$a_as_copy) {
896 $md =
new ilMD($item_lm_id, $item->getId(), $item->getType());
897 $new_md = $md->
cloneMD($a_target_lm->
getId(), $item->getId(), $item->getType());
900 $item->setLMId($a_target_lm->
getId());
901 $item->setContentObject($a_target_lm);
907 if ($item_type ==
"pg") {
908 $page = $item->getPageObject();
910 $page->setParentId($a_target_lm->
getId());
916 $target_item = $item->copy($a_target_lm);
917 $a_copied_nodes[$item->getId()] = $target_item->getId();
919 $target_item = $item;
922 $ilLog->write(
"Putting into tree type " . $target_item->getType() .
923 "Item ID: " . $target_item->getId() .
", Parent: " . $a_parent_id .
", " .
924 "Target: " . $a_target .
", Item LM:" . $target_item->getContentObject()->getId());
928 if ($a_source_lm == null) {
929 $childs = $ilUser->getClipboardChilds($item->getId(), $a_insert_time);
931 $childs = $a_source_lm->lm_tree->getChilds($item->getId());
932 foreach ($childs as $k => $child) {
933 $childs[$k][
"id"] = $child[
"child"];
937 foreach ($childs as $child) {
938 ilLMObject::pasteTree(
941 $target_item->
getId(),
950 return $target_item->getId();
965 if (is_array($a_titles)) {
966 foreach ($a_titles as $id => $title) {
969 if ($a_lang ==
"-") {
971 if (is_object($lmobj)) {
975 if (is_object($md_gen)) {
976 $md_gen->setTitle($title);
984 $lmobjtrans->setTitle($title);
995 array $a_copied_nodes,
996 string $a_parent_type =
"lm" 998 $all_fixes = array();
999 foreach ($a_copied_nodes as $original_id => $copied_id) {
1003 if ($copied_type ==
"pg") {
1009 $tpg =
new ilLMPage($copied_id, 0, $l);
1011 $il = $tpg->getInternalLinks();
1013 foreach ($il as $l2) {
1019 foreach ($targets as $target) {
1020 if (($target[
"inst"] == 0 || $target[
"inst"] =
IL_INST_ID) &&
1021 ($target[
"type"] ==
"pg" || $target[
"type"] ==
"st")) {
1023 if (($a_copied_nodes[$target[
"id"]] ?? 0) > 0) {
1024 $fix[$target[
"id"]] = $a_copied_nodes[$target[
"id"]];
1030 if ($trg_lm != $copy_lm) {
1034 foreach ($lm_data as $item) {
1035 if (!$found && ($item[
"lm_id"] == $copy_lm)) {
1036 $fix[$target[
"id"]] = $item[
"obj_id"];
1046 if (count($fix) > 0) {
1050 if (isset($all_fixes[$t .
":" . $copied_id])) {
1051 $all_fixes[$t .
":" . $copied_id] += $fix;
1053 $all_fixes[$t .
":" . $copied_id] = $fix;
1059 if ($copied_type ==
"pg" ||
1060 $copied_type ==
"st") {
1071 if ($original_lm != $copy_lm) {
1084 "_" . $original_id);
1087 foreach ($mobs as $mob) {
1096 foreach ($usages as $usage) {
1097 if ($usage[
"type"] ==
"lm:pg" | $usage[
"type"] ==
"lm:st") {
1098 $sources[] = $usage;
1103 foreach ($sources as $source) {
1104 $stype = explode(
":", $source[
"type"]);
1105 $source_type = $stype[1] ??
"";
1107 if ($source_type ==
"pg" || $source_type ==
"st") {
1111 if ($src_lm == $original_lm) {
1115 "il__" . $source_type .
"_" . $source[
"id"],
1119 foreach ($lm_data as $item) {
1121 $fix[$item[
"obj_id"]][$original_id] = $copied_id;
1129 if (count($fix) > 0) {
1130 foreach ($fix as $page_id => $fix_array) {
1132 if (isset($all_fixes[$t .
":" . $page_id])) {
1133 $all_fixes[$t .
":" . $page_id] += $fix_array;
1135 $all_fixes[$t .
":" . $page_id] = $fix_array;
1143 foreach ($all_fixes as $pg => $fixes) {
1144 $pg = explode(
":", $pg);
1147 if ($page->moveIntLinks($fixes)) {
1148 $page->update(
true,
true);
1160 if (is_array($a_items)) {
1161 foreach ($a_items as $item) {
1167 if (count($types) > 1) {
1183 $ilDB = $DIC->database();
1188 $query =
"UPDATE lm_data SET " .
1189 " layout = " .
$ilDB->quote($a_layout,
"text") .
1190 " WHERE obj_id = " .
$ilDB->quote($a_obj_id,
"integer");
1191 $ilDB->manipulate($query);
1192 } elseif ($t ==
"st" && is_object($a_lm)) {
1193 $node = $a_lm->getLMTree()->getNodeData($a_obj_id);
1194 $child_nodes = $a_lm->getLMTree()->getSubTree($node);
1195 if (is_array($child_nodes) && count($child_nodes) > 0) {
1196 foreach ($child_nodes as
$c) {
1197 if ($c[
"type"] ==
"pg") {
1198 $query =
"UPDATE lm_data SET " .
1199 " layout = " .
$ilDB->quote($a_layout,
"text") .
1200 " WHERE obj_id = " .
$ilDB->quote($c[
"child"],
"integer");
1201 $ilDB->manipulate($query);
1215 $ilDB = $DIC->database();
1217 $query =
"SELECT layout FROM lm_data WHERE obj_id = " .
1218 $ilDB->quote($a_obj_id,
"integer");
1219 $obj_set =
$ilDB->query($query);
1220 $obj_rec =
$ilDB->fetchAssoc($obj_set);
1222 return $obj_rec[
"layout"];
1233 $lm_tree =
new ilTree($a_lm_id);
1234 $lm_tree->setTableNames(
'lm_tree',
'lm_data');
1235 $lm_tree->setTreeTablePK(
"lm_id");
1236 $lm_tree->readRootId();
1238 $childs = $lm_tree->getChildsByType($a_chap_id,
"pg");
1252 $ilDB = $DIC->database();
1254 $and = ($a_type !=
"")
1255 ?
" AND type = " .
$ilDB->quote($a_type,
"text")
1258 $set =
$ilDB->query(
"SELECT obj_id FROM lm_data " .
1259 " WHERE lm_id = " .
$ilDB->quote($a_lm_id,
"integer") . $and);
1261 while ($rec =
$ilDB->fetchAssoc($set)) {
1262 $obj_ids[] = $rec[
"obj_id"];
1277 string $a_type =
"pg" 1284 if (trim($a_exp_id) ==
"") {
1287 foreach ($entries as $id =>
$e) {
1288 if (
$e[
"catalog"] ==
"ILIAS_NID") {
1290 $identifier->setMetaId($id);
1291 $identifier->delete();
1298 foreach ($entries as $id =>
$e) {
1299 if (
$e[
"catalog"] ==
"ILIAS_NID") {
1301 $identifier->setMetaId($id);
1302 $identifier->read();
1303 $identifier->setEntry($a_exp_id);
1304 $identifier->update();
1311 $md =
new ilMD($a_lm_id, $a_lmobj_id, $a_type);
1312 $md_gen = $md->getGeneral();
1313 $identifier = $md_gen->addIdentifier();
1314 $identifier->setEntry($a_exp_id);
1315 $identifier->setCatalog(
"ILIAS_NID");
1316 $identifier->save();
1324 string $a_type =
"pg" 1333 foreach ($entries as
$e) {
1334 if ($e[
"catalog"] ==
"ILIAS_NID") {
1347 string $a_type =
"pg" 1357 string $a_type =
"pg" 1361 foreach ($entries as
$e) {
1362 if ($e[
"catalog"] ==
"ILIAS_NID") {
1364 $res[trim($e[
"entry"])] = (
$res[trim($e[
"entry"])] ?? 0) + 1;
1374 string $a_type =
"pg" 1383 string $a_mode = self::PAGE_TITLE,
1384 bool $a_include_numbers =
false,
1385 bool $a_time_scheduled_activation =
false,
1386 bool $a_force_content =
false,
1388 string $a_lang =
"-" 1390 if ($a_lang ==
"") {
1394 if ($a_node[
"type"] ==
"st") {
1397 self::CHAPTER_TITLE,
1399 $a_time_scheduled_activation,
1409 $a_time_scheduled_activation,
1419 string $a_lang =
"-" 1423 $db = $DIC->database();
1425 $title_data = array();
1426 if ($a_lang ==
"-") {
1427 $set = $db->
query(
"SELECT t.child, d.obj_id, d.title, d.short_title FROM lm_data d LEFT JOIN lm_tree t ON (d.obj_id = t.child) WHERE d.lm_id = " .
1428 $db->
quote($a_lm_id,
"integer") .
" ORDER BY t.lft, d.title");
1430 $set = $db->
query(
"SELECT t.child, d.obj_id, tr.title, tr.short_title, d.title default_title, d.short_title default_short_title FROM lm_data d " .
1431 " LEFT JOIN lm_tree t ON (d.obj_id = t.child) " .
1432 " LEFT JOIN lm_data_transl tr ON (tr.id = d.obj_id AND tr.lang=" . $db->
quote($a_lang,
"text") .
") WHERE d.lm_id = " .
1433 $db->
quote($a_lm_id,
"integer") .
" ORDER BY t.lft, d.title");
1436 $title_data[] = $rec;
1443 string $a_short_title,
1444 string $a_lang =
"-" 1448 $db = $DIC->database();
1450 if ($a_lang !=
"-" && $a_lang !=
"") {
1452 $trans->setShortTitle($a_short_title);
1456 "UPDATE lm_data SET " .
1457 " short_title = " . $db->
quote($a_short_title,
"text") .
1458 " WHERE obj_id = " . $db->
quote($a_id,
"integer")
static updateInternalLinks(array $a_copied_nodes, string $a_parent_type="lm")
Update internal links, after multiple pages have been copied.
static _getPresentationTitle(int $a_st_id, string $a_mode=self::CHAPTER_TITLE, bool $a_include_numbers=false, bool $a_time_scheduled_activation=false, bool $a_force_content=false, int $a_lm_id=0, string $a_lang="-", bool $a_include_short=false)
static _isPagePublic(int $a_node_id, bool $a_check_public_mode=false)
static _getMobsForTarget(string $a_type, string $a_target)
Get areas for a certain target.
setDescription(string $a_description)
getExportIDInfo(int $a_lm_id, int $a_exp_id, string $a_type="pg")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupNID(int $a_lm_id, int $a_lm_obj_id, string $a_type)
lookup named identifier (ILIAS_NID)
static readIdData(int $a_rbac_id, string $a_obj_type, string $a_catalog, string $a_entry)
static _writePublicAccessStatus(array $a_pages, int $a_cont_obj_id)
update public access flags in lm_data for all pages of a content object
static _getSourcesOfTarget(string $a_target_type, int $a_target_id, int $a_target_inst)
get all sources of a link target
static getExportId(int $a_lm_id, int $a_lmobj_id, string $a_type="pg")
static _extractObjIdOfTarget(string $a_target)
Extract object id out of target.
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 _getAllObjectsForImportId(string $a_import_id, int $a_in_lm=0)
Get all items for an import ID.
static saveTitles(ilObjLearningModule $a_lm, array $a_titles, string $a_lang="-")
Save titles for lm objects.
fetchAssoc(ilDBStatement $statement)
static _getAllReferences(int $id)
get all reference ids for object ID
static _deleteAllObjectData(ilObjLearningModule $a_cobj)
delete all objects of content object (digi book / learning module)
static uniqueTypesCheck(array $a_items)
Check for unique types (all pages or all chapters)
static getInstance(ilObjLearningModule $a_content_obj, int $a_id=0, bool $a_halt=true)
MDUpdateListener(string $a_element)
Meta data update listener Important note: Do never call create() or update() method of ilObject here...
create(bool $a_upload=false)
static _hasUntrashedReference(int $obj_id)
checks whether an object has at least one reference that is not in trash
static _lookupShortTitle(int $a_obj_id)
static getObjectList(int $lm_id, string $type="")
const LP_MODE_COLLECTION_TLT
quote($value, string $type)
static preloadDataByLM(int $a_lm_id)
Preload data records by lm.
static clipboardCut(int $a_cont_obj_id, array $a_ids)
Copy a set of chapters/pages into the clipboard.
static subStr(string $a_str, int $a_start, ?int $a_length=null)
static existsIdInRbacObject(int $a_rbac_id, string $a_obj_type, string $a_catalog, string $a_entry)
static getTree(int $a_cont_obj_id)
Get learning module tree.
static lookupTranslations(string $a_parent_type, int $a_id)
Lookup translations.
static putInTree(ilLMObject $a_obj, int $a_parent_id=0, int $a_target_node_id=0)
put this object into content object tree
static _extractInstOfTarget(string $a_target)
Extract installation id out of target.
static writeShortTitle(int $a_id, string $a_short_title, string $a_lang="-")
static _lookupTitle(int $a_obj_id)
__construct(ilObjLearningModule $a_content_obj, int $a_id=0)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static writeLayout(int $a_obj_id, string $a_layout, ?ilObjLearningModule $a_lm=null)
Write layout setting.
static _getEntriesForObj(int $a_rbac_id, int $a_obj_id, string $a_obj_type)
static _getIdForImportId(string $a_import_id)
get current object id for import id (static)
static getPagesOfChapter(int $a_lm_id, int $a_chap_id)
Get pages of chapter.
static _refreshStatus(int $a_obj_id, ?array $a_users=null)
query(string $query)
Run a (read-only) Query on the database.
setTitle(string $a_title)
updateMetaData()
update meta data entry
setImportId(string $a_id)
static _getAllLMObjectsOfLM(int $a_lm_id, string $a_type="")
Get all objects of learning module.
existsExportID(int $a_lm_id, int $a_exp_id, string $a_type="pg")
Does export ID exist in lm?
static _writeImportId(int $a_id, string $a_import_id)
static _writeTitle(int $a_obj_id, string $a_title)
setShortTitle(string $a_title)
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
static _exists(int $a_id)
checks wether a lm content object with specified id exists or not
static saveExportId(int $a_lm_id, int $a_lmobj_id, string $a_exp_id, string $a_type="pg")
static getShortTitles(int $a_lm_id, string $a_lang="-")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
createMetaData()
create meta data entry
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getPresentationTitle(int $a_pg_id, string $a_mode=self::CHAPTER_TITLE, bool $a_include_numbers=false, bool $a_time_scheduled_activation=false, bool $a_force_content=false, int $a_lm_id=0, string $a_lang="-", bool $a_include_short=false)
presentation title doesn't have to be page title, it may be chapter title + page title or chapter tit...
static getDuplicateExportIDs(int $a_lm_id, string $a_type="pg")
Get duplicate export IDs (count export ID usages)
static _lookupType(int $a_obj_id, int $a_lm_id=0)
static _lookupContObjID(int $a_id)
get learning module id for lm object
deleteMetaData()
delete meta data entry
static yn2tf(string $a_yn)
ilObjLearningModule $content_object
static _getEntriesForRbacObj(int $a_rbac_id, string $a_obj_type="")
static lookupLayout(int $a_obj_id)
Lookup type.
manipulate(string $query)
Run a (write) Query on the database.
static _lookupType(int $id, bool $reference=false)
setContentObject(ilObjLearningModule $a_content_obj)
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...
static getInstance(int $obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstance(string $a_parent_type, int $a_id=0, int $a_old_nr=0, string $a_lang="-")
Get page object instance.
cloneMD(int $a_rbac_id, int $a_obj_id, string $a_obj_type)
static _extractTypeOfTarget(string $a_target)
Extract type out of target.
static _lookup(int $a_obj_id, string $a_field)
static clipboardCopy(int $a_cont_obj_id, array $a_ids)
Copy a set of chapters/pages into the clipboard.
setDataRecord(array $a_record)
this method should only be called by class ilLMObjectFactory
static _getNodePresentationTitle(array $a_node, string $a_mode=self::PAGE_TITLE, bool $a_include_numbers=false, bool $a_time_scheduled_activation=false, bool $a_force_content=false, int $a_lm_id=0, string $a_lang="-")