ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilStructureObject Class Reference

Class ilStructreObject. More...

+ Inheritance diagram for ilStructureObject:
+ Collaboration diagram for ilStructureObject:

Public Member Functions

 ilStructureObject (&$a_content_obj, $a_id=0)
 Constructor public.
 create ($a_upload=false)
 delete ($a_delete_meta_data=true)
 Delete Chapter.
 copy ($a_target_lm)
 copy chapter
 exportXML (&$a_xml_writer, $a_inst, &$expLog)
 export object to xml (see ilias_co.dtd)
 exportXMLMetaData (&$a_xml_writer)
 export structure objects meta data to xml (see ilias_co.dtd)
 modifyExportIdentifier ($a_tag, $a_param, $a_value)
 exportXMLPageObjects (&$a_xml_writer, $a_inst=0)
 export page objects of structure object (see ilias_co.dtd)
 exportXMLStructureObjects (&$a_xml_writer, $a_inst, &$expLog)
 export (sub)structure objects of structure object (see ilias_co.dtd)
 exportFO (&$a_xml_writer)
 export object to fo
 exportFOPageObjects (&$a_xml_writer)
 export page objects of structure object (see ilias_co.dtd)
- 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
 read ()
 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 ()
 setId ($a_id)
 getId ()
 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
 _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.
 existsExportID ($a_lm_id, $a_exp_id, $a_type="pg")
 Does export ID exist in lm?
 getExportIDInfo ($a_lm_id, $a_exp_id, $a_type="pg")
 Does export ID exist in lm?

Static Public Member Functions

static _getPresentationTitle ($a_st_id, $a_include_numbers=false, $a_time_scheduled_activation=false, $a_lm_id=0, $a_lang="-")
 get presentation title
static getChapterList ($a_lm_id)
 export (sub)structure objects of structure object (see ilias_co.dtd)
- Static Public Member Functions inherited from ilLMObject
static preloadDataByLM ($a_lm_id)
 Preload data records by lm.
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 _isPagePublic ($a_node_id, $a_check_public_mode=false)
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, $a_lang="-")
 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.
static getPagesOfChapter ($a_lm_id, $a_chap_id)
 Get pages of chapter.
static _getAllLMObjectsOfLM ($a_lm_id, $a_type="")
 Get all objects of learning module.
static saveExportId ($a_lm_id, $a_lmobj_id, $a_exp_id, $a_type="pg")
 Save export id.
static getExportId ($a_lm_id, $a_lmobj_id, $a_type="pg")
 Get export ID.
static getDuplicateExportIDs ($a_lm_id, $a_type="pg")
 Get duplicate export IDs (count export ID usages)
static _getPresentationTitle ($a_node, $a_mode=IL_PAGE_TITLE, $a_include_numbers=false, $a_time_scheduled_activation=false, $a_force_content=false, $a_lm_id=0, $a_lang="-")
 Get affective title.

Data Fields

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

Private Member Functions

 delete_rec (&$a_tree, $a_delete_meta_data=true)
 Delete sub tree.

Additional Inherited Members

- Static Protected Attributes inherited from ilLMObject
static $data_records = array()

Detailed Description

Class ilStructreObject.

Handles StructureObjects of ILIAS Learning Modules (see ILIAS DTD)

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id:
class.ilStructureObject.php 48277 2014-03-03 22:08:56Z akill

Definition at line 17 of file class.ilStructureObject.php.

Member Function Documentation

static ilStructureObject::_getPresentationTitle (   $a_st_id,
  $a_include_numbers = false,
  $a_time_scheduled_activation = false,
  $a_lm_id = 0,
  $a_lang = "-" 
)
static

get presentation title

Definition at line 173 of file class.ilStructureObject.php.

References $ilDB, $query, ilLMObject\$title, $tree, ilLMObject\_lookupContObjID(), ilLMObject\_lookupTitle(), DB_FETCHMODE_ASSOC, ilLMTree\getInstance(), and ilObjectTranslation\getInstance().

Referenced by ilLMTOCExplorerGUI\getNodeContent(), ilLMPresentationGUI\ilLocator(), ilLMPresentationGUI\showPrintView(), ilLMPresentationGUI\showPrintViewSelection(), and ilStructureObjectGUI\subchap().

{
global $ilDB;
if ($a_lm_id == 0)
{
$a_lm_id = ilLMObject::_lookupContObjID($a_st_id);
}
if ($a_lm_id == 0)
{
return "";
}
// this is optimized when ilLMObject::preloadDataByLM is invoked (e.g. done in ilLMExplorerGUI)
// this is also optimized since ilObjectTranslation re-uses instances for one lm
include_once("./Services/Object/classes/class.ilObjectTranslation.php");
$languages = $ot->getLanguages();
if ($a_lang != "-" && $ot->getContentActivated() && isset($languages[$a_lang]))
{
include_once("./Modules/LearningModule/classes/class.ilLMObjTranslation.php");
$lmobjtrans = new ilLMObjTranslation($a_st_id, $a_lang);
if ($lmobjtrans->getTitle() != "")
{
$title = $lmobjtrans->getTitle();
}
}
include_once("./Modules/LearningModule/classes/class.ilLMTree.php");
if ($a_include_numbers)
{
// this is optimized, since isInTree is cached
if ($tree->isInTree($a_st_id))
{
// optimization needed from here
// get chapter tree node
$query = "SELECT * FROM lm_tree WHERE child = ".
$ilDB->quote($a_st_id, "integer")." AND lm_id = ".
$ilDB->quote($a_lm_id, "integer");
$tree_set = $ilDB->query($query);
$tree_node = $tree_set->fetchRow(DB_FETCHMODE_ASSOC);
$depth = $tree_node["depth"];
$nr = $tree->getChildSequenceNumber($tree_node, "st")." ";
for ($i = $depth - 1; $i > 1; $i --)
{
// get next parent tree node
$query = "SELECT * FROM lm_tree WHERE child = ".
$ilDB->quote($tree_node["parent"], "integer")." AND lm_id = ".
$ilDB->quote($a_lm_id, "integer");
$tree_set = $ilDB->query($query);
$tree_node = $tree_set->fetchRow(DB_FETCHMODE_ASSOC);
$seq = $tree->getChildSequenceNumber($tree_node, "st");
$nr = $seq.".".$nr;
}
}
}
return $nr.$title;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilStructureObject::copy (   $a_target_lm)

copy chapter

Definition at line 83 of file class.ilStructureObject.php.

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

{
$chap = new ilStructureObject($a_target_lm);
$chap->setTitle($this->getTitle());
if ($this->getLMId() != $a_target_lm->getId())
{
$chap->setImportId("il__st_".$this->getId());
}
$chap->setLMId($a_target_lm->getId());
$chap->setType($this->getType());
$chap->setDescription($this->getDescription());
$chap->create(true);
$a_copied_nodes[$this->getId()] = $chap->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_target_lm->getId(), $chap->getId(), $this->getType());
// copy translations
include_once("./Modules/LearningModule/classes/class.ilLMObjTranslation.php");
ilLMObjTranslation::copy($this->getId(), $chap->getId());
return $chap;
}

+ Here is the call graph for this function:

ilStructureObject::create (   $a_upload = false)

Reimplemented from ilLMObject.

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

{
parent::create($a_upload);
}
ilStructureObject::delete (   $a_delete_meta_data = true)

Delete Chapter.

Reimplemented from ilLMObject.

Definition at line 41 of file class.ilStructureObject.php.

References delete_rec(), ilLMObject\getId(), and ilHelpMapping\removeScreenIdsOfChapter().

Referenced by delete_rec().

{
// only relevant for online help authoring
include_once("./Services/Help/classes/class.ilHelpMapping.php");
$this->tree = new ilTree($this->getLmId());
$this->tree->setTableNames('lm_tree', 'lm_data');
$this->tree->setTreeTablePK("lm_id");
$node_data = $this->tree->getNodeData($this->getId());
$this->delete_rec($this->tree, $a_delete_meta_data);
$this->tree->deleteTree($node_data);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilStructureObject::delete_rec ( $a_tree,
  $a_delete_meta_data = true 
)
private

Delete sub tree.

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

References delete(), ilLMObject\getId(), and ilLMObjectFactory\getInstance().

Referenced by delete().

{
$childs = $a_tree->getChilds($this->getId());
foreach ($childs as $child)
{
$obj =& ilLMObjectFactory::getInstance($this->content_object, $child["obj_id"], false);
if (is_object($obj))
{
if($obj->getType() == "st")
{
$obj->delete_rec($a_tree, $a_delete_meta_data);
}
if($obj->getType() == "pg")
{
$obj->delete($a_delete_meta_data);
}
}
unset($obj);
}
parent::delete($a_delete_meta_data);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilStructureObject::exportFO ( $a_xml_writer)

export object to fo

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

Definition at line 316 of file class.ilStructureObject.php.

References $ilBench, exportFOPageObjects(), and ilLMObject\getTitle().

{
global $ilBench;
//$expLog->write(date("[y-m-d H:i:s] ")."Structure Object ".$this->getId());
// fo:block (complete)
$attrs = array();
$attrs["font-family"] = "Times";
$attrs["font-size"] = "14pt";
$a_xml_writer->xmlElement("fo:block", $attrs, $this->getTitle());
// page objects
//$ilBench->start("ContentObjectExport", "exportStructureObject_exportPageObjects");
$this->exportFOPageObjects($a_xml_writer);
//$ilBench->stop("ContentObjectExport", "exportStructureObject_exportPageObjects");
// structure objects
//$this->exportFOStructureObjects($a_xml_writer);
}

+ Here is the call graph for this function:

ilStructureObject::exportFOPageObjects ( $a_xml_writer)

export page objects of structure object (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

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

References $ilBench, ilLMObject\getContentObject(), and ilLMObject\getId().

Referenced by exportFO().

{
global $ilBench;
$this->tree = new ilTree($this->getLmId());
$this->tree->setTableNames('lm_tree', 'lm_data');
$this->tree->setTreeTablePK("lm_id");
$childs = $this->tree->getChilds($this->getId());
foreach ($childs as $child)
{
if($child["type"] != "pg")
{
continue;
}
// export xml to writer object
//$ilBench->start("ContentObjectExport", "exportStructureObject_exportPageObjectAlias");
$page_obj = new ilLMPageObject($this->getContentObject(), $child["obj_id"]);
$page_obj->exportFO($a_xml_writer);
//$ilBench->stop("ContentObjectExport", "exportStructureObject_exportPageObjectAlias");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilStructureObject::exportXML ( $a_xml_writer,
  $a_inst,
$expLog 
)

export object to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

Definition at line 116 of file class.ilStructureObject.php.

References $ilBench, exportXMLMetaData(), exportXMLPageObjects(), exportXMLStructureObjects(), and ilLMObject\getId().

{
global $ilBench;
$expLog->write(date("[y-m-d H:i:s] ")."Structure Object ".$this->getId());
$attrs = array();
$a_xml_writer->xmlStartTag("StructureObject", $attrs);
// MetaData
$ilBench->start("ContentObjectExport", "exportStructureObject_exportMeta");
$this->exportXMLMetaData($a_xml_writer);
$ilBench->stop("ContentObjectExport", "exportStructureObject_exportMeta");
// StructureObjects
$ilBench->start("ContentObjectExport", "exportStructureObject_exportPageObjects");
$this->exportXMLPageObjects($a_xml_writer, $a_inst);
$ilBench->stop("ContentObjectExport", "exportStructureObject_exportPageObjects");
// PageObjects
$this->exportXMLStructureObjects($a_xml_writer, $a_inst, $expLog);
// Layout
// not implemented
$a_xml_writer->xmlEndTag("StructureObject");
}

+ Here is the call graph for this function:

ilStructureObject::exportXMLMetaData ( $a_xml_writer)

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

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

Definition at line 150 of file class.ilStructureObject.php.

References ilLMObject\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:

ilStructureObject::exportXMLPageObjects ( $a_xml_writer,
  $a_inst = 0 
)

export page objects of structure object (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

Definition at line 251 of file class.ilStructureObject.php.

References $ilBench, ilLMPageObject\_exportXMLAlias(), and ilLMObject\getId().

Referenced by exportXML().

{
include_once './Modules/LearningModule/classes/class.ilLMPageObject.php';
global $ilBench;
$this->tree = new ilTree($this->getLmId());
$this->tree->setTableNames('lm_tree', 'lm_data');
$this->tree->setTreeTablePK("lm_id");
$childs = $this->tree->getChilds($this->getId());
foreach ($childs as $child)
{
if($child["type"] != "pg")
{
continue;
}
// export xml to writer object
$ilBench->start("ContentObjectExport", "exportStructureObject_exportPageObjectAlias");
//$ilBench->start("ContentObjectExport", "exportStructureObject_getLMPageObject");
//$page_obj = new ilLMPageObject($this->getContentObject(), $child["obj_id"]);
//$ilBench->stop("ContentObjectExport", "exportStructureObject_getLMPageObject");
ilLMPageObject::_exportXMLAlias($a_xml_writer, $child["obj_id"], $a_inst);
//$page_obj->exportXML($a_xml_writer, "alias", $a_inst);
//unset($page_obj);
$ilBench->stop("ContentObjectExport", "exportStructureObject_exportPageObjectAlias");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilStructureObject::exportXMLStructureObjects ( $a_xml_writer,
  $a_inst,
$expLog 
)

export (sub)structure objects of structure object (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

Definition at line 288 of file class.ilStructureObject.php.

References ilLMObject\getContentObject(), ilLMObject\getId(), and ilStructureObject().

Referenced by exportXML().

{
$this->tree = new ilTree($this->getLmId());
$this->tree->setTableNames('lm_tree', 'lm_data');
$this->tree->setTreeTablePK("lm_id");
$childs = $this->tree->getChilds($this->getId());
foreach ($childs as $child)
{
if($child["type"] != "st")
{
continue;
}
// export xml to writer object
$structure_obj = new ilStructureObject($this->getContentObject(),
$child["obj_id"]);
$structure_obj->exportXML($a_xml_writer, $a_inst, $expLog);
unset($structure_obj);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilStructureObject::getChapterList (   $a_lm_id)
static

export (sub)structure objects of structure object (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

Definition at line 376 of file class.ilStructureObject.php.

References $tree.

Referenced by ilExportIDTableGUI\__construct(), and ilHelpMappingTableGUI\getChapters().

{
$tree = new ilTree($a_lm_id);
$tree->setTableNames('lm_tree', 'lm_data');
$tree->setTreeTablePK("lm_id");
$chapters = array();
$ndata = $tree->getNodeData($tree->readRootId());
$childs = $tree->getSubtree($ndata);
foreach ($childs as $child)
{
if($child["type"] == "st")
{
$chapters[] = $child;
}
}
return $chapters;
}

+ Here is the caller graph for this function:

ilStructureObject::ilStructureObject ( $a_content_obj,
  $a_id = 0 
)

Constructor public.

Definition at line 27 of file class.ilStructureObject.php.

References ilLMObject\ilLMObject(), and ilLMObject\setType().

Referenced by copy(), and exportXMLStructureObjects().

{
$this->setType("st");
parent::ilLMObject($a_content_obj, $a_id);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilStructureObject::modifyExportIdentifier (   $a_tag,
  $a_param,
  $a_value 
)

Definition at line 159 of file class.ilStructureObject.php.

References ilLMObject\getId().

{
if ($a_tag == "Identifier" && $a_param == "Entry")
{
$a_value = "il_".IL_INST_ID."_st_".$this->getId();
}
return $a_value;
}

+ Here is the call graph for this function:

Field Documentation

ilStructureObject::$is_alias

Definition at line 19 of file class.ilStructureObject.php.

ilStructureObject::$origin_id

Definition at line 20 of file class.ilStructureObject.php.

ilStructureObject::$tree

Definition at line 21 of file class.ilStructureObject.php.

Referenced by _getPresentationTitle(), and getChapterList().


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