ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilLMPageObject Class Reference

Class ilLMPageObject. More...

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

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 ($a_target_lm)
 copy page
copyToOtherContObject (&$a_cont_obj, &$a_copied_nodes)
 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
 getPagesWithLinksList ($a_lm_id, $a_par_type)
 Get all pages of lm that contain any internal links.
 _getPresentationTitle ($a_pg_id, $a_mode=IL_CHAPTER_TITLE, $a_include_numbers=false, $a_time_scheduled_activation=false, $a_force_content=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)
 getQuestionIds ()
 Get question ids.
 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
 queryQuestionsOfLearningModule ($a_lm_id, $a_order_field, $a_order_dir, $a_offset, $a_limit)
 Get questions of learning module.
 existsExportID ($a_lm_id, $a_exp_id)
 Does export ID exist in lm?
- Public Member Functions inherited from ilLMObject
 ilLMObject (&$a_content_obj, $a_id=0)
 MDUpdateListener ($a_element)
 Meta data update listener.
 _lookupNID ($a_lm_id, $a_lm_obj_id, $a_type)
 lookup named identifier (ILIAS_NID)
 createMetaData ()
 create meta data entry
 updateMetaData ()
 update meta data entry
 deleteMetaData ()
 delete meta data entry
 setDataRecord ($a_record)
 this method should only be called by class ilLMObjectFactory
 setTitle ($a_title)
 set title of lm object
 getTitle ()
 get title of lm object
 _writeTitle ($a_obj_id, $a_title)
 setDescription ($a_description)
 getDescription ()
 setType ($a_type)
 getType ()
 setLMId ($a_lm_id)
 getLMId ()
 setContentObject (&$a_content_obj)
getContentObject ()
 getImportId ()
 setImportId ($a_id)
 setLayout ($a_val)
 Set layout.
 getLayout ()
 Get layout.
 _writeImportId ($a_id, $a_import_id)
 write import id to db (static)
 update ()
 update complete object
 _isPagePublic ($a_node_id, $a_check_public_mode=false)
 _getIdForImportId ($a_import_id)
 get current object id for import id (static)
 _getAllObjectsForImportId ($a_import_id, $a_in_lm=0)
 Get all items for an import ID.
 _exists ($a_id)
 checks wether a lm content object with specified id exists or not
 getObjectList ($lm_id, $type="")
 static
 _deleteAllObjectData (&$a_cobj)
 delete all objects of content object (digi book / learning module)
 _lookupContObjID ($a_id)
 get learning module / digibook id for lm object
 clipboardCut ($a_cont_obj_id, $a_ids)
 Copy a set of chapters/pages into the clipboard.

Static Public Member Functions

static saveExportId ($a_lm_id, $a_pg_id, $a_exp_id)
 Save export id.
static getExportId ($a_lm_id, $a_pg_id)
 Get export ID.
static getDuplicateExportIDs ($a_lm_id)
 Get duplicate export IDs (count export ID usages)
- Static Public Member Functions inherited from ilLMObject
static _lookupTitle ($a_obj_id)
 Lookup title.
static _lookupType ($a_obj_id, $a_lm_id=0)
 Lookup type.
 _writePublicAccessStatus ($a_pages, $a_cont_obj_id)
 update public access flags in lm_data for all pages of a content object
static putInTree ($a_obj, $a_parent_id="", $a_target_node_id="")
 put this object into content object tree
static getTree ($a_cont_obj_id)
 Get learningmodule tree.
static clipboardCopy ($a_cont_obj_id, $a_ids)
 Copy a set of chapters/pages into the clipboard.
static pasteTree ($a_target_lm, $a_item_id, $a_parent_id, $a_target, $a_insert_time, &$a_copied_nodes, $a_as_copy=false, $a_source_lm=null)
 Paste item (tree) from clipboard to current lm.
static saveTitles ($a_lm, $a_titles)
 Save titles for lm objects.
static updateInternalLinks ($a_copied_nodes, $a_parent_type="lm")
 Update internal links, after multiple pages have been copied.
static uniqueTypesCheck ($a_items)
 Check for unique types (all pages or all chapters)
static writeLayout ($a_obj_id, $a_layout, $a_lm=null)
 Write layout setting.
static lookupLayout ($a_obj_id)
 Lookup type.

Data Fields

 $is_alias
 $origin_id
 $id
 $ilias
 $dom
 $page_object
- Data Fields inherited from ilLMObject
 $ilias
 $lm_id
 $type
 $id
 $meta_data
 $data_record
 $content_object
 $title
 $description
 $active = true

Detailed Description

Class ilLMPageObject.

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
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id:
class.ilLMPageObject.php 35880 2012-07-31 13:10:34Z jluetzen

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

Member Function Documentation

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

export page alias to xml

Definition at line 524 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");
}

+ Here is the caller graph for this function:

ilLMPageObject::_getPresentationTitle (   $a_pg_id,
  $a_mode = IL_CHAPTER_TITLE,
  $a_include_numbers = false,
  $a_time_scheduled_activation = false,
  $a_force_content = false 
)

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_modeIL_CHAPTER_TITLE | IL_PAGE_TITLE | IL_NO_HEADER

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

References ilLMObject\$active, $ilDB, $query, ilPageObject\_lookupActive(), ilObject\_lookupType(), IL_NO_HEADER, and IL_PAGE_TITLE.

Referenced by ilObjContentObjectGUI\addLocations(), ilLMTOCExplorer\buildTitle(), ilTableOfContentsExplorer\buildTitle(), ilContObjLocatorGUI\display(), ilLMPageObjectGUI\executeCommand(), exportFO(), ilObjContentObjectGUI\formatInvalidLinkArray(), ilLMPresentationGUI\ilLMNavigation(), ilLMPresentationGUI\ilLMSubMenu(), ilLMPresentationGUI\ilPage(), ilLMPresentationGUI\ilTranslation(), ilGlossaryPresentationGUI\listDefinitions(), ilLMPresentationGUI\showPrintView(), and ilLMPresentationGUI\showPrintViewSelection().

{
global $ilDB;
// select
$query = "SELECT * FROM lm_data WHERE obj_id = ".
$ilDB->quote($a_pg_id, "integer");
$pg_set = $ilDB->query($query);
$pg_rec = $ilDB->fetchAssoc($pg_set);
if($a_mode == IL_NO_HEADER && !$a_force_content)
{
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 = "";
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)
{
$cnt = 0;
foreach($childs as $child)
{
include_once("./Services/COPage/classes/class.ilPageObject.php");
ilObject::_lookupType($pg_rec["lm_id"]), $a_time_scheduled_activation);
if ($child["type"] != "pg" || $active)
{
$cnt++;
}
if($child["obj_id"] == $pg_rec["obj_id"])
{
$cur_cnt = $cnt;
}
}
if ($cnt > 1)
{
$cnt_str = " (".$cur_cnt."/".$cnt.")";
}
}
require_once("./Modules/LearningModule/classes/class.ilStructureObject.php");
//$struct_obj =& new ilStructureObject($pred_node["obj_id"]);
//return $struct_obj->getTitle();
return ilStructureObject::_getPresentationTitle($pred_node["obj_id"],
$a_include_numbers).$cnt_str;
//return $pred_node["title"].$cnt_str;
}
else
{
return $pg_rec["title"];
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLMPageObject::_ilLMPageObject ( )

Definition at line 67 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 200 of file class.ilLMPageObject.php.

References ilLMObject\$lm_id, ilLMObject\$type, ilLMObject\_lookupContObjID(), ilLMObject\_lookupType(), ilMD\cloneMD(), ilLMPageObject(), and ilTree\setTableNames().

Referenced by ilPageContentGUI\splitPage().

{
// get content object (learning module / digilib book)
switch ($type)
{
case "lm":
include_once ("./Modules/LearningModule/classes/class.ilObjLearningModule.php");
$cont_obj = new ilObjLearningModule($lm_id, false);
break;
case "dbk":
include_once ("./Modules/LearningModule/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
$lm_page =& new ilLMPageObject($cont_obj);
$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(true);
// copy meta data
include_once("Services/MetaData/classes/class.ilMD.php");
$md = new ilMD($source_lm_page->getLMId(), $a_page_id, $source_lm_page->getType());
$new_md =& $md->cloneMD($source_lm_page->getLMId(), $lm_page->getId(), $source_lm_page->getType());
// 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 new page (incl. update)
$page->addHierIds();
$page->deleteContentBeforeHierId($a_hier_id);
// remove all nodes >= hierarchical id from source page
$source_page->buildDom();
$source_page->addHierIds();
$source_page->deleteContentFromHierId($a_hier_id);
return $lm_page;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 269 of file class.ilLMPageObject.php.

References ilLMObject\$lm_id, ilLMObject\$type, ilLMObject\_lookupContObjID(), ilLMObject\_lookupType(), ilPageObject\_moveContentAfterHierId(), ilLMPageObject(), and ilTree\setTableNames().

Referenced by ilPageContentGUI\splitPageNext().

{
// get content object (learning module / digilib book)
switch ($type)
{
case "lm":
include_once ("./Modules/LearningModule/classes/class.ilObjLearningModule.php");
$cont_obj = new ilObjLearningModule($lm_id, false);
break;
case "dbk":
include_once ("./Modules/LearningModule/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"];
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLMPageObject::assignPageObject ( $a_page_obj)

assign page object

Parameters
object$a_page_objpage object

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

{
$this->page_object =& $a_page_obj;
}
ilLMPageObject::copy (   $a_target_lm)

copy page

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

References existsExportID(), ilLMObject\getDescription(), getExportId(), getId(), ilLMObject\getLayout(), ilLMObject\getLMId(), ilLMObject\getTitle(), ilLMObject\getType(), ilLMPageObject(), and saveExportId().

{
// copy page
$lm_page = new ilLMPageObject($a_target_lm);
$lm_page->setTitle($this->getTitle());
$lm_page->setLayout($this->getLayout());
$lm_page->setLMId($a_target_lm->getId());
$lm_page->setType($this->getType());
$lm_page->setDescription($this->getDescription());
$lm_page->setImportId("il__pg_".$this->getId());
$lm_page->create(true); // setting "upload" flag to true prevents creating of meta data
// check whether export id already exists in the target lm
$del_exp_id = false;
$exp_id = ilLMPageObject::getExportId($this->getLMId(), $this->getId());
if (trim($exp_id) != "")
{
if (ilLMPageObject::existsExportID($a_target_lm->getId(), $exp_id))
{
$del_exp_id = true;
}
}
// copy meta data
include_once("Services/MetaData/classes/class.ilMD.php");
$md = new ilMD($this->getLMId(), $this->getId(), $this->getType());
$new_md = $md->cloneMD($a_target_lm->getId(), $lm_page->getId(), $this->getType());
// check whether export id already exists in the target lm
if ($del_exp_id)
{
ilLMPageObject::saveExportId($a_target_lm->getId(), $lm_page->getId(), "");
}
else
{
ilLMPageObject::saveExportId($a_target_lm->getId(), $lm_page->getId(),
trim($exp_id));
}
// copy page content and activation
$page = $lm_page->getPageObject();
$page->setXMLContent($this->page_object->copyXMLContent());
$page->setActive($this->page_object->getActive());
$page->setActivationStart($this->page_object->getActivationStart());
$page->setActivationEnd($this->page_object->getActivationEnd());
$page->buildDom();
$page->update();
return $lm_page;
}

+ Here is the call graph for this function:

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

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

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

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

{
// copy page
$lm_page =& new ilLMPageObject($a_cont_obj);
$lm_page->setTitle($this->getTitle());
$lm_page->setLMId($a_cont_obj->getId());
$lm_page->setImportId("il__pg_".$this->getId());
$lm_page->setType($this->getType());
$lm_page->setDescription($this->getDescription());
$lm_page->create(true); // setting "upload" flag to true prevents creating of meta data
$a_copied_nodes[$this->getId()] = $lm_page->getId();
// copy meta data
include_once("Services/MetaData/classes/class.ilMD.php");
$md = new ilMD($this->getLMId(), $this->getId(), $this->getType());
$new_md =& $md->cloneMD($a_cont_obj->getId(), $lm_page->getId(), $this->getType());
// copy page content
$page =& $lm_page->getPageObject();
$page->setXMLContent($this->page_object->getXMLContent());
$page->buildDom();
$page->update();
return $lm_page;
}

+ Here is the call graph for this function:

ilLMPageObject::create (   $a_upload = false)

Reimplemented from ilLMObject.

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

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

{
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);
}

+ Here is the call graph for this function:

ilLMPageObject::delete (   $a_delete_meta_data = true)

delete lm object data

Reimplemented from ilLMObject.

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

{
parent::delete($a_delete_meta_data);
$this->page_object->delete();
}
ilLMPageObject::existsExportID (   $a_lm_id,
  $a_exp_id 
)

Does export ID exist in lm?

Parameters
@return

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

References ilMDIdentifier\existsIdInRbacObject().

Referenced by copy().

{
include_once("./Services/MetaData/classes/class.ilMDIdentifier.php");
return ilMDIdentifier::existsIdInRbacObject($a_lm_id, "pg", "ILIAS_NID", $a_exp_id);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLMPageObject::exportFO ( $a_xml_writer)

export page object to fo

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

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

References $ilBench, ilLMObject\$title, _getPresentationTitle(), and getId().

{
global $ilBench;
//$attrs = array();
//$a_xml_writer->xmlStartTag("PageObject", $attrs);
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");
}

+ Here is the call graph for this function:

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

export page object to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

Definition at line 486 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");
}

+ Here is the call graph for this function:

ilLMPageObject::exportXMLMetaData ( $a_xml_writer)

export page objects meta data to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

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

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

Referenced by exportXML().

{
include_once("Services/MetaData/classes/class.ilMD2XML.php");
$md2xml = new ilMD2XML($this->getLMId(), $this->getId(), $this->getType());
$md2xml->setExportMode(true);
$md2xml->startExport();
$a_xml_writer->appendXML($md2xml->getXML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

export page objects meta data to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

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

References 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();
// $this->questions_contained = $this->page_object->getQuestionIds();
$xml = $this->page_object->getXMLFromDom(false, false, false, "", true);
$xml = str_replace("&","&amp;", $xml);
$a_xml_writer->appendXML($xml);
$this->page_object->freeDom();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilLMPageObject::getDuplicateExportIDs (   $a_lm_id)
static

Get duplicate export IDs (count export ID usages)

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

References $res, ilLMObject\_exists(), and ilMDIdentifier\_getEntriesForRbacObj().

Referenced by ilExportIDTableGUI\__construct().

{
include_once("./Services/MetaData/classes/class.ilMDIdentifier.php");
$entries = ilMDIdentifier::_getEntriesForRbacObj($a_lm_id, "pg");
$res = array();
foreach ($entries as $e)
{
if ($e["catalog"] == "ILIAS_NID")
{
if (ilLMObject::_exists($e["obj_id"]))
{
$res[trim($e["entry"])]++;
}
}
}
return $res;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilLMPageObject::getExportId (   $a_lm_id,
  $a_pg_id 
)
static

Get export ID.

Parameters
@return

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

References ilMDIdentifier\_getEntriesForObj().

Referenced by ilTableOfContentsExplorer\buildLinkTarget(), copy(), ilObjContentObject\exportHTMLPages(), ilExportIDTableGUI\fillRow(), and ilLMPresentationGUI\getLink().

{
// look for export id
include_once("./Services/MetaData/classes/class.ilMDIdentifier.php");
$a_lm_id, $a_pg_id, "pg");
foreach ($entries as $e)
{
if ($e["catalog"] == "ILIAS_NID")
{
return $e["entry"];
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLMPageObject::getFileItemIds ( )

get ids of all file items within the page

note: this method must be called afer exportXMLPageContent

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

{
return $this->files_contained;
}
ilLMPageObject::getId ( )

Reimplemented from ilLMObject.

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

References $id.

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

{
return $this->id;
}

+ Here is the caller graph for this function:

ilLMPageObject::getMediaObjectIds ( )

get ids of all media objects within the page

note: this method must be called afer exportXMLPageContent

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

{
return $this->mobs_contained;
}
ilLMPageObject::getOriginID ( )

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

References $origin_id.

{
}
& ilLMPageObject::getPageObject ( )

get assigned page object

Returns
object page object

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

References $page_object.

{
}
ilLMPageObject::getPagesWithLinksList (   $a_lm_id,
  $a_par_type 
)

Get all pages of lm that contain any internal links.

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

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

Referenced by ilLinksTableGUI\getLinks().

{
$pages = ilLMPageObject::getPageList($a_lm_id);
$ids = array();
foreach($pages as $page)
{
$ids[] = $page["obj_id"];
}
$linked_pages = ilPageObject::getPagesWithLinks($a_par_type, $a_lm_id);
$result = array();
foreach($pages as $page)
{
if (is_array($linked_pages[$page["obj_id"]]))
{
$result[] = $page;
}
}
return $result;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLMPageObject::getQuestionIds ( )

Get question ids.

note: this method must be called afer exportXMLPageContent

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

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

{
return ilPageObject::_getQuestionIdsForPage($this->content_object->getType(),
$this->getId());
}

+ Here is the call graph for this function:

ilLMPageObject::ilLMPageObject ( $a_content_obj,
  $a_id = 0,
  $a_halt = true 
)

Constructor public.

Definition at line 42 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");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLMPageObject::isAlias ( )

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

References $is_alias.

{
}
ilLMPageObject::modifyExportIdentifier (   $a_tag,
  $a_param,
  $a_value 
)

Definition at line 553 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;
}

+ Here is the call graph for this function:

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

Get questions of learning module.

Parameters
@return

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

References $ilDB, $query, and $result.

Referenced by ilLMQuestionListTableGUI\getItems().

{
global $ilDB, $rbacreview;
// count query
$count_query = "SELECT count(pq.question_id) cnt ";
// basic query
$query = "SELECT pq.page_id, pq.question_id ";
$from = " FROM page_question pq JOIN lm_tree t ON (t.lm_id = ".$ilDB->quote($a_lm_id, "integer").
" AND pq.page_id = t.child and pq.page_parent_type = ".$ilDB->quote("lm", "text").") ".
" WHERE t.lm_id = ".$ilDB->quote($a_lm_id, "integer");
$count_query.= $from;
$query.= $from;
// count query
$set = $ilDB->query($count_query);
$cnt = 0;
if ($rec = $ilDB->fetchAssoc($set))
{
$cnt = $rec["cnt"];
}
$offset = (int) $a_offset;
$limit = (int) $a_limit;
$ilDB->setLimit($limit, $offset);
// set query
$set = $ilDB->query($query);
$result = array();
while($rec = $ilDB->fetchAssoc($set))
{
$result[] = $rec;
}
return array("cnt" => $cnt, "set" => $result);
}

+ Here is the caller graph for this function:

ilLMPageObject::read ( )

Reimplemented from ilLMObject.

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

References $id, and $ilBench.

Referenced by ilLMPageObject().

{
global $ilBench;
$ilBench->start("ContentPresentation", "ilLMPageObject_read");
$this->page_object =& new ilPageObject($this->content_object->getType(),
$this->id, 0, $this->halt_on_error);
$ilBench->stop("ContentPresentation", "ilLMPageObject_read");
}

+ Here is the caller graph for this function:

static ilLMPageObject::saveExportId (   $a_lm_id,
  $a_pg_id,
  $a_exp_id 
)
static

Save export id.

Parameters
@return

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

References $id, $ilDB, and ilMDIdentifier\_getEntriesForObj().

Referenced by copy(), and ilObjContentObjectGUI\saveExportIds().

{
global $ilDB;
include_once("Services/MetaData/classes/class.ilMDIdentifier.php");
if (trim($a_exp_id) == "")
{
// delete export ids, if existing
$a_lm_id, $a_pg_id, "pg");
foreach ($entries as $id => $e)
{
if ($e["catalog"] == "ILIAS_NID")
{
$identifier = new ilMDIdentifier();
$identifier->setMetaId($id);
$identifier->delete();
}
}
}
else
{
// update existing entry
$a_lm_id, $a_pg_id, "pg");
$updated = false;
foreach ($entries as $id => $e)
{
if ($e["catalog"] == "ILIAS_NID")
{
$identifier = new ilMDIdentifier();
$identifier->setMetaId($id);
$identifier->read();
$identifier->setEntry($a_exp_id);
$identifier->update();
$updated = true;
}
}
// nothing updated? create a new one
if (!$updated)
{
include_once("./Services/MetaData/classes/class.ilMD.php");
$md = new ilMD($a_lm_id, $a_pg_id, "pg");
$md_gen = $md->getGeneral();
$identifier = $md_gen->addIdentifier();
$identifier->setEntry($a_exp_id);
$identifier->setCatalog("ILIAS_NID");
$identifier->save();
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLMPageObject::setAlias (   $a_is_alias)

set wether page object is an alias

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

{
$this->is_alias = $a_is_alias;
}
ilLMPageObject::setId (   $a_id)

set id

Reimplemented from ilLMObject.

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

{
$this->id = $a_id;
}
ilLMPageObject::setOriginID (   $a_id)

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

{
return $this->origin_id = $a_id;
}

Field Documentation

ilLMPageObject::$dom

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

ilLMPageObject::$id

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

Referenced by getId(), read(), and saveExportId().

ilLMPageObject::$ilias

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

Referenced by ilLMPageObject().

ilLMPageObject::$is_alias

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

Referenced by isAlias().

ilLMPageObject::$origin_id

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

Referenced by getOriginID().

ilLMPageObject::$page_object

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

Referenced by getPageObject().


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