5 require_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
30 parent::__construct($a_content_obj, $a_id);
33 public function create($a_upload =
false)
35 parent::create($a_upload);
41 public function delete($a_delete_meta_data =
true)
44 include_once(
"./Services/Help/classes/class.ilHelpMapping.php");
47 $this->tree =
new ilTree($this->getLmId());
48 $this->tree->setTableNames(
'lm_tree',
'lm_data');
49 $this->tree->setTreeTablePK(
"lm_id");
50 $node_data = $this->tree->getNodeData($this->
getId());
51 $this->
delete_rec($this->tree, $a_delete_meta_data);
52 $this->tree->deleteTree($node_data);
58 private function delete_rec(&$a_tree, $a_delete_meta_data =
true)
60 $childs = $a_tree->getChilds($this->
getId());
61 foreach ($childs as $child) {
63 if (is_object($obj)) {
64 if ($obj->getType() ==
"st") {
65 $obj->delete_rec($a_tree, $a_delete_meta_data);
67 if ($obj->getType() ==
"pg") {
68 $obj->delete($a_delete_meta_data);
73 parent::delete($a_delete_meta_data);
79 public function copy($a_target_lm)
83 if ($this->
getLMId() != $a_target_lm->getId()) {
84 $chap->setImportId(
"il__st_" . $this->
getId());
86 $chap->setLMId($a_target_lm->getId());
87 $chap->setType($this->
getType());
90 $a_copied_nodes[$this->
getId()] = $chap->getId();
93 include_once(
"Services/MetaData/classes/class.ilMD.php");
95 $new_md = $md->cloneMD($a_target_lm->getId(), $chap->getId(), $this->
getType());
98 include_once(
"./Modules/LearningModule/classes/class.ilLMObjTranslation.php");
111 public function exportXML(&$a_xml_writer, $a_inst, &$expLog)
113 $expLog->write(date(
"[y-m-d H:i:s] ") .
"Structure Object " . $this->
getId());
115 $a_xml_writer->xmlStartTag(
"StructureObject", $attrs);
129 $a_xml_writer->xmlEndTag(
"StructureObject");
141 include_once(
"Services/MetaData/classes/class.ilMD2XML.php");
143 $md2xml->setExportMode(
true);
144 $md2xml->startExport();
145 $a_xml_writer->appendXML($md2xml->getXML());
150 if ($a_tag ==
"Identifier" && $a_param ==
"Entry") {
151 $a_value =
"il_" . IL_INST_ID .
"_st_" . $this->
getId();
164 $a_include_numbers =
false,
165 $a_time_scheduled_activation =
false,
166 $a_force_content =
false,
169 $a_include_short =
false 173 $ilDB = $DIC->database();
185 if ($a_include_short) {
193 include_once(
"./Services/Object/classes/class.ilObjectTranslation.php");
197 if ($a_lang !=
"-" && $ot->getContentActivated() && isset(
$languages[$a_lang])) {
198 include_once(
"./Modules/LearningModule/classes/class.ilLMObjTranslation.php");
201 if ($a_include_short) {
202 $trans_title = trim($lmobjtrans->getShortTitle());
204 if ($trans_title ==
"") {
205 $trans_title = $lmobjtrans->getTitle();
207 if ($trans_title !=
"") {
212 include_once(
"./Modules/LearningModule/classes/class.ilLMTree.php");
215 if ($a_include_numbers) {
217 if (
$tree->isInTree($a_st_id)) {
221 $query =
"SELECT * FROM lm_tree WHERE child = " .
222 $ilDB->quote($a_st_id,
"integer") .
" AND lm_id = " .
223 $ilDB->quote($a_lm_id,
"integer");
226 $depth = $tree_node[
"depth"];
228 $nr =
$tree->getChildSequenceNumber($tree_node,
"st") .
" ";
229 for (
$i = $depth - 1;
$i > 1;
$i--) {
231 $query =
"SELECT * FROM lm_tree WHERE child = " .
232 $ilDB->quote($tree_node[
"parent"],
"integer") .
" AND lm_id = " .
233 $ilDB->quote($a_lm_id,
"integer");
236 $seq =
$tree->getChildSequenceNumber($tree_node,
"st");
238 $nr = $seq .
"." . $nr;
256 include_once
'./Modules/LearningModule/classes/class.ilLMPageObject.php';
258 $this->tree =
new ilTree($this->getLmId());
259 $this->tree->setTableNames(
'lm_tree',
'lm_data');
260 $this->tree->setTreeTablePK(
"lm_id");
262 $childs = $this->tree->getChilds($this->
getId());
263 foreach ($childs as $child) {
264 if ($child[
"type"] !=
"pg") {
282 $this->tree =
new ilTree($this->getLmId());
283 $this->tree->setTableNames(
'lm_tree',
'lm_data');
284 $this->tree->setTreeTablePK(
"lm_id");
286 $childs = $this->tree->getChilds($this->
getId());
287 foreach ($childs as $child) {
288 if ($child[
"type"] !=
"st") {
297 $structure_obj->exportXML($a_xml_writer, $a_inst, $expLog);
298 unset($structure_obj);
313 $attrs[
"font-family"] =
"Times";
314 $attrs[
"font-size"] =
"14pt";
315 $a_xml_writer->xmlElement(
"fo:block", $attrs, $this->
getTitle());
329 $this->tree =
new ilTree($this->getLmId());
330 $this->tree->setTableNames(
'lm_tree',
'lm_data');
331 $this->tree->setTreeTablePK(
"lm_id");
333 $childs = $this->tree->getChilds($this->
getId());
334 foreach ($childs as $child) {
335 if ($child[
"type"] !=
"pg") {
341 $page_obj->exportFO($a_xml_writer);
354 $tree->setTableNames(
'lm_tree',
'lm_data');
355 $tree->setTreeTablePK(
"lm_id");
358 $ndata =
$tree->getNodeData(
$tree->readRootId());
359 $childs =
$tree->getSubtree($ndata);
360 foreach ($childs as $child) {
361 if ($child[
"type"] ==
"st") {
362 $chapters[] = $child;
static getChapterList($a_lm_id)
export (sub)structure objects of structure object (see ilias_co.dtd)
__construct(&$a_content_obj, $a_id=0)
Constructor public.
static _lookupShortTitle($a_obj_id)
Lookup short title.
static _lookupContObjID($a_id)
get learning module / digibook id for lm object
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.
static _lookupTitle($a_obj_id)
Lookup title.
static _getPresentationTitle( $a_st_id, $a_mode=IL_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
modifyExportIdentifier($a_tag, $a_param, $a_value)
static getInstance($a_tree_id)
Get Instance.
static getInstance(&$a_content_obj, $a_id=0, $a_halt=true)
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)
exportXMLStructureObjects(&$a_xml_writer, $a_inst, &$expLog)
export (sub)structure objects of structure object (see ilias_co.dtd)
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
copy($a_target_lm)
copy chapter
exportFOPageObjects(&$a_xml_writer)
export page objects of structure object (see ilias_co.dtd)
getTitle()
get title of lm object
static getInstance($a_obj_id)
Get instance.
exportXMLPageObjects(&$a_xml_writer, $a_inst=0)
export page objects of structure object (see ilias_co.dtd)
static _exportXMLAlias(&$a_xml_writer, $a_id, $a_inst=0)
export page alias to xml
Translation information on lm object.
exportFO(&$a_xml_writer)
export object to fo
static copy($a_source_id, $a_target_id)
Copy all translations of an object.