5 require_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
41 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)
66 if($obj->getType() ==
"st")
68 $obj->delete_rec($a_tree, $a_delete_meta_data);
70 if($obj->getType() ==
"pg")
72 $obj->delete($a_delete_meta_data);
83 function copy($a_target_lm)
87 if ($this->
getLMId() != $a_target_lm->getId())
89 $chap->setImportId(
"il__st_".$this->
getId());
91 $chap->setLMId($a_target_lm->getId());
92 $chap->setType($this->
getType());
95 $a_copied_nodes[$this->
getId()] = $chap->getId();
98 include_once(
"Services/MetaData/classes/class.ilMD.php");
100 $new_md =& $md->cloneMD($a_target_lm->getId(), $chap->getId(), $this->
getType());
103 include_once(
"./Modules/LearningModule/classes/class.ilLMObjTranslation.php");
120 $expLog->write(date(
"[y-m-d H:i:s] ").
"Structure Object ".$this->
getId());
122 $a_xml_writer->xmlStartTag(
"StructureObject", $attrs);
125 $ilBench->start(
"ContentObjectExport",
"exportStructureObject_exportMeta");
127 $ilBench->stop(
"ContentObjectExport",
"exportStructureObject_exportMeta");
130 $ilBench->start(
"ContentObjectExport",
"exportStructureObject_exportPageObjects");
132 $ilBench->stop(
"ContentObjectExport",
"exportStructureObject_exportPageObjects");
140 $a_xml_writer->xmlEndTag(
"StructureObject");
152 include_once(
"Services/MetaData/classes/class.ilMD2XML.php");
154 $md2xml->setExportMode(
true);
155 $md2xml->startExport();
156 $a_xml_writer->appendXML($md2xml->getXML());
161 if ($a_tag ==
"Identifier" && $a_param ==
"Entry")
163 $a_value =
"il_".IL_INST_ID.
"_st_".$this->
getId();
174 $a_time_scheduled_activation =
false, $a_lm_id = 0, $a_lang =
"-")
192 include_once(
"./Services/Object/classes/class.ilObjectTranslation.php");
194 $languages = $ot->getLanguages();
196 if ($a_lang !=
"-" && $ot->getContentActivated() && isset($languages[$a_lang]))
198 include_once(
"./Modules/LearningModule/classes/class.ilLMObjTranslation.php");
200 if ($lmobjtrans->getTitle() !=
"")
202 $title = $lmobjtrans->getTitle();
206 include_once(
"./Modules/LearningModule/classes/class.ilLMTree.php");
209 if ($a_include_numbers)
212 if (
$tree->isInTree($a_st_id))
217 $query =
"SELECT * FROM lm_tree WHERE child = ".
218 $ilDB->quote($a_st_id,
"integer").
" AND lm_id = ".
219 $ilDB->quote($a_lm_id,
"integer");
220 $tree_set = $ilDB->query(
$query);
222 $depth = $tree_node[
"depth"];
224 $nr =
$tree->getChildSequenceNumber($tree_node,
"st").
" ";
225 for ($i = $depth - 1; $i > 1; $i --)
228 $query =
"SELECT * FROM lm_tree WHERE child = ".
229 $ilDB->quote($tree_node[
"parent"],
"integer").
" AND lm_id = ".
230 $ilDB->quote($a_lm_id,
"integer");
231 $tree_set = $ilDB->query(
$query);
233 $seq =
$tree->getChildSequenceNumber($tree_node,
"st");
253 include_once
'./Modules/LearningModule/classes/class.ilLMPageObject.php';
257 $this->tree =
new ilTree($this->getLmId());
258 $this->tree->setTableNames(
'lm_tree',
'lm_data');
259 $this->tree->setTreeTablePK(
"lm_id");
261 $childs = $this->tree->getChilds($this->
getId());
262 foreach ($childs as $child)
264 if($child[
"type"] !=
"pg")
270 $ilBench->start(
"ContentObjectExport",
"exportStructureObject_exportPageObjectAlias");
277 $ilBench->stop(
"ContentObjectExport",
"exportStructureObject_exportPageObjectAlias");
290 $this->tree =
new ilTree($this->getLmId());
291 $this->tree->setTableNames(
'lm_tree',
'lm_data');
292 $this->tree->setTreeTablePK(
"lm_id");
294 $childs = $this->tree->getChilds($this->
getId());
295 foreach ($childs as $child)
297 if($child[
"type"] !=
"st")
305 $structure_obj->exportXML($a_xml_writer, $a_inst, $expLog);
306 unset($structure_obj);
324 $attrs[
"font-family"] =
"Times";
325 $attrs[
"font-size"] =
"14pt";
326 $a_xml_writer->xmlElement(
"fo:block", $attrs, $this->
getTitle());
348 $this->tree =
new ilTree($this->getLmId());
349 $this->tree->setTableNames(
'lm_tree',
'lm_data');
350 $this->tree->setTreeTablePK(
"lm_id");
352 $childs = $this->tree->getChilds($this->
getId());
353 foreach ($childs as $child)
355 if($child[
"type"] !=
"pg")
364 $page_obj->exportFO($a_xml_writer);
379 $tree->setTableNames(
'lm_tree',
'lm_data');
380 $tree->setTreeTablePK(
"lm_id");
383 $ndata =
$tree->getNodeData(
$tree->readRootId());
384 $childs =
$tree->getSubtree($ndata);
385 foreach ($childs as $child)
387 if($child[
"type"] ==
"st")
389 $chapters[] = $child;