50 $this->contains_int_link =
false;
51 $this->mobs_contained = array();
52 $this->files_contained = array();
53 $this->halt_on_error = $a_halt;
60 public function read(): void
63 $this->page_object =
new ilLMPage($this->
id, 0);
67 bool $a_upload =
false,
68 bool $a_omit_page_object_creation =
false,
71 parent::create($a_upload);
72 if ($a_omit_page_object_creation) {
75 if (!is_object($this->page_object)) {
78 $this->page_object->setId($this->
getId());
79 $this->page_object->setParentId($this->
getLMId());
80 if ($a_layout_id == 0) {
81 $this->page_object->create(
false);
83 $this->page_object->createWithLayoutId($a_layout_id);
87 public function delete(
bool $a_delete_meta_data =
true):
void 89 parent::delete($a_delete_meta_data);
90 $this->page_object->delete();
99 $lm_page->setTitle($this->
getTitle());
102 $lm_page->setLMId($a_target_lm->
getId());
103 $lm_page->setType($this->
getType());
105 $lm_page->setImportId(
"il__pg_" . $this->
getId());
106 $lm_page->create(
true);
111 if (trim($exp_id) !=
"") {
118 $this->lom_services->derive()
120 ->forObject($a_target_lm->
getId(), $lm_page->getId(), $this->
getType());
127 $a_target_lm->
getId(),
134 $page = $lm_page->getPageObject();
135 $this->page_object->copy($page->getId(), $page->getParentType(), $page->getParentId());
149 array &$a_copied_nodes
153 $lm_page->setTitle($this->
getTitle());
155 $lm_page->setLMId($a_cont_obj->
getId());
156 $lm_page->setImportId(
"il__pg_" . $this->
getId());
157 $lm_page->setType($this->
getType());
159 $lm_page->create(
true);
160 $a_copied_nodes[$this->
getId()] = $lm_page->getId();
163 $this->lom_services->derive()
165 ->forObject($a_cont_obj->
getId(), $lm_page->getId(), $this->
getType());
168 $page = $lm_page->getPageObject();
169 $page->setXMLContent($this->page_object->getXMLContent());
182 $this->page_object = $a_page_obj;
194 public function setId(
int $a_id): void
219 foreach ($pages as $page) {
220 if (isset($linked_pages[$page[
"obj_id"]])) {
234 string $a_mode = self::CHAPTER_TITLE,
235 bool $a_include_numbers =
false,
236 bool $a_time_scheduled_activation =
false,
237 bool $a_force_content =
false,
239 string $a_lang =
"-",
240 bool $a_include_short =
false 243 $ilDB = $DIC->database();
245 if ($a_mode == self::NO_HEADER && !$a_force_content) {
261 if ($a_include_short) {
268 $ot = (
new TranslationsRepository(
$ilDB))->getFor($a_lm_id);
270 if ($a_lang !=
"-" && $ot->getContentTranslationActivated()) {
273 if ($a_include_short) {
274 $trans_title = trim($lmobjtrans->getShortTitle());
276 if ($trans_title ==
"") {
277 $trans_title = $lmobjtrans->getTitle();
279 if ($trans_title ==
"") {
281 $trans_title = $lmobjtrans->
getTitle();
283 if ($trans_title !=
"") {
288 if ($a_mode == self::PAGE_TITLE) {
294 if ($tree->isInTree($a_pg_id)) {
295 $pred_node = $tree->fetchPredecessorNode($a_pg_id,
"st");
296 $childs = $tree->getChildsByType($pred_node[
"obj_id"],
"pg");
298 if (count($childs) > 1) {
300 foreach ($childs as $child) {
304 $a_time_scheduled_activation
309 if ($act_data[
"show_activation_info"] &&
315 if ($child[
"type"] !=
"pg" ||
$active) {
318 if ($child[
"obj_id"] == $a_pg_id) {
323 $cnt_str =
" (" . $cur_cnt .
"/" . $cnt .
")";
327 $pred_node[
"obj_id"],
346 string $a_mode =
"normal",
363 $attrs[
"OriginId"] =
"il_" . $a_inst .
364 "_pg_" . $this->
getId();
365 $a_xml_writer->
xmlElement(
"PageAlias", $attrs);
383 $attrs[
"OriginId"] =
"il_" . $a_inst .
385 $a_xml_writer->
xmlElement(
"PageAlias", $attrs);
411 if ($a_tag ==
"Identifier" && $a_param ==
"Entry") {
422 $this->page_object->buildDom();
423 $this->page_object->insertInstIntoIDs($a_inst);
424 $this->mobs_contained = $this->page_object->collectMediaObjects(
false);
426 $xml = $this->page_object->getXMLFromDom(
false,
false,
false,
"",
true);
427 $xml = str_replace(
"&",
"&", $xml);
430 $this->page_object->freeDom();
440 $this->content_object->getType(),
469 string $a_order_field,
476 $ilDB = $DIC->database();
479 $count_query =
"SELECT count(pq.question_id) cnt ";
482 $query =
"SELECT pq.page_id, pq.question_id ";
484 $from =
" FROM page_question pq JOIN lm_tree t ON (t.lm_id = " .
$ilDB->quote($a_lm_id,
"integer") .
485 " AND pq.page_id = t.child and pq.page_parent_type = " .
$ilDB->quote(
"lm",
"text") .
") " .
486 " WHERE t.lm_id = " .
$ilDB->quote($a_lm_id,
"integer");
487 $count_query .= $from;
491 $set =
$ilDB->query($count_query);
493 if ($rec =
$ilDB->fetchAssoc($set)) {
500 $ilDB->setLimit($limit, $offset);
504 $set =
$ilDB->query($query);
506 while ($rec =
$ilDB->fetchAssoc($set)) {
509 return array(
"cnt" => $cnt,
"set" => $result);
525 $lng = $DIC->language();
533 $parent_id = $lm_tree->getParentId($node_id);
536 $parent_id = $node_id;
541 for ($i = 1; $i <= $num; $i++) {
544 $page->setLMId($lm->getId());
545 $page->create(
false,
false, $layout_id);
547 $page_ids[] = $page->getId();
549 $page_ids = array_reverse($page_ids);
static _lookupActive(int $a_id, string $a_parent_type, bool $a_check_scheduled_activation=false, string $a_lang="-")
lookup activation status
static queryQuestionsOfLearningModule(int $a_lm_id, string $a_order_field, string $a_order_dir, int $a_offset, int $a_limit)
Get questions of learning module.
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 _exportXMLAlias(ilXmlWriter $a_xml_writer, int $a_id, int $a_inst=0)
export page alias to xml
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getPagesWithLinks(string $a_parent_type, int $a_parent_id, string $a_lang="-")
Get all pages for parent object that contain internal links.
getPageObject()
get assigned page object
static getExportId(int $a_lm_id, int $a_lmobj_id, string $a_type="pg")
getQuestionIds()
Get question ids note: this method must be called afer exportXMLPageContent.
exportXMLMetaData(ilXmlWriter $a_xml_writer)
static _lookupShortTitle(int $a_obj_id)
static getObjectList(int $lm_id, string $type="")
static _lookupActivationData(int $a_id, string $a_parent_type, string $a_lang="-")
Lookup activation data.
appendXML(string $a_str)
append xml string to document
static now()
Return current timestamp in Y-m-d H:i:s format.
static getInstance(int $a_tree_id)
modifyExportIdentifier(string $a_tag, string $a_param, string $a_value)
create(bool $a_upload=false, bool $a_omit_page_object_creation=false, int $a_layout_id=0)
static putInTree(ilLMObject $a_obj, int $a_parent_id=0, int $a_target_node_id=0)
put this object into content object tree
xmlEndTag(string $tag)
Writes an endtag.
static _lookupTitle(int $a_obj_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static collectFileItems(ilPageObject $a_page, DOMDocument $a_domdoc)
Get all file items that are used within the page.
static copy(string $a_source_id, string $a_target_id)
Copy all translations of an object.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getFileItemIds()
get ids of all file items within the page note: this method must be called afer exportXMLPageContent ...
__construct(ilObjLearningModule $a_content_obj, int $a_id=0, bool $a_halt=true)
static insertPagesFromTemplate(int $lm_id, int $num, int $node_id, bool $first_child, int $layout_id, string $title="")
Insert (multiple) pages templates at node.
static getPagesWithLinksList(int $a_lm_id, string $a_par_type)
Get all pages of lm that contain any internal links.
existsExportID(int $a_lm_id, int $a_exp_id, string $a_type="pg")
Does export ID exist in lm?
assignPageObject(ilLMPage $a_page_obj)
assign page object
getMediaObjectIds()
get ids of all media objects within the page note: this method must be called afer exportXMLPageConte...
copy(ilObjLearningModule $a_target_lm)
exportXML(ilXmlWriter $a_xml_writer, string $a_mode="normal", int $a_inst=0)
export page object to xml (see ilias_co.dtd)
static saveExportId(int $a_lm_id, int $a_lmobj_id, string $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 _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 getPageList(int $lm_id)
__construct(Container $dic, ilPlugin $plugin)
static _lookupContObjID(int $a_id)
get learning module id for lm object
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
static _lookupType(int $id, bool $reference=false)
exportXMLPageContent(ilXmlWriter $a_xml_writer, int $a_inst=0)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getQuestionIdsForPage(string $a_parent_type, int $a_page_id, string $a_lang="-")
copyToOtherContObject(ilObjLearningModule $a_cont_obj, array &$a_copied_nodes)
copy a page to another content object (learning module / dlib book)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...