Public Member Functions | |
ilLMPageObject (&$a_content_obj, $a_id=0, $a_halt=true) | |
Constructor public. | |
_ilLMPageObject () | |
read () | |
create ($a_upload=false) | |
delete ($a_delete_meta_data=true) | |
delete lm object data | |
& | copy () |
copy page | |
& | copyToOtherContObject (&$a_cont_obj) |
copy a page to another content object (learning module / dlib book) | |
_splitPage ($a_page_id, $a_pg_parent_type, $a_hier_id) | |
split page at hierarchical id | |
_splitPageNext ($a_page_id, $a_pg_parent_type, $a_hier_id) | |
split page to next page at hierarchical id | |
assignPageObject (&$a_page_obj) | |
assign page object | |
& | getPageObject () |
get assigned page object | |
setId ($a_id) | |
set id | |
getId () | |
setAlias ($a_is_alias) | |
set wether page object is an alias | |
isAlias () | |
setOriginID ($a_id) | |
getOriginID () | |
getPageList ($lm_id) | |
static | |
_getPresentationTitle ($a_pg_id, $a_mode=IL_CHAPTER_TITLE, $a_include_numbers=false) | |
presentation title doesn't have to be page title, it may be chapter title + page title or chapter title only, depending on settings | |
exportXML (&$a_xml_writer, $a_mode="normal", $a_inst=0) | |
export page object to xml (see ilias_co.dtd) | |
_exportXMLAlias (&$a_xml_writer, $a_id, $a_inst=0) | |
export page alias to xml | |
exportXMLMetaData (&$a_xml_writer) | |
export page objects meta data to xml (see ilias_co.dtd) | |
modifyExportIdentifier ($a_tag, $a_param, $a_value) | |
exportXMLPageContent (&$a_xml_writer, $a_inst=0) | |
export page objects meta data to xml (see ilias_co.dtd) | |
getMediaObjectIds () | |
get ids of all media objects within the page | |
getFileItemIds () | |
get ids of all file items within the page | |
exportFO (&$a_xml_writer) | |
export page object to fo | |
_goto ($a_target) | |
redirect script | |
Data Fields | |
$is_alias | |
$origin_id | |
$id | |
$ilias | |
$dom | |
$page_object |
Definition at line 48 of file class.ilLMPageObject.php.
ilLMPageObject::_exportXMLAlias | ( | &$ | a_xml_writer, | |
$ | a_id, | |||
$ | a_inst = 0 | |||
) |
export page alias to xml
Definition at line 501 of file class.ilLMPageObject.php.
Referenced by ilStructureObject::exportXMLPageObjects().
{ $attrs = array(); $a_xml_writer->xmlStartTag("PageObject", $attrs); $attrs = array(); $attrs["OriginId"] = "il_".$a_inst. "_pg_".$a_id; $a_xml_writer->xmlElement("PageAlias", $attrs); $a_xml_writer->xmlEndTag("PageObject"); }
ilLMPageObject::_getPresentationTitle | ( | $ | a_pg_id, | |
$ | a_mode = IL_CHAPTER_TITLE , |
|||
$ | a_include_numbers = false | |||
) |
presentation title doesn't have to be page title, it may be chapter title + page title or chapter title only, depending on settings
string | $a_mode IL_CHAPTER_TITLE | IL_PAGE_TITLE | IL_NO_HEADER |
Definition at line 369 of file class.ilLMPageObject.php.
Referenced by ilSearchGUI::__formatDigiLibResult(), ilSearchGUI::__formatLearningModuleResult(), ilSearchGUI::__save(), ilObjContentObjectGUI::addLocations(), ilLMTOCExplorer::buildTitle(), ilTableOfContentsExplorer::buildTitle(), ilContObjLocatorGUI::display(), ilLMPageObjectGUI::executeCommand(), exportFO(), ilLMPresentationGUI::ilLMNavigation(), ilLMPresentationGUI::ilPage(), ilLMPresentationGUI::ilTranslation(), ilObjContentObjectGUI::linkChecker(), ilLMPresentationGUI::showPrintView(), and ilLMPresentationGUI::showPrintViewSelection().
{ global $ilDB; // select $query = "SELECT * FROM lm_data WHERE obj_id = '".$a_pg_id."'"; $pg_set = $ilDB->query($query); $pg_rec = $pg_set->fetchRow(DB_FETCHMODE_ASSOC); if($a_mode == IL_NO_HEADER) { return ""; } $tree = new ilTree($pg_rec["lm_id"]); $tree->setTableNames('lm_tree','lm_data'); $tree->setTreeTablePK("lm_id"); if($a_mode == IL_PAGE_TITLE) { $nr = ""; /* if ($a_include_numbers) { if ($tree->isInTree($pg_rec["obj_id"])) { // get page tree node $query = "SELECT * FROM lm_tree WHERE child = ". $ilDB->quote($a_pg_id)." AND lm_id = ". $ilDB->quote($pg_rec["lm_id"]); $tree_set = $ilDB->query($query); $tree_node = $tree_set->fetchRow(DB_FETCHMODE_ASSOC); $depth = $tree_node["depth"]; //$nr = $tree->getChildSequenceNumber($tree_node)." "; $nr = " "; $dot = ""; for ($i = $depth - 1; $i > 1; $i --) { // get next parent tree node $query = "SELECT * FROM lm_tree WHERE child = ". $ilDB->quote($tree_node["parent"])." AND lm_id = ". $ilDB->quote($pg_rec["lm_id"]); $tree_set = $ilDB->query($query); $tree_node = $tree_set->fetchRow(DB_FETCHMODE_ASSOC); $seq = $tree->getChildSequenceNumber($tree_node); $nr = $seq.$dot.$nr; $dot = "."; } } }*/ return $nr.$pg_rec["title"]; } if ($tree->isInTree($pg_rec["obj_id"])) { $pred_node = $tree->fetchPredecessorNode($pg_rec["obj_id"], "st"); $childs = $tree->getChildsByType($pred_node["obj_id"], "pg"); $cnt_str = ""; if(count($childs) > 1) { $cur_cnt = 0; foreach($childs as $child) { $cur_cnt++; if($child["obj_id"] == $pg_rec["obj_id"]) { break; } } $cnt_str = " (".$cur_cnt."/".count($childs).")"; } /* require_once("content/classes/class.ilStructureObject.php"); $struct_obj =& new ilStructureObject($pred_node["obj_id"]); return $struct_obj->getTitle();*/ return $pred_node["title"].$cnt_str; } else { return $pg_rec["title"]; } }
ilLMPageObject::_goto | ( | $ | a_target | ) |
redirect script
string | $a_target |
Definition at line 619 of file class.ilLMPageObject.php.
References $ilErr, ilLMObject::$lm_id, $lng, $rbacsystem, $ref_id, ilSearch::_checkParentConditions(), ilObject::_getAllReferences(), ilLMObject::_lookupContObjID(), and ilUtil::redirect().
{ global $rbacsystem, $ilErr, $lng; // determine learning object $lm_id = ilLMObject::_lookupContObjID($a_target); // get all references $ref_ids = ilObject::_getAllReferences($lm_id); // check read permissions foreach ($ref_ids as $ref_id) { include_once 'classes/class.ilSearch.php'; // Added this additional check (ParentConditions) to avoid calls of objects inside e.g courses. // Will be replaced in future releases by ilAccess::checkAccess() if ($rbacsystem->checkAccess("read", $ref_id) and ilSearch::_checkParentConditions($ref_id)) { ilUtil::redirect("content/lm_presentation.php?ref_id=$ref_id". "&obj_id=$a_target"); } } $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL); }
ilLMPageObject::_ilLMPageObject | ( | ) |
Definition at line 86 of file class.ilLMPageObject.php.
{
if(is_object($this->page_object))
{
unset($this->page_object);
}
}
ilLMPageObject::_splitPage | ( | $ | a_page_id, | |
$ | a_pg_parent_type, | |||
$ | a_hier_id | |||
) |
split page at hierarchical id
the main reason for this method being static is that a lm page object is not available within ilPageContentGUI where this method is called
Definition at line 183 of file class.ilLMPageObject.php.
References ilLMObject::$lm_id, $tree, ilLMObject::$type, ilLMObject::_lookupContObjID(), ilObject::_lookupType(), and ilLMPageObject().
Referenced by ilPageContentGUI::splitPage().
{ // get content object (learning module / digilib book) $lm_id = ilLMObject::_lookupContObjID($a_page_id); $type = ilObject::_lookupType($lm_id, false); switch ($type) { case "lm": include_once ("content/classes/class.ilObjLearningModule.php"); $cont_obj = new ilObjLearningModule($lm_id, false); break; case "dbk": include_once ("content/classes/class.ilObjDlBook.php"); $cont_obj = new ilObjDlBook($lm_id, false); break; } $source_lm_page =& new ilLMPageObject($cont_obj, $a_page_id); // create new page $meta =& new ilMetaData(); $lm_page =& new ilLMPageObject($cont_obj); $lm_page->assignMetaData($meta); $lm_page->setTitle($source_lm_page->getTitle()); $lm_page->setLMId($source_lm_page->getLMId()); $lm_page->setType($source_lm_page->getType()); $lm_page->setDescription($source_lm_page->getDescription()); $lm_page->create(); // copy complete content of source page to new page $source_page =& $source_lm_page->getPageObject(); $page =& $lm_page->getPageObject(); $page->setXMLContent($source_page->getXMLContent()); $page->buildDom(); // insert new page in tree (after original page) $tree = new ilTree($cont_obj->getId()); $tree->setTableNames('lm_tree','lm_data'); $tree->setTreeTablePK("lm_id"); if ($tree->isInTree($source_lm_page->getId())) { $parent_node = $tree->getParentNodeData($source_lm_page->getId()); $tree->insertNode($lm_page->getId(), $parent_node["child"], $source_lm_page->getId()); } // remove all nodes >= hierarchical id from source page $source_page->buildDom(); $source_page->addHierIds(); $source_page->deleteContentFromHierId($a_hier_id); // remove all nodes < hierarchical id from new page (incl. update) $page->addHierIds(); $page->deleteContentBeforeHierId($a_hier_id); return $lm_page; }
ilLMPageObject::_splitPageNext | ( | $ | a_page_id, | |
$ | a_pg_parent_type, | |||
$ | a_hier_id | |||
) |
split page to next page at hierarchical id
the main reason for this method being static is that a lm page object is not available within ilPageContentGUI where this method is called
Definition at line 249 of file class.ilLMPageObject.php.
References ilLMObject::$lm_id, $tree, ilLMObject::$type, ilLMObject::_lookupContObjID(), ilObject::_lookupType(), ilPageObject::_moveContentAfterHierId(), and ilLMPageObject().
Referenced by ilPageContentGUI::splitPageNext().
{ // get content object (learning module / digilib book) $lm_id = ilLMObject::_lookupContObjID($a_page_id); $type = ilObject::_lookupType($lm_id, false); switch ($type) { case "lm": include_once ("content/classes/class.ilObjLearningModule.php"); $cont_obj = new ilObjLearningModule($lm_id, false); break; case "dbk": include_once ("content/classes/class.ilObjDlBook.php"); $cont_obj = new ilObjDlBook($lm_id, false); break; } $tree = new ilTree($cont_obj->getId()); $tree->setTableNames('lm_tree','lm_data'); $tree->setTreeTablePK("lm_id"); $source_lm_page =& new ilLMPageObject($cont_obj, $a_page_id); $source_page =& $source_lm_page->getPageObject(); // get next page $succ = $tree->fetchSuccessorNode($a_page_id, "pg"); if ($succ["child"] > 0) { $target_lm_page =& new ilLMPageObject($cont_obj, $succ["child"]); $target_page =& $target_lm_page->getPageObject(); $target_page->buildDom(); $target_page->addHierIds(); // move nodes to target page $source_page->buildDom(); $source_page->addHierIds(); ilPageObject::_moveContentAfterHierId($source_page, $target_page, $a_hier_id); //$source_page->deleteContentFromHierId($a_hier_id); return $succ["child"]; } }
ilLMPageObject::assignPageObject | ( | &$ | a_page_obj | ) |
assign page object
object | $a_page_obj page object |
Definition at line 299 of file class.ilLMPageObject.php.
{ $this->page_object =& $a_page_obj; }
& ilLMPageObject::copy | ( | ) |
copy page
Definition at line 132 of file class.ilLMPageObject.php.
References ilLMObject::getContentObject(), ilLMObject::getDescription(), ilLMObject::getLMId(), ilLMObject::getTitle(), ilLMObject::getType(), and ilLMPageObject().
{ $meta =& new ilMetaData(); $lm_page =& new ilLMPageObject($this->getContentObject()); $lm_page->assignMetaData($meta); $lm_page->setTitle($this->getTitle()); $lm_page->setLMId($this->getLMId()); $lm_page->setType($this->getType()); $lm_page->setDescription($this->getDescription()); $lm_page->create(); $page =& $lm_page->getPageObject(); $page->setXMLContent($this->page_object->getXMLContent()); $page->buildDom(); $page->update(); return $lm_page; }
& ilLMPageObject::copyToOtherContObject | ( | &$ | a_cont_obj | ) |
copy a page to another content object (learning module / dlib book)
Definition at line 155 of file class.ilLMPageObject.php.
References ilLMObject::getDescription(), ilLMObject::getTitle(), ilLMObject::getType(), and ilLMPageObject().
{ //echo "<br>from page lm:".$this->getLMId().", pg: ".$this->getId(); $meta =& new ilMetaData(); $lm_page =& new ilLMPageObject($a_cont_obj); $lm_page->assignMetaData($meta); $lm_page->setTitle($this->getTitle()); $lm_page->setLMId($a_cont_obj->getId()); $lm_page->setType($this->getType()); $lm_page->setDescription($this->getDescription()); $lm_page->create(); //echo "<br>to page lm:".$lm_page->getLMId().", pg: ".$lm_page->getId(); $page =& $lm_page->getPageObject(); $page->setXMLContent($this->page_object->getXMLContent()); $page->buildDom(); $page->update(); return $lm_page; }
ilLMPageObject::create | ( | $ | a_upload = false |
) |
Reimplemented from ilLMObject.
Definition at line 110 of file class.ilLMPageObject.php.
References getId(), and ilLMObject::getLMId().
{ parent::create($a_upload); if(!is_object($this->page_object)) { $this->page_object =& new ilPageObject($this->content_object->getType()); } $this->page_object->setId($this->getId()); $this->page_object->setParentId($this->getLMId()); $this->page_object->create($a_upload); }
ilLMPageObject::delete | ( | $ | a_delete_meta_data = true |
) |
delete lm object data
Reimplemented from ilLMObject.
Definition at line 122 of file class.ilLMPageObject.php.
{ parent::delete($a_delete_meta_data); $this->page_object->delete(); }
ilLMPageObject::exportFO | ( | &$ | a_xml_writer | ) |
export page object to fo
object | $a_xml_writer ilXmlWriter object that receives the xml data |
Definition at line 590 of file class.ilLMPageObject.php.
References $ilBench, ilLMObject::$title, _getPresentationTitle(), and getId().
{ global $ilBench; //$attrs = array(); //$a_xml_writer->xmlStartTag("PageObject", $attrs); $title = ilLMPageObject::_getPresentationTitle($this->getId()); if ($title != "") { $attrs = array(); $attrs["font-family"] = "Times"; $attrs["font-size"] = "14pt"; $a_xml_writer->xmlElement("fo:block", $attrs, $title); } // PageContent $this->page_object->buildDom(); $fo = $this->page_object->getFO(); $a_xml_writer->appendXML($fo); //$a_xml_writer->xmlEndTag("PageObject"); }
ilLMPageObject::exportXML | ( | &$ | a_xml_writer, | |
$ | a_mode = "normal" , |
|||
$ | a_inst = 0 | |||
) |
export page object to xml (see ilias_co.dtd)
object | $a_xml_writer ilXmlWriter object that receives the xml data |
Definition at line 463 of file class.ilLMPageObject.php.
References $ilBench, exportXMLMetaData(), and exportXMLPageContent().
{ global $ilBench; $attrs = array(); $a_xml_writer->xmlStartTag("PageObject", $attrs); switch ($a_mode) { case "normal": // MetaData $ilBench->start("ContentObjectExport", "exportPageObject_XML_Meta"); $this->exportXMLMetaData($a_xml_writer); $ilBench->stop("ContentObjectExport", "exportPageObject_XML_Meta"); // PageContent $ilBench->start("ContentObjectExport", "exportPageObject_XML_PageContent"); $this->exportXMLPageContent($a_xml_writer, $a_inst); $ilBench->stop("ContentObjectExport", "exportPageObject_XML_PageContent"); break; case "alias": $attrs = array(); $attrs["OriginId"] = "il_".$a_inst. "_pg_".$this->getId(); $a_xml_writer->xmlElement("PageAlias", $attrs); break; } // Layout // not implemented $a_xml_writer->xmlEndTag("PageObject"); }
ilLMPageObject::exportXMLMetaData | ( | &$ | a_xml_writer | ) |
export page objects meta data to xml (see ilias_co.dtd)
object | $a_xml_writer ilXmlWriter object that receives the xml data |
Definition at line 521 of file class.ilLMPageObject.php.
References ilLMObject::getType().
Referenced by exportXML().
{ $nested = new ilNestedSetXML(); $nested->setParameterModifier($this, "modifyExportIdentifier"); $a_xml_writer->appendXML($nested->export($this->getId(), $this->getType())); }
ilLMPageObject::exportXMLPageContent | ( | &$ | a_xml_writer, | |
$ | a_inst = 0 | |||
) |
export page objects meta data to xml (see ilias_co.dtd)
object | $a_xml_writer ilXmlWriter object that receives the xml data |
Definition at line 547 of file class.ilLMPageObject.php.
References $xml, and ilLMObject::getContentObject().
Referenced by exportXML().
{ //echo "exportxmlpagecontent:$a_inst:<br>"; $cont_obj =& $this->getContentObject(); //$page_obj = new ilPageObject($cont_obj->getType(), $this->getId()); $this->page_object->buildDom(); $this->page_object->insertInstIntoIDs($a_inst); $this->mobs_contained = $this->page_object->collectMediaObjects(false); $this->files_contained = $this->page_object->collectFileItems(); $xml = $this->page_object->getXMLFromDom(false, false, false, "", true); $xml = str_replace("&","&", $xml); $a_xml_writer->appendXML($xml); $this->page_object->freeDom(); }
ilLMPageObject::getFileItemIds | ( | ) |
get ids of all file items within the page
note: this method must be called afer exportXMLPageContent
Definition at line 579 of file class.ilLMPageObject.php.
{
return $this->files_contained;
}
ilLMPageObject::getId | ( | ) |
Reimplemented from ilLMObject.
Definition at line 324 of file class.ilLMPageObject.php.
Referenced by create(), exportFO(), and modifyExportIdentifier().
{
return $this->id;
}
ilLMPageObject::getMediaObjectIds | ( | ) |
get ids of all media objects within the page
note: this method must be called afer exportXMLPageContent
Definition at line 569 of file class.ilLMPageObject.php.
{
return $this->mobs_contained;
}
ilLMPageObject::getOriginID | ( | ) |
Definition at line 349 of file class.ilLMPageObject.php.
{
return $this->origin_id;
}
ilLMPageObject::getPageList | ( | $ | lm_id | ) |
static
Definition at line 357 of file class.ilLMPageObject.php.
References ilLMObject::$lm_id, and ilLMObject::getObjectList().
Referenced by ilObjContentObject::exportHTMLPages(), ilObjContentObject::exportXMLPageObjects(), ilObjContentObjectGUI::pages(), and ilInternalLinkGUI::showLinkHelp().
{ return ilLMObject::getObjectList($lm_id, "pg"); }
& ilLMPageObject::getPageObject | ( | ) |
get assigned page object
Definition at line 310 of file class.ilLMPageObject.php.
{
return $this->page_object;
}
ilLMPageObject::ilLMPageObject | ( | &$ | a_content_obj, | |
$ | a_id = 0 , |
|||
$ | a_halt = true | |||
) |
Constructor public.
Definition at line 61 of file class.ilLMPageObject.php.
References $ilBench, $ilias, ilLMObject::ilLMObject(), read(), and ilLMObject::setType().
Referenced by _splitPage(), _splitPageNext(), copy(), and copyToOtherContObject().
{ global $ilias, $ilBench; $ilBench->start("ContentPresentation", "ilLMPageObject_Constructor"); parent::ilLMObject($a_content_obj, $a_id); $this->setType("pg"); $this->id = $a_id; $this->ilias =& $ilias; $this->is_alias = false; $this->contains_int_link = false; $this->mobs_contained = array(); $this->files_contained = array(); $this->halt_on_error = $a_halt; if($a_id != 0) { $this->read(); } $ilBench->stop("ContentPresentation", "ilLMPageObject_Constructor"); }
ilLMPageObject::isAlias | ( | ) |
Definition at line 337 of file class.ilLMPageObject.php.
{
return $this->is_alias;
}
ilLMPageObject::modifyExportIdentifier | ( | $ | a_tag, | |
$ | a_param, | |||
$ | a_value | |||
) |
Definition at line 529 of file class.ilLMPageObject.php.
References getId().
{ if ($a_tag == "Identifier" && $a_param == "Entry") { $a_value = "il_".IL_INST_ID."_pg_".$this->getId(); //$a_value = ilUtil::insertInstIntoID($a_value); } return $a_value; }
ilLMPageObject::read | ( | ) |
Reimplemented from ilLMObject.
Definition at line 97 of file class.ilLMPageObject.php.
References $ilBench.
Referenced by ilLMPageObject().
{ global $ilBench; $ilBench->start("ContentPresentation", "ilLMPageObject_read"); parent::read(); $this->page_object =& new ilPageObject($this->content_object->getType(), $this->id, $this->halt_on_error); $ilBench->stop("ContentPresentation", "ilLMPageObject_read"); }
ilLMPageObject::setAlias | ( | $ | a_is_alias | ) |
set wether page object is an alias
Definition at line 332 of file class.ilLMPageObject.php.
{ $this->is_alias = $a_is_alias; }
ilLMPageObject::setId | ( | $ | a_id | ) |
set id
Reimplemented from ilLMObject.
Definition at line 319 of file class.ilLMPageObject.php.
{
$this->id = $a_id;
}
ilLMPageObject::setOriginID | ( | $ | a_id | ) |
Definition at line 343 of file class.ilLMPageObject.php.
{
return $this->origin_id = $a_id;
}
ilLMPageObject::$dom |
Definition at line 54 of file class.ilLMPageObject.php.
ilLMPageObject::$id |
Reimplemented from ilLMObject.
Definition at line 52 of file class.ilLMPageObject.php.
ilLMPageObject::$ilias |
Reimplemented from ilLMObject.
Definition at line 53 of file class.ilLMPageObject.php.
Referenced by ilLMPageObject().
ilLMPageObject::$is_alias |
Definition at line 50 of file class.ilLMPageObject.php.
ilLMPageObject::$origin_id |
Definition at line 51 of file class.ilLMPageObject.php.
ilLMPageObject::$page_object |
Definition at line 55 of file class.ilLMPageObject.php.