ILIAS  release_7 Revision v7.30-3-g800a261c036
ilStructureObject Class Reference

Class ilStructreObject. More...

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

Public Member Functions

 __construct (&$a_content_obj, $a_id=0)
 Constructor @access public. More...
 
 create ($a_upload=false)
 
 delete ($a_delete_meta_data=true)
 Delete Chapter. More...
 
 copy ($a_target_lm)
 copy chapter More...
 
 exportXML (&$a_xml_writer, $a_inst, &$expLog)
 export object to xml (see ilias_co.dtd) More...
 
 exportXMLMetaData (&$a_xml_writer)
 export structure objects meta data to xml (see ilias_co.dtd) More...
 
 modifyExportIdentifier ($a_tag, $a_param, $a_value)
 
 exportXMLPageObjects (&$a_xml_writer, $a_inst=0)
 export page objects of structure object (see ilias_co.dtd) More...
 
 exportXMLStructureObjects (&$a_xml_writer, $a_inst, &$expLog)
 export (sub)structure objects of structure object (see ilias_co.dtd) More...
 
 exportFO (&$a_xml_writer)
 export object to fo More...
 
 exportFOPageObjects (&$a_xml_writer)
 export page objects of structure object (see ilias_co.dtd) More...
 
- Public Member Functions inherited from ilLMObject
 __construct ($a_content_obj, $a_id=0)
 
 MDUpdateListener ($a_element)
 Meta data update listener. More...
 
 createMetaData ()
 create meta data entry More...
 
 updateMetaData ()
 update meta data entry More...
 
 deleteMetaData ()
 delete meta data entry More...
 
 setDataRecord ($a_record)
 this method should only be called by class ilLMObjectFactory More...
 
 read ()
 
 setTitle ($a_title)
 set title of lm object More...
 
 getTitle ()
 get title of lm object More...
 
 setShortTitle ($a_title)
 set short title of lm object More...
 
 getShortTitle ()
 get short title of lm object More...
 
 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. More...
 
 getLayout ()
 Get layout. More...
 
 create ($a_upload=false)
 
 update ()
 update complete object More...
 
 delete ($a_delete_meta_data=true)
 delete lm object data More...
 
 existsExportID ($a_lm_id, $a_exp_id, $a_type="pg")
 Does export ID exist in lm? More...
 
 getExportIDInfo ($a_lm_id, $a_exp_id, $a_type="pg")
 Does export ID exist in lm? More...
 

Static Public Member Functions

static _getPresentationTitle ( $a_st_id, $a_mode=self::CHAPTER_TITLE, $a_include_numbers=false, $a_time_scheduled_activation=false, $a_force_content=false, $a_lm_id=0, $a_lang="-", $a_include_short=false)
 get presentation title More...
 
static getChapterList ($a_lm_id)
 export (sub)structure objects of structure object (see ilias_co.dtd) More...
 
- Static Public Member Functions inherited from ilLMObject
static _lookupNID ($a_lm_id, $a_lm_obj_id, $a_type)
 lookup named identifier (ILIAS_NID) More...
 
static preloadDataByLM ($a_lm_id)
 Preload data records by lm. More...
 
static _lookupTitle ($a_obj_id)
 Lookup title. More...
 
static _lookupShortTitle ($a_obj_id)
 Lookup short title. More...
 
static _lookupType ($a_obj_id, $a_lm_id=0)
 Lookup type. More...
 
static _writeTitle ($a_obj_id, $a_title)
 
static _writeImportId ($a_id, $a_import_id)
 write import id to db (static) More...
 
static _writePublicAccessStatus ($a_pages, $a_cont_obj_id)
 update public access flags in lm_data for all pages of a content object@access public More...
 
static _isPagePublic ($a_node_id, $a_check_public_mode=false)
 
static _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
static _getAllObjectsForImportId ($a_import_id, $a_in_lm=0)
 Get all items for an import ID. More...
 
static _exists ($a_id)
 checks wether a lm content object with specified id exists or not More...
 
static getObjectList ($lm_id, $type="")
 static More...
 
static _deleteAllObjectData (&$a_cobj)
 delete all objects of content object (digi book / learning module) More...
 
static _lookupContObjID ($a_id)
 get learning module / digibook id for lm object More...
 
static putInTree ($a_obj, $a_parent_id="", $a_target_node_id="")
 put this object into content object tree More...
 
static getTree ($a_cont_obj_id)
 Get learningmodule tree. More...
 
static clipboardCut ($a_cont_obj_id, $a_ids)
 Copy a set of chapters/pages into the clipboard. More...
 
static clipboardCopy ($a_cont_obj_id, $a_ids)
 Copy a set of chapters/pages into the clipboard. More...
 
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. More...
 
static saveTitles ($a_lm, $a_titles, $a_lang="-")
 Save titles for lm objects. More...
 
static updateInternalLinks ($a_copied_nodes, $a_parent_type="lm")
 Update internal links, after multiple pages have been copied. More...
 
static uniqueTypesCheck ($a_items)
 Check for unique types (all pages or all chapters) More...
 
static writeLayout ($a_obj_id, $a_layout, $a_lm=null)
 Write layout setting. More...
 
static lookupLayout ($a_obj_id)
 Lookup type. More...
 
static getPagesOfChapter ($a_lm_id, $a_chap_id)
 Get pages of chapter. More...
 
static _getAllLMObjectsOfLM ($a_lm_id, $a_type="")
 Get all objects of learning module. More...
 
static saveExportId ($a_lm_id, $a_lmobj_id, $a_exp_id, $a_type="pg")
 Save export id. More...
 
static getExportId ($a_lm_id, $a_lmobj_id, $a_type="pg")
 Get export ID. More...
 
static getDuplicateExportIDs ($a_lm_id, $a_type="pg")
 Get duplicate export IDs (count export ID usages) More...
 
static _getPresentationTitle ( $a_node, $a_mode=self::PAGE_TITLE, $a_include_numbers=false, $a_time_scheduled_activation=false, $a_force_content=false, $a_lm_id=0, $a_lang="-")
 Get affective title. More...
 
static getShortTitles ($a_lm_id, $a_lang="-")
 Get short titles. More...
 
static writeShortTitle ($a_id, $a_short_title, $a_lang="-")
 Write short title. More...
 

Data Fields

 $is_alias
 
 $origin_id
 
 $tree
 
- Data Fields inherited from ilLMObject
const CHAPTER_TITLE = "st_title"
 
const PAGE_TITLE = "pg_title"
 
const NO_HEADER = "none"
 
 $lm_id
 
 $type
 
 $id
 
 $meta_data
 
 $data_record
 
 $content_object
 
 $title
 
 $short_title
 
 $description
 
 $active = true
 

Private Member Functions

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

Additional Inherited Members

- Static Protected Member Functions inherited from ilLMObject
static _lookup ($a_obj_id, $a_field)
 Lookup title. More...
 
- Protected Attributes inherited from ilLMObject
 $user
 
 $db
 
- 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$

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor @access public.

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

26 {
27 $this->setType("st");
28 parent::__construct($a_content_obj, $a_id);
29 }
setType($a_type)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct(), and ilLMObject\setType().

+ Here is the call graph for this function:

Member Function Documentation

◆ _getPresentationTitle()

static ilStructureObject::_getPresentationTitle (   $a_st_id,
  $a_mode = self::CHAPTER_TITLE,
  $a_include_numbers = false,
  $a_time_scheduled_activation = false,
  $a_force_content = false,
  $a_lm_id = 0,
  $a_lang = "-",
  $a_include_short = false 
)
static

get presentation title

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

164 {
165 global $DIC;
166
167 $ilDB = $DIC->database();
168
169 if ($a_lm_id == 0) {
170 $a_lm_id = ilLMObject::_lookupContObjID($a_st_id);
171 }
172
173 if ($a_lm_id == 0) {
174 return "";
175 }
176
177 // this is optimized when ilLMObject::preloadDataByLM is invoked (e.g. done in ilLMExplorerGUI)
178 $title = "";
179 if ($a_include_short) {
180 $title = trim(ilLMObject::_lookupShortTitle($a_st_id));
181 }
182 if ($title == "") {
184 }
185
186 // this is also optimized since ilObjectTranslation re-uses instances for one lm
187 $ot = ilObjectTranslation::getInstance($a_lm_id);
188 $languages = $ot->getLanguages();
189
190 if ($a_lang != "-" && $ot->getContentActivated()) {
191 $lmobjtrans = new ilLMObjTranslation($a_st_id, $a_lang);
192 $trans_title = "";
193 if ($a_include_short) {
194 $trans_title = trim($lmobjtrans->getShortTitle());
195 }
196 if ($trans_title == "") {
197 $trans_title = $lmobjtrans->getTitle();
198 }
199 if ($trans_title == "") {
200 $lmobjtrans = new ilLMObjTranslation($a_st_id, $ot->getFallbackLanguage());
201 $trans_title = $lmobjtrans->getTitle();
202 }
203 if ($trans_title != "") {
204 $title = $trans_title;
205 }
206 }
207
208 $tree = ilLMTree::getInstance($a_lm_id);
209
210 if ($a_include_numbers) {
211 // this is optimized, since isInTree is cached
212 if ($tree->isInTree($a_st_id)) {
213 // optimization needed from here
214
215 // get chapter tree node
216 $query = "SELECT * FROM lm_tree WHERE child = " .
217 $ilDB->quote($a_st_id, "integer") . " AND lm_id = " .
218 $ilDB->quote($a_lm_id, "integer");
219 $tree_set = $ilDB->query($query);
220 $tree_node = $tree_set->fetchRow(ilDBConstants::FETCHMODE_ASSOC);
221 $depth = $tree_node["depth"];
222
223 $nr = $tree->getChildSequenceNumber($tree_node, "st") . " ";
224 for ($i = $depth - 1; $i > 1; $i--) {
225 // get next parent tree node
226 $query = "SELECT * FROM lm_tree WHERE child = " .
227 $ilDB->quote($tree_node["parent"], "integer") . " AND lm_id = " .
228 $ilDB->quote($a_lm_id, "integer");
229 $tree_set = $ilDB->query($query);
230 $tree_node = $tree_set->fetchRow(ilDBConstants::FETCHMODE_ASSOC);
231 $seq = $tree->getChildSequenceNumber($tree_node, "st");
232
233 $nr = $seq . "." . $nr;
234 }
235 }
236 }
237
238 return $nr . $title;
239 }
Translation information on lm object.
static _lookupShortTitle($a_obj_id)
Lookup short title.
static _lookupContObjID($a_id)
get learning module / digibook id for lm object
static _lookupTitle($a_obj_id)
Lookup title.
static getInstance($a_tree_id)
Get Instance.
static getInstance($a_obj_id)
Get instance.
global $DIC
Definition: goto.php:24
$i
Definition: metadata.php:24
$query
global $ilDB

References $DIC, $i, $ilDB, $query, ilLMObject\$title, $tree, ilLMObject\_lookupContObjID(), ilLMObject\_lookupShortTitle(), ilLMObject\_lookupTitle(), ilDBConstants\FETCHMODE_ASSOC, ilObjectTranslation\getInstance(), and ilLMTree\getInstance().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copy()

ilStructureObject::copy (   $a_target_lm)

copy chapter

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

77 {
78 $chap = new ilStructureObject($a_target_lm);
79 $chap->setTitle($this->getTitle());
80 if ($this->getLMId() != $a_target_lm->getId()) {
81 $chap->setImportId("il__st_" . $this->getId());
82 }
83 $chap->setLMId($a_target_lm->getId());
84 $chap->setType($this->getType());
85 $chap->setDescription($this->getDescription());
86 $chap->create(true);
87 $a_copied_nodes[$this->getId()] = $chap->getId();
88
89 // copy meta data
90 $md = new ilMD($this->getLMId(), $this->getId(), $this->getType());
91 $new_md = $md->cloneMD($a_target_lm->getId(), $chap->getId(), $this->getType());
92
93 // copy translations
94 ilLMObjTranslation::copy($this->getId(), $chap->getId());
95
96
97 return $chap;
98 }
static copy($a_source_id, $a_target_id)
Copy all translations of an object.
getTitle()
get title of lm object
Class ilStructreObject.

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

+ Here is the call graph for this function:

◆ create()

ilStructureObject::create (   $a_upload = false)

Reimplemented from ilLMObject.

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

32 {
33 parent::create($a_upload);
34 }

◆ delete()

ilStructureObject::delete (   $a_delete_meta_data = true)

Delete Chapter.

Reimplemented from ilLMObject.

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

40 {
41 // only relevant for online help authoring
43
44 $this->tree = new ilTree($this->getLmId());
45 $this->tree->setTableNames('lm_tree', 'lm_data');
46 $this->tree->setTreeTablePK("lm_id");
47 $node_data = $this->tree->getNodeData($this->getId());
48 $this->delete_rec($this->tree, $a_delete_meta_data);
49 $this->tree->deleteTree($node_data);
50 }
static removeScreenIdsOfChapter($a_chap, $a_module_id=0)
Remove screen ids of chapter.
delete_rec(&$a_tree, $a_delete_meta_data=true)
Delete sub tree.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...

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

+ Here is the call graph for this function:

◆ delete_rec()

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

Delete sub tree.

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

56 {
57 $childs = $a_tree->getChilds($this->getId());
58 foreach ($childs as $child) {
59 $obj = ilLMObjectFactory::getInstance($this->content_object, $child["obj_id"], false);
60 if (is_object($obj)) {
61 if ($obj->getType() == "st") {
62 $obj->delete_rec($a_tree, $a_delete_meta_data);
63 }
64 if ($obj->getType() == "pg") {
65 $obj->delete($a_delete_meta_data);
66 }
67 }
68 unset($obj);
69 }
70 parent::delete($a_delete_meta_data);
71 }
static getInstance(&$a_content_obj, $a_id=0, $a_halt=true)

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

Referenced by delete().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportFO()

ilStructureObject::exportFO ( $a_xml_writer)

export object to fo

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

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

302 {
303
304 // fo:block (complete)
305 $attrs = array();
306 $attrs["font-family"] = "Times";
307 $attrs["font-size"] = "14pt";
308 $a_xml_writer->xmlElement("fo:block", $attrs, $this->getTitle());
309
310 // page objects
311 $this->exportFOPageObjects($a_xml_writer);
312 }
exportFOPageObjects(&$a_xml_writer)
export page objects of structure object (see ilias_co.dtd)

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

+ Here is the call graph for this function:

◆ exportFOPageObjects()

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 320 of file class.ilStructureObject.php.

321 {
322 $this->tree = new ilTree($this->getLmId());
323 $this->tree->setTableNames('lm_tree', 'lm_data');
324 $this->tree->setTreeTablePK("lm_id");
325
326 $childs = $this->tree->getChilds($this->getId());
327 foreach ($childs as $child) {
328 if ($child["type"] != "pg") {
329 continue;
330 }
331
332 // export xml to writer object
333 $page_obj = new ilLMPageObject($this->getContentObject(), $child["obj_id"]);
334 $page_obj->exportFO($a_xml_writer);
335 }
336 }
Class ilLMPageObject.

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

Referenced by exportFO().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportXML()

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 106 of file class.ilStructureObject.php.

107 {
108 $expLog->write(date("[y-m-d H:i:s] ") . "Structure Object " . $this->getId());
109 $attrs = array();
110 $a_xml_writer->xmlStartTag("StructureObject", $attrs);
111
112 // MetaData
113 $this->exportXMLMetaData($a_xml_writer);
114
115 // StructureObjects
116 $this->exportXMLPageObjects($a_xml_writer, $a_inst);
117
118 // PageObjects
119 $this->exportXMLStructureObjects($a_xml_writer, $a_inst, $expLog);
120
121 // Layout
122 // not implemented
123
124 $a_xml_writer->xmlEndTag("StructureObject");
125 }
exportXMLMetaData(&$a_xml_writer)
export structure objects meta data to xml (see ilias_co.dtd)
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)

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

+ Here is the call graph for this function:

◆ exportXMLMetaData()

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 134 of file class.ilStructureObject.php.

135 {
136 $md2xml = new ilMD2XML($this->getLMId(), $this->getId(), $this->getType());
137 $md2xml->setExportMode(true);
138 $md2xml->startExport();
139 $a_xml_writer->appendXML($md2xml->getXML());
140 }

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

Referenced by exportXML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportXMLPageObjects()

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 249 of file class.ilStructureObject.php.

250 {
251 $this->tree = new ilTree($this->getLmId());
252 $this->tree->setTableNames('lm_tree', 'lm_data');
253 $this->tree->setTreeTablePK("lm_id");
254
255 $childs = $this->tree->getChilds($this->getId());
256 foreach ($childs as $child) {
257 if ($child["type"] != "pg") {
258 continue;
259 }
260
261 // export xml to writer object
262 ilLMPageObject::_exportXMLAlias($a_xml_writer, $child["obj_id"], $a_inst);
263 }
264 }
static _exportXMLAlias(&$a_xml_writer, $a_id, $a_inst=0)
export page alias to xml

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

Referenced by exportXML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportXMLStructureObjects()

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 273 of file class.ilStructureObject.php.

274 {
275 $this->tree = new ilTree($this->getLmId());
276 $this->tree->setTableNames('lm_tree', 'lm_data');
277 $this->tree->setTreeTablePK("lm_id");
278
279 $childs = $this->tree->getChilds($this->getId());
280 foreach ($childs as $child) {
281 if ($child["type"] != "st") {
282 continue;
283 }
284
285 // export xml to writer object
286 $structure_obj = new ilStructureObject(
287 $this->getContentObject(),
288 $child["obj_id"]
289 );
290 $structure_obj->exportXML($a_xml_writer, $a_inst, $expLog);
291 unset($structure_obj);
292 }
293 }

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

Referenced by exportXML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getChapterList()

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 344 of file class.ilStructureObject.php.

345 {
346 $tree = new ilTree($a_lm_id);
347 $tree->setTableNames('lm_tree', 'lm_data');
348 $tree->setTreeTablePK("lm_id");
349
350 $chapters = array();
351 $ndata = $tree->getNodeData($tree->readRootId());
352 $childs = $tree->getSubtree($ndata);
353 foreach ($childs as $child) {
354 if ($child["type"] == "st") {
355 $chapters[] = $child;
356 }
357 }
358 return $chapters;
359 }

References $tree.

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

+ Here is the caller graph for this function:

◆ modifyExportIdentifier()

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

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

143 {
144 if ($a_tag == "Identifier" && $a_param == "Entry") {
145 $a_value = "il_" . IL_INST_ID . "_st_" . $this->getId();
146 }
147
148 return $a_value;
149 }
const IL_INST_ID
Definition: constants.php:38

References ilLMObject\getId(), and IL_INST_ID.

+ Here is the call graph for this function:

Field Documentation

◆ $is_alias

ilStructureObject::$is_alias

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

◆ $origin_id

ilStructureObject::$origin_id

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

◆ $tree

ilStructureObject::$tree

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

Referenced by _getPresentationTitle(), and getChapterList().


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