ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilLMPageObject Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilLMPageObject:
+ Collaboration diagram for ilLMPageObject:

Public Member Functions

 __construct (ilObjLearningModule $a_content_obj, int $a_id=0, bool $a_halt=true)
 
 read ()
 
 create (bool $a_upload=false, bool $a_omit_page_object_creation=false, int $a_layout_id=0)
 
 delete (bool $a_delete_meta_data=true)
 
 copy (ilObjLearningModule $a_target_lm)
 
 copyToOtherContObject (ilObjLearningModule $a_cont_obj, array &$a_copied_nodes)
 copy a page to another content object (learning module / dlib book) More...
 
 assignPageObject (ilLMPage $a_page_obj)
 assign page object More...
 
 getPageObject ()
 get assigned page object More...
 
 setId (int $a_id)
 
 getId ()
 
 exportXML (ilXmlWriter $a_xml_writer, string $a_mode="normal", int $a_inst=0)
 export page object to xml (see ilias_co.dtd) More...
 
 exportXMLMetaData (ilXmlWriter $a_xml_writer)
 
 modifyExportIdentifier (string $a_tag, string $a_param, string $a_value)
 
 exportXMLPageContent (ilXmlWriter $a_xml_writer, int $a_inst=0)
 
 getQuestionIds ()
 Get question ids note: this method must be called afer exportXMLPageContent. More...
 
 getMediaObjectIds ()
 get ids of all media objects within the page note: this method must be called afer exportXMLPageContent More...
 
 getFileItemIds ()
 get ids of all file items within the page note: this method must be called afer exportXMLPageContent More...
 
- Public Member Functions inherited from ilLMObject
 __construct (ilObjLearningModule $a_content_obj, int $a_id=0)
 
 MDUpdateListener (string $a_element)
 Meta data update listener Important note: Do never call create() or update() method of ilObject here. More...
 
 createMetaData ()
 create meta data entry More...
 
 updateMetaData ()
 update meta data entry More...
 
 deleteMetaData ()
 delete meta data entry More...
 
 setDataRecord (array $a_record)
 this method should only be called by class ilLMObjectFactory More...
 
 read ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setShortTitle (string $a_title)
 
 getShortTitle ()
 
 setDescription (string $a_description)
 
 getDescription ()
 
 setType (string $a_type)
 
 getType ()
 
 setLMId (int $a_lm_id)
 
 getLMId ()
 
 setContentObject (ilObjLearningModule $a_content_obj)
 
 getContentObject ()
 
 setId (int $a_id)
 
 getId ()
 
 getImportId ()
 
 setImportId (string $a_id)
 
 setLayout (string $a_val)
 
 getLayout ()
 
 create (bool $a_upload=false)
 
 update ()
 
 delete (bool $a_delete_meta_data=true)
 
 existsExportID (int $a_lm_id, int $a_exp_id, string $a_type="pg")
 Does export ID exist in lm? More...
 
 getExportIDInfo (int $a_lm_id, int $a_exp_id, string $a_type="pg")
 

Static Public Member Functions

static getPageList (int $lm_id)
 
static getPagesWithLinksList (int $a_lm_id, string $a_par_type)
 Get all pages of lm that contain any internal links. More...
 
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 title only, depending on settings More...
 
static _exportXMLAlias (ilXmlWriter $a_xml_writer, int $a_id, int $a_inst=0)
 export page alias to xml More...
 
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. More...
 
static insertPagesFromTemplate (int $lm_id, int $num, int $node_id, bool $first_child, int $layout_id, string $title="")
 Insert (multiple) pages templates at node. More...
 
- Static Public Member Functions inherited from ilLMObject
static _lookupNID (int $a_lm_id, int $a_lm_obj_id, string $a_type)
 lookup named identifier (ILIAS_NID) More...
 
static preloadDataByLM (int $a_lm_id)
 Preload data records by lm. More...
 
static _lookupTitle (int $a_obj_id)
 
static _lookupShortTitle (int $a_obj_id)
 
static _lookupType (int $a_obj_id, int $a_lm_id=0)
 
static _writeTitle (int $a_obj_id, string $a_title)
 
static _writeImportId (int $a_id, string $a_import_id)
 
static _writePublicAccessStatus (array $a_pages, int $a_cont_obj_id)
 update public access flags in lm_data for all pages of a content object More...
 
static _isPagePublic (int $a_node_id, bool $a_check_public_mode=false)
 
static _getIdForImportId (string $a_import_id)
 get current object id for import id (static) More...
 
static _getAllObjectsForImportId (string $a_import_id, int $a_in_lm=0)
 Get all items for an import ID. More...
 
static _exists (int $a_id)
 checks wether a lm content object with specified id exists or not More...
 
static getObjectList (int $lm_id, string $type="")
 
static _deleteAllObjectData (ilObjLearningModule $a_cobj)
 delete all objects of content object (digi book / learning module) More...
 
static _lookupContObjID (int $a_id)
 get learning module id for lm object More...
 
static putInTree (ilLMObject $a_obj, int $a_parent_id=0, int $a_target_node_id=0)
 put this object into content object tree More...
 
static getTree (int $a_cont_obj_id)
 Get learning module tree. More...
 
static clipboardCut (int $a_cont_obj_id, array $a_ids)
 Copy a set of chapters/pages into the clipboard. More...
 
static clipboardCopy (int $a_cont_obj_id, array $a_ids)
 Copy a set of chapters/pages into the clipboard. More...
 
static saveTitles (ilObjLearningModule $a_lm, array $a_titles, string $a_lang="-")
 Save titles for lm objects. More...
 
static updateInternalLinks (array $a_copied_nodes, string $a_parent_type="lm")
 Update internal links, after multiple pages have been copied. More...
 
static uniqueTypesCheck (array $a_items)
 Check for unique types (all pages or all chapters) More...
 
static writeLayout (int $a_obj_id, string $a_layout, ?ilObjLearningModule $a_lm=null)
 Write layout setting. More...
 
static lookupLayout (int $a_obj_id)
 Lookup type. More...
 
static getPagesOfChapter (int $a_lm_id, int $a_chap_id)
 Get pages of chapter. More...
 
static _getAllLMObjectsOfLM (int $a_lm_id, string $a_type="")
 Get all objects of learning module. More...
 
static saveExportId (int $a_lm_id, int $a_lmobj_id, string $a_exp_id, string $a_type="pg")
 
static getExportId (int $a_lm_id, int $a_lmobj_id, string $a_type="pg")
 
static getDuplicateExportIDs (int $a_lm_id, string $a_type="pg")
 Get duplicate export IDs (count export ID usages) More...
 
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="-")
 
static getShortTitles (int $a_lm_id, string $a_lang="-")
 
static writeShortTitle (int $a_id, string $a_short_title, string $a_lang="-")
 

Data Fields

ilLMPage $page_object = null
 
- Data Fields inherited from ilLMObject
const CHAPTER_TITLE = "st_title"
 
const PAGE_TITLE = "pg_title"
 
const NO_HEADER = "none"
 
int $lm_id = 0
 
string $type = ""
 
int $id = 0
 
array $data_record
 
ilObjLearningModule $content_object
 
string $title = ""
 
string $short_title = ""
 
string $description = ""
 
bool $active = true
 

Protected Attributes

bool $halt_on_error
 
array $files_contained
 
array $mobs_contained
 
bool $contains_int_link
 
- Protected Attributes inherited from ilLMObject
string $layout = ""
 
string $import_id = ""
 
ilObjUser $user
 
ilDBInterface $db
 

Additional Inherited Members

- Static Protected Member Functions inherited from ilLMObject
static _lookup (int $a_obj_id, string $a_field)
 
- Static Protected Attributes inherited from ilLMObject
static $data_records = array()
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Handles Page Objects of ILIAS Learning Modules

Note: This class has a member variable that contains an instance of class ilPageObject and provides the method getPageObject() to access this instance. ilPageObject handles page objects and their content. Page objects can be assigned to different container like learning modules or glossaries definitions. This class, ilLMPageObject, provides additional methods for the handling of page objects in learning modules.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 31 of file class.ilLMPageObject.php.

Constructor & Destructor Documentation

◆ __construct()

ilLMPageObject::__construct ( ilObjLearningModule  $a_content_obj,
int  $a_id = 0,
bool  $a_halt = true 
)

Definition at line 39 of file class.ilLMPageObject.php.

References ILIAS\MetaData\Repository\Validation\Data\__construct(), read(), and ilLMObject\setType().

43  {
44  parent::__construct($a_content_obj, $a_id);
45  $this->setType("pg");
46  $this->id = $a_id;
47 
48  $this->contains_int_link = false;
49  $this->mobs_contained = array();
50  $this->files_contained = array();
51  $this->halt_on_error = $a_halt;
52 
53  if ($a_id != 0) {
54  $this->read();
55  }
56  }
setType(string $a_type)
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ _exportXMLAlias()

static ilLMPageObject::_exportXMLAlias ( ilXmlWriter  $a_xml_writer,
int  $a_id,
int  $a_inst = 0 
)
static

export page alias to xml

Definition at line 369 of file class.ilLMPageObject.php.

References ilXmlWriter\xmlElement(), ilXmlWriter\xmlEndTag(), and ilXmlWriter\xmlStartTag().

Referenced by ilStructureObject\exportXMLPageObjects().

373  : void {
374  $attrs = array();
375  $a_xml_writer->xmlStartTag("PageObject", $attrs);
376 
377  $attrs = array();
378  $attrs["OriginId"] = "il_" . $a_inst .
379  "_pg_" . $a_id;
380  $a_xml_writer->xmlElement("PageAlias", $attrs);
381 
382  $a_xml_writer->xmlEndTag("PageObject");
383  }
xmlEndTag(string $tag)
Writes an endtag.
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)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getPresentationTitle()

static ilLMPageObject::_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 
)
static

presentation title doesn't have to be page title, it may be chapter title + page title or chapter title only, depending on settings

Parameters
string$a_modeilLMOBject::CHAPTER_TITLE | ilLMOBject::PAGE_TITLE | ilLMOBject::NO_HEADER

Definition at line 228 of file class.ilLMPageObject.php.

References ilLMObject\$active, ilLMObject\$title, ilStructureObject\_getPresentationTitle(), ilPageObject\_lookupActivationData(), ilPageObject\_lookupActive(), ilLMObject\_lookupContObjID(), ilLMObject\_lookupShortTitle(), ilLMObject\_lookupTitle(), ilObject\_lookupType(), ilLMTree\getInstance(), ilObjectTranslation\getInstance(), ilLMObjTranslation\getTitle(), and ilUtil\now().

Referenced by ilLMObject\_getNodePresentationTitle(), ilLMNavigationRendererGUI\addDropdown(), ilObjContentObjectGUI\addLocations(), ilLMPageObjectGUI\executeCommand(), ilLMTOCExplorerGUI\getNodeContent(), ilLearningModuleNotification\getPageTitle(), ilGlossaryPresentationGUI\listDefinitions(), ilLMNavigationRendererGUI\render(), ilLMContentRendererGUI\render(), ilLMPresentationGUI\showPrintView(), and ilLMPresentationGUI\showPrintViewSelection().

237  : string {
238  if ($a_mode == self::NO_HEADER && !$a_force_content) {
239  return "";
240  }
241 
242  $cur_cnt = 0;
243 
244  if ($a_lm_id == 0) {
245  $a_lm_id = ilLMObject::_lookupContObjID($a_pg_id);
246  }
247 
248  if ($a_lm_id == 0) {
249  return "";
250  }
251 
252  // this is optimized when ilLMObject::preloadDataByLM is invoked (e.g. done in ilLMExplorerGUI)
253  $title = "";
254  if ($a_include_short) {
255  $title = trim(ilLMObject::_lookupShortTitle($a_pg_id));
256  }
257  if ($title == "") {
258  $title = ilLMObject::_lookupTitle($a_pg_id);
259  }
260 
261  // this is also optimized since ilObjectTranslation re-uses instances for one lm
262  $ot = ilObjectTranslation::getInstance($a_lm_id);
263  $languages = $ot->getLanguages();
264 
265  if ($a_lang != "-" && $ot->getContentActivated()) {
266  $lmobjtrans = new ilLMObjTranslation($a_pg_id, $a_lang);
267  $trans_title = "";
268  if ($a_include_short) {
269  $trans_title = trim($lmobjtrans->getShortTitle());
270  }
271  if ($trans_title == "") {
272  $trans_title = $lmobjtrans->getTitle();
273  }
274  if ($trans_title == "") {
275  $lmobjtrans = new ilLMObjTranslation($a_pg_id, $ot->getFallbackLanguage());
276  $trans_title = $lmobjtrans->getTitle();
277  }
278  if ($trans_title != "") {
279  $title = $trans_title;
280  }
281  }
282 
283  if ($a_mode == self::PAGE_TITLE) {
284  return $title;
285  }
286 
287  $tree = ilLMTree::getInstance($a_lm_id);
288 
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");
292  $cnt_str = "";
293  if (count($childs) > 1) {
294  $cnt = 0;
295  foreach ($childs as $child) {
297  $child["obj_id"],
298  ilObject::_lookupType($a_lm_id),
299  $a_time_scheduled_activation
300  );
301 
302  if (!$active) {
303  $act_data = ilLMPage::_lookupActivationData((int) $child["obj_id"], ilObject::_lookupType($a_lm_id));
304  if ($act_data["show_activation_info"] &&
305  (ilUtil::now() < $act_data["activation_start"])) {
306  $active = true;
307  }
308  }
309 
310  if ($child["type"] != "pg" || $active) {
311  $cnt++;
312  }
313  if ($child["obj_id"] == $a_pg_id) {
314  $cur_cnt = $cnt;
315  }
316  }
317  if ($cnt > 1) {
318  $cnt_str = " (" . $cur_cnt . "/" . $cnt . ")";
319  }
320  }
322  $pred_node["obj_id"],
323  self::CHAPTER_TITLE,
324  $a_include_numbers,
325  false,
326  false,
327  0,
328  $a_lang,
329  true
330  ) . $cnt_str;
331  } else {
332  return $title;
333  }
334  }
static _lookupActive(int $a_id, string $a_parent_type, bool $a_check_scheduled_activation=false, string $a_lang="-")
lookup activation status
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 _lookupShortTitle(int $a_obj_id)
static _lookupActivationData(int $a_id, string $a_parent_type, string $a_lang="-")
Lookup activation data.
static now()
Return current timestamp in Y-m-d H:i:s format.
static getInstance(int $a_tree_id)
static _lookupTitle(int $a_obj_id)
static getInstance(int $obj_id)
static _lookupContObjID(int $a_id)
get learning module id for lm object
static _lookupType(int $id, bool $reference=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ assignPageObject()

ilLMPageObject::assignPageObject ( ilLMPage  $a_page_obj)

assign page object

Definition at line 176 of file class.ilLMPageObject.php.

176  : void
177  {
178  $this->page_object = $a_page_obj;
179  }

◆ copy()

ilLMPageObject::copy ( ilObjLearningModule  $a_target_lm)

Definition at line 92 of file class.ilLMPageObject.php.

References ilLMObjTranslation\copy(), ilLMObject\existsExportID(), ilLMObject\getDescription(), ilLMObject\getExportId(), getId(), ilObject\getId(), ilLMObject\getLayout(), ilLMObject\getLMId(), ilLMObject\getShortTitle(), ilLMObject\getTitle(), ilLMObject\getType(), and ilLMObject\saveExportId().

94  : ilLMPageObject {
95  // copy page
96  $lm_page = new ilLMPageObject($a_target_lm);
97  $lm_page->setTitle($this->getTitle());
98  $lm_page->setShortTitle($this->getShortTitle());
99  $lm_page->setLayout($this->getLayout());
100  $lm_page->setLMId($a_target_lm->getId());
101  $lm_page->setType($this->getType());
102  $lm_page->setDescription($this->getDescription());
103  $lm_page->setImportId("il__pg_" . $this->getId());
104  $lm_page->create(true); // setting "upload" flag to true prevents creating of meta data
105 
106  // check whether export id already exists in the target lm
107  $del_exp_id = false;
108  $exp_id = ilLMPageObject::getExportId($this->getLMId(), $this->getId());
109  if (trim($exp_id) != "") {
110  if (ilLMPageObject::existsExportID($a_target_lm->getId(), $exp_id)) {
111  $del_exp_id = true;
112  }
113  }
114 
115  // copy meta data
116  $md = new ilMD($this->getLMId(), $this->getId(), $this->getType());
117  $new_md = $md->cloneMD($a_target_lm->getId(), $lm_page->getId(), $this->getType());
118 
119  // check whether export id already exists in the target lm
120  if ($del_exp_id) {
121  ilLMPageObject::saveExportId($a_target_lm->getId(), $lm_page->getId(), "");
122  } else {
124  $a_target_lm->getId(),
125  $lm_page->getId(),
126  trim($exp_id)
127  );
128  }
129 
130  // copy page content and activation
131  $page = $lm_page->getPageObject();
132  $this->page_object->copy($page->getId(), $page->getParentType(), $page->getParentId());
133  $lm_page->read(); // this gets the updated page object into lm page
134 
135  // copy translations
136  ilLMObjTranslation::copy($this->getId(), $lm_page->getId());
137 
138  return $lm_page;
139  }
static getExportId(int $a_lm_id, int $a_lmobj_id, string $a_type="pg")
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...
existsExportID(int $a_lm_id, int $a_exp_id, string $a_type="pg")
Does export ID exist in lm?
static saveExportId(int $a_lm_id, int $a_lmobj_id, string $a_exp_id, string $a_type="pg")
+ Here is the call graph for this function:

◆ copyToOtherContObject()

ilLMPageObject::copyToOtherContObject ( ilObjLearningModule  $a_cont_obj,
array &  $a_copied_nodes 
)

copy a page to another content object (learning module / dlib book)

Definition at line 144 of file class.ilLMPageObject.php.

References ilLMObject\getDescription(), getId(), ilObject\getId(), ilLMObject\getLMId(), ilLMObject\getShortTitle(), ilLMObject\getTitle(), and ilLMObject\getType().

147  : ilLMPageObject {
148  // copy page
149  $lm_page = new ilLMPageObject($a_cont_obj);
150  $lm_page->setTitle($this->getTitle());
151  $lm_page->setShortTitle($this->getShortTitle());
152  $lm_page->setLMId($a_cont_obj->getId());
153  $lm_page->setImportId("il__pg_" . $this->getId());
154  $lm_page->setType($this->getType());
155  $lm_page->setDescription($this->getDescription());
156  $lm_page->create(true); // setting "upload" flag to true prevents creating of meta data
157  $a_copied_nodes[$this->getId()] = $lm_page->getId();
158 
159  // copy meta data
160  $md = new ilMD($this->getLMId(), $this->getId(), $this->getType());
161  $new_md = $md->cloneMD($a_cont_obj->getId(), $lm_page->getId(), $this->getType());
162 
163  // copy page content
164  $page = $lm_page->getPageObject();
165  $page->setXMLContent($this->page_object->getXMLContent());
166  $page->buildDom();
167  $page->update();
168 
169  return $lm_page;
170  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ create()

ilLMPageObject::create ( bool  $a_upload = false,
bool  $a_omit_page_object_creation = false,
int  $a_layout_id = 0 
)

Definition at line 64 of file class.ilLMPageObject.php.

References getId(), and ilLMObject\getLMId().

68  : void {
69  parent::create($a_upload);
70  if ($a_omit_page_object_creation) {
71  return;
72  }
73  if (!is_object($this->page_object)) {
74  $this->page_object = new ilLMPage();
75  }
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);
80  } else {
81  $this->page_object->createWithLayoutId($a_layout_id);
82  }
83  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ delete()

ilLMPageObject::delete ( bool  $a_delete_meta_data = true)

Definition at line 85 of file class.ilLMPageObject.php.

85  : void
86  {
87  parent::delete($a_delete_meta_data);
88  $this->page_object->delete();
89  }

◆ exportXML()

ilLMPageObject::exportXML ( ilXmlWriter  $a_xml_writer,
string  $a_mode = "normal",
int  $a_inst = 0 
)

export page object to xml (see ilias_co.dtd)

Definition at line 339 of file class.ilLMPageObject.php.

References exportXMLMetaData(), exportXMLPageContent(), getId(), ilXmlWriter\xmlElement(), ilXmlWriter\xmlEndTag(), and ilXmlWriter\xmlStartTag().

343  : void {
344  $attrs = array();
345  $a_xml_writer->xmlStartTag("PageObject", $attrs);
346 
347  switch ($a_mode) {
348  case "normal":
349  // MetaData
350  $this->exportXMLMetaData($a_xml_writer);
351 
352  // PageContent
353  $this->exportXMLPageContent($a_xml_writer, $a_inst);
354  break;
355 
356  case "alias":
357  $attrs = array();
358  $attrs["OriginId"] = "il_" . $a_inst .
359  "_pg_" . $this->getId();
360  $a_xml_writer->xmlElement("PageAlias", $attrs);
361  break;
362  }
363  $a_xml_writer->xmlEndTag("PageObject");
364  }
exportXMLMetaData(ilXmlWriter $a_xml_writer)
xmlEndTag(string $tag)
Writes an endtag.
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)
exportXMLPageContent(ilXmlWriter $a_xml_writer, int $a_inst=0)
+ Here is the call graph for this function:

◆ exportXMLMetaData()

ilLMPageObject::exportXMLMetaData ( ilXmlWriter  $a_xml_writer)

Definition at line 385 of file class.ilLMPageObject.php.

References ilXmlWriter\appendXML(), getId(), ilLMObject\getLMId(), and ilLMObject\getType().

Referenced by exportXML().

387  : void {
388  $md2xml = new ilMD2XML($this->getLMId(), $this->getId(), $this->getType());
389  $md2xml->setExportMode(true);
390  $md2xml->startExport();
391  $a_xml_writer->appendXML($md2xml->getXML());
392  }
appendXML(string $a_str)
append xml string to document
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportXMLPageContent()

ilLMPageObject::exportXMLPageContent ( ilXmlWriter  $a_xml_writer,
int  $a_inst = 0 
)

Definition at line 406 of file class.ilLMPageObject.php.

References ilXmlWriter\appendXML(), and ilPCFileList\collectFileItems().

Referenced by exportXML().

409  : void {
410  $this->page_object->buildDom();
411  $this->page_object->insertInstIntoIDs($a_inst);
412  $this->mobs_contained = $this->page_object->collectMediaObjects(false);
413  $this->files_contained = ilPCFileList::collectFileItems($this->page_object, $this->page_object->getDomDoc());
414  $xml = $this->page_object->getXMLFromDom(false, false, false, "", true);
415  $xml = str_replace("&", "&amp;", $xml);
416  $a_xml_writer->appendXML($xml);
417 
418  $this->page_object->freeDom();
419  }
appendXML(string $a_str)
append xml string to document
static collectFileItems(ilPageObject $a_page, DOMDocument $a_domdoc)
Get all file items that are used within the page.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFileItemIds()

ilLMPageObject::getFileItemIds ( )

get ids of all file items within the page note: this method must be called afer exportXMLPageContent

Definition at line 446 of file class.ilLMPageObject.php.

References $files_contained.

446  : array
447  {
448  return $this->files_contained;
449  }

◆ getId()

ilLMPageObject::getId ( )

Definition at line 195 of file class.ilLMPageObject.php.

References ilLMObject\$id.

Referenced by copy(), copyToOtherContObject(), create(), exportXML(), exportXMLMetaData(), getQuestionIds(), and modifyExportIdentifier().

195  : int
196  {
197  return $this->id;
198  }
+ Here is the caller graph for this function:

◆ getMediaObjectIds()

ilLMPageObject::getMediaObjectIds ( )

get ids of all media objects within the page note: this method must be called afer exportXMLPageContent

Definition at line 437 of file class.ilLMPageObject.php.

References $mobs_contained.

437  : array
438  {
439  return $this->mobs_contained;
440  }

◆ getPageList()

◆ getPageObject()

ilLMPageObject::getPageObject ( )

get assigned page object

Definition at line 185 of file class.ilLMPageObject.php.

References $page_object.

185  : ilLMPage
186  {
187  return $this->page_object;
188  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ getPagesWithLinksList()

static ilLMPageObject::getPagesWithLinksList ( int  $a_lm_id,
string  $a_par_type 
)
static

Get all pages of lm that contain any internal links.

Definition at line 208 of file class.ilLMPageObject.php.

References getPageList(), and ilPageObject\getPagesWithLinks().

Referenced by ilLinksTableGUI\getLinks().

211  : array {
212  $pages = ilLMPageObject::getPageList($a_lm_id);
213  $linked_pages = ilLMPage::getPagesWithLinks($a_par_type, $a_lm_id);
214  $result = array();
215  foreach ($pages as $page) {
216  if (isset($linked_pages[$page["obj_id"]])) {
217  $result[] = $page;
218  }
219  }
220  return $result;
221  }
static getPagesWithLinks(string $a_parent_type, int $a_parent_id, string $a_lang="-")
Get all pages for parent object that contain internal links.
static getPageList(int $lm_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getQuestionIds()

ilLMPageObject::getQuestionIds ( )

Get question ids note: this method must be called afer exportXMLPageContent.

Definition at line 425 of file class.ilLMPageObject.php.

References ilPCQuestion\_getQuestionIdsForPage(), and getId().

425  : array
426  {
428  $this->content_object->getType(),
429  $this->getId()
430  );
431  }
static _getQuestionIdsForPage(string $a_parent_type, int $a_page_id, string $a_lang="-")
+ Here is the call graph for this function:

◆ insertPagesFromTemplate()

static ilLMPageObject::insertPagesFromTemplate ( int  $lm_id,
int  $num,
int  $node_id,
bool  $first_child,
int  $layout_id,
string  $title = "" 
)
static

Insert (multiple) pages templates at node.

Definition at line 503 of file class.ilLMPageObject.php.

References $DIC, $lng, ilLMObject\$title, ilTree\POS_FIRST_NODE, and ilLMObject\putInTree().

Referenced by ilStructureObjectGUI\insertPageFromTemplate().

510  : array {
511  global $DIC;
512 
513  $lng = $DIC->language();
514 
515  if ($title == "") {
516  $title = $lng->txt("cont_new_page");
517  }
518  $lm_tree = new ilLMTree($lm_id);
519  $lm = new ilObjLearningModule($lm_id, false);
520  if (!$first_child) { // insert after node id
521  $parent_id = $lm_tree->getParentId($node_id);
522  $target = $node_id;
523  } else { // insert as first child
524  $parent_id = $node_id;
525  $target = ilTree::POS_FIRST_NODE;
526  }
527 
528  $page_ids = array();
529  for ($i = 1; $i <= $num; $i++) {
530  $page = new ilLMPageObject($lm);
531  $page->setTitle($title);
532  $page->setLMId($lm->getId());
533  $page->create(false, false, $layout_id);
534  ilLMObject::putInTree($page, $parent_id, $target);
535  $page_ids[] = $page->getId();
536  }
537  $page_ids = array_reverse($page_ids);
538  return $page_ids;
539  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static putInTree(ilLMObject $a_obj, int $a_parent_id=0, int $a_target_node_id=0)
put this object into content object tree
global $DIC
Definition: feed.php:28
const POS_FIRST_NODE
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$lng
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ modifyExportIdentifier()

ilLMPageObject::modifyExportIdentifier ( string  $a_tag,
string  $a_param,
string  $a_value 
)

Definition at line 394 of file class.ilLMPageObject.php.

References getId(), and IL_INST_ID.

398  : string {
399  if ($a_tag == "Identifier" && $a_param == "Entry") {
400  $a_value = "il_" . IL_INST_ID . "_pg_" . $this->getId();
401  }
402 
403  return $a_value;
404  }
const IL_INST_ID
Definition: constants.php:40
+ Here is the call graph for this function:

◆ queryQuestionsOfLearningModule()

static ilLMPageObject::queryQuestionsOfLearningModule ( int  $a_lm_id,
string  $a_order_field,
string  $a_order_dir,
int  $a_offset,
int  $a_limit 
)
static

Get questions of learning module.

Definition at line 455 of file class.ilLMPageObject.php.

References $DIC, and $ilDB.

Referenced by ilLMTracker\getBlockedUsersInformation(), ilLMQuestionListTableGUI\getItems(), and ilLMTracker\loadLMTrackingData().

461  : array {
462  global $DIC;
463 
464  $ilDB = $DIC->database();
465 
466  // count query
467  $count_query = "SELECT count(pq.question_id) cnt ";
468 
469  // basic query
470  $query = "SELECT pq.page_id, pq.question_id ";
471 
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;
476  $query .= $from;
477 
478  // count query
479  $set = $ilDB->query($count_query);
480  $cnt = 0;
481  if ($rec = $ilDB->fetchAssoc($set)) {
482  $cnt = $rec["cnt"];
483  }
484 
485  $offset = $a_offset;
486  $limit = $a_limit;
487  if ($a_limit > 0) {
488  $ilDB->setLimit($limit, $offset);
489  }
490 
491  // set query
492  $set = $ilDB->query($query);
493  $result = array();
494  while ($rec = $ilDB->fetchAssoc($set)) {
495  $result[] = $rec;
496  }
497  return array("cnt" => $cnt, "set" => $result);
498  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ read()

ilLMPageObject::read ( )

Definition at line 58 of file class.ilLMPageObject.php.

Referenced by __construct().

58  : void
59  {
60  parent::read();
61  $this->page_object = new ilLMPage($this->id, 0);
62  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ setId()

ilLMPageObject::setId ( int  $a_id)

Definition at line 190 of file class.ilLMPageObject.php.

190  : void
191  {
192  $this->id = $a_id;
193  }

Field Documentation

◆ $contains_int_link

bool ilLMPageObject::$contains_int_link
protected

Definition at line 36 of file class.ilLMPageObject.php.

◆ $files_contained

array ilLMPageObject::$files_contained
protected

Definition at line 34 of file class.ilLMPageObject.php.

Referenced by getFileItemIds().

◆ $halt_on_error

bool ilLMPageObject::$halt_on_error
protected

Definition at line 33 of file class.ilLMPageObject.php.

◆ $mobs_contained

array ilLMPageObject::$mobs_contained
protected

Definition at line 35 of file class.ilLMPageObject.php.

Referenced by getMediaObjectIds().

◆ $page_object

ilLMPage ilLMPageObject::$page_object = null

Definition at line 37 of file class.ilLMPageObject.php.

Referenced by getPageObject().


The documentation for this class was generated from the following file: