48         $this->contains_int_link = 
false;
    49         $this->mobs_contained = array();
    50         $this->files_contained = array();
    51         $this->halt_on_error = $a_halt;
    58     public function read(): void
    61         $this->page_object = 
new ilLMPage($this->
id, 0);
    65         bool $a_upload = 
false,
    66         bool $a_omit_page_object_creation = 
false,
    69         parent::create($a_upload);
    70         if ($a_omit_page_object_creation) {
    73         if (!is_object($this->page_object)) {
    76         $this->page_object->setId($this->
getId());
    77         $this->page_object->setParentId($this->
getLMId());
    78         if ($a_layout_id == 0) {
    79             $this->page_object->create(
false);
    81             $this->page_object->createWithLayoutId($a_layout_id);
    85     public function delete(
bool $a_delete_meta_data = 
true): 
void    87         parent::delete($a_delete_meta_data);
    88         $this->page_object->delete();
    97         $lm_page->setTitle($this->
getTitle());
   100         $lm_page->setLMId($a_target_lm->
getId());
   101         $lm_page->setType($this->
getType());
   103         $lm_page->setImportId(
"il__pg_" . $this->
getId());
   104         $lm_page->create(
true);         
   109         if (trim($exp_id) != 
"") {
   117         $new_md = $md->cloneMD($a_target_lm->
getId(), $lm_page->getId(), $this->
getType());
   124                 $a_target_lm->
getId(),
   131         $page = $lm_page->getPageObject();
   132         $this->page_object->copy($page->getId(), $page->getParentType(), $page->getParentId());
   146         array &$a_copied_nodes
   150         $lm_page->setTitle($this->
getTitle());
   152         $lm_page->setLMId($a_cont_obj->
getId());
   153         $lm_page->setImportId(
"il__pg_" . $this->
getId());
   154         $lm_page->setType($this->
getType());
   156         $lm_page->create(
true);         
   157         $a_copied_nodes[$this->
getId()] = $lm_page->getId();
   161         $new_md = $md->cloneMD($a_cont_obj->
getId(), $lm_page->getId(), $this->
getType());
   164         $page = $lm_page->getPageObject();
   165         $page->setXMLContent($this->page_object->getXMLContent());
   178         $this->page_object = $a_page_obj;
   190     public function setId(
int $a_id): void
   215         foreach ($pages as $page) {
   216             if (isset($linked_pages[$page[
"obj_id"]])) {
   230         string $a_mode = self::CHAPTER_TITLE,
   231         bool $a_include_numbers = 
false,
   232         bool $a_time_scheduled_activation = 
false,
   233         bool $a_force_content = 
false,
   235         string $a_lang = 
"-",
   236         bool $a_include_short = 
false   238         if ($a_mode == self::NO_HEADER && !$a_force_content) {
   254         if ($a_include_short) {
   263         $languages = $ot->getLanguages();
   265         if ($a_lang != 
"-" && $ot->getContentActivated()) {
   268             if ($a_include_short) {
   269                 $trans_title = trim($lmobjtrans->getShortTitle());
   271             if ($trans_title == 
"") {
   272                 $trans_title = $lmobjtrans->getTitle();
   274             if ($trans_title == 
"") {
   276                 $trans_title = $lmobjtrans->
getTitle();
   278             if ($trans_title != 
"") {
   283         if ($a_mode == self::PAGE_TITLE) {
   289         if ($tree->isInTree($a_pg_id)) {
   290             $pred_node = $tree->fetchPredecessorNode($a_pg_id, 
"st");
   291             $childs = $tree->getChildsByType($pred_node[
"obj_id"], 
"pg");
   293             if (count($childs) > 1) {
   295                 foreach ($childs as $child) {
   299                         $a_time_scheduled_activation
   304                         if ($act_data[
"show_activation_info"] &&
   310                     if ($child[
"type"] != 
"pg" || 
$active) {
   313                     if ($child[
"obj_id"] == $a_pg_id) {
   318                     $cnt_str = 
" (" . $cur_cnt . 
"/" . $cnt . 
")";
   322                 $pred_node[
"obj_id"],
   341         string $a_mode = 
"normal",
   358                 $attrs[
"OriginId"] = 
"il_" . $a_inst .
   359                     "_pg_" . $this->
getId();
   360                 $a_xml_writer->
xmlElement(
"PageAlias", $attrs);
   378         $attrs[
"OriginId"] = 
"il_" . $a_inst .
   380         $a_xml_writer->
xmlElement(
"PageAlias", $attrs);
   389         $md2xml->setExportMode(
true);
   390         $md2xml->startExport();
   391         $a_xml_writer->
appendXML($md2xml->getXML());
   399         if ($a_tag == 
"Identifier" && $a_param == 
"Entry") {
   410         $this->page_object->buildDom();
   411         $this->page_object->insertInstIntoIDs($a_inst);
   412         $this->mobs_contained = $this->page_object->collectMediaObjects(
false);
   414         $xml = $this->page_object->getXMLFromDom(
false, 
false, 
false, 
"", 
true);
   415         $xml = str_replace(
"&", 
"&", $xml);
   418         $this->page_object->freeDom();
   428             $this->content_object->getType(),
   457         string $a_order_field,
   464         $ilDB = $DIC->database();
   467         $count_query = 
"SELECT count(pq.question_id) cnt ";
   470         $query = 
"SELECT pq.page_id, pq.question_id ";
   472         $from = 
" FROM page_question pq JOIN lm_tree t ON (t.lm_id = " . 
$ilDB->quote($a_lm_id, 
"integer") .
   473             " AND pq.page_id = t.child and pq.page_parent_type = " . 
$ilDB->quote(
"lm", 
"text") . 
") " .
   474             " WHERE t.lm_id = " . 
$ilDB->quote($a_lm_id, 
"integer");
   475         $count_query .= $from;
   479         $set = 
$ilDB->query($count_query);
   481         if ($rec = 
$ilDB->fetchAssoc($set)) {
   488             $ilDB->setLimit($limit, $offset);
   492         $set = 
$ilDB->query($query);
   494         while ($rec = 
$ilDB->fetchAssoc($set)) {
   497         return array(
"cnt" => $cnt, 
"set" => $result);
   513         $lng = $DIC->language();
   521             $parent_id = $lm_tree->getParentId($node_id);
   524             $parent_id = $node_id;
   529         for ($i = 1; $i <= $num; $i++) {
   532             $page->setLMId($lm->getId());
   533             $page->create(
false, 
false, $layout_id);
   535             $page_ids[] = $page->getId();
   537         $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)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
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)
 
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 getInstance(int $obj_id)
 
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)
 
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...
 
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...