24 require_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
60 function delete($a_delete_meta_data =
true)
62 $this->tree =
new ilTree($this->getLmId());
63 $this->tree->setTableNames(
'lm_tree',
'lm_data');
64 $this->tree->setTreeTablePK(
"lm_id");
65 $node_data = $this->tree->getNodeData($this->
getId());
66 $this->
delete_rec($this->tree, $a_delete_meta_data);
67 $this->tree->deleteTree($node_data);
73 private function delete_rec(&$a_tree, $a_delete_meta_data =
true)
75 $childs = $a_tree->getChilds($this->
getId());
76 foreach ($childs as $child)
81 if($obj->getType() ==
"st")
83 $obj->delete_rec($a_tree, $a_delete_meta_data);
85 if($obj->getType() ==
"pg")
87 $obj->delete($a_delete_meta_data);
98 function copy($a_target_lm)
102 if ($this->
getLMId() != $a_target_lm->getId())
104 $chap->setImportId(
"il__st_".$this->
getId());
106 $chap->setLMId($a_target_lm->getId());
107 $chap->setType($this->
getType());
110 $a_copied_nodes[$this->
getId()] = $chap->getId();
113 include_once(
"Services/MetaData/classes/class.ilMD.php");
115 $new_md =& $md->cloneMD($a_target_lm->getId(), $chap->getId(), $this->
getType());
130 $expLog->write(date(
"[y-m-d H:i:s] ").
"Structure Object ".$this->
getId());
132 $a_xml_writer->xmlStartTag(
"StructureObject", $attrs);
135 $ilBench->start(
"ContentObjectExport",
"exportStructureObject_exportMeta");
137 $ilBench->stop(
"ContentObjectExport",
"exportStructureObject_exportMeta");
140 $ilBench->start(
"ContentObjectExport",
"exportStructureObject_exportPageObjects");
142 $ilBench->stop(
"ContentObjectExport",
"exportStructureObject_exportPageObjects");
150 $a_xml_writer->xmlEndTag(
"StructureObject");
162 include_once(
"Services/MetaData/classes/class.ilMD2XML.php");
164 $md2xml->setExportMode(
true);
165 $md2xml->startExport();
166 $a_xml_writer->appendXML($md2xml->getXML());
171 if ($a_tag ==
"Identifier" && $a_param ==
"Entry")
173 $a_value =
"il_".IL_INST_ID.
"_st_".$this->
getId();
188 $query =
"SELECT * FROM lm_data WHERE obj_id = ".$ilDB->quote($a_st_id);
189 $st_set = $ilDB->query($query);
193 $tree->setTableNames(
'lm_tree',
'lm_data');
194 $tree->setTreeTablePK(
"lm_id");
196 if ($a_include_numbers)
198 if (
$tree->isInTree($st_rec[
"obj_id"]))
201 $query =
"SELECT * FROM lm_tree WHERE child = ".
202 $ilDB->quote($a_st_id).
" AND lm_id = ".
203 $ilDB->quote($st_rec[
"lm_id"]);
204 $tree_set = $ilDB->query($query);
206 $depth = $tree_node[
"depth"];
208 $nr =
$tree->getChildSequenceNumber($tree_node,
"st").
" ";
209 for ($i = $depth - 1; $i > 1; $i --)
212 $query =
"SELECT * FROM lm_tree WHERE child = ".
213 $ilDB->quote($tree_node[
"parent"]).
" AND lm_id = ".
214 $ilDB->quote($st_rec[
"lm_id"]);
215 $tree_set = $ilDB->query($query);
217 $seq =
$tree->getChildSequenceNumber($tree_node,
"st");
224 return $nr.$st_rec[
"title"];
237 include_once
'./Modules/LearningModule/classes/class.ilLMPageObject.php';
241 $this->tree =
new ilTree($this->getLmId());
242 $this->tree->setTableNames(
'lm_tree',
'lm_data');
243 $this->tree->setTreeTablePK(
"lm_id");
245 $childs = $this->tree->getChilds($this->
getId());
246 foreach ($childs as $child)
248 if($child[
"type"] !=
"pg")
254 $ilBench->start(
"ContentObjectExport",
"exportStructureObject_exportPageObjectAlias");
261 $ilBench->stop(
"ContentObjectExport",
"exportStructureObject_exportPageObjectAlias");
274 $this->tree =
new ilTree($this->getLmId());
275 $this->tree->setTableNames(
'lm_tree',
'lm_data');
276 $this->tree->setTreeTablePK(
"lm_id");
278 $childs = $this->tree->getChilds($this->
getId());
279 foreach ($childs as $child)
281 if($child[
"type"] !=
"st")
289 $structure_obj->exportXML($a_xml_writer, $a_inst, $expLog);
290 unset($structure_obj);
308 $attrs[
"font-family"] =
"Times";
309 $attrs[
"font-size"] =
"14pt";
310 $a_xml_writer->xmlElement(
"fo:block", $attrs, $this->
getTitle());
332 $this->tree =
new ilTree($this->getLmId());
333 $this->tree->setTableNames(
'lm_tree',
'lm_data');
334 $this->tree->setTreeTablePK(
"lm_id");
336 $childs = $this->tree->getChilds($this->
getId());
337 foreach ($childs as $child)
339 if($child[
"type"] !=
"pg")
348 $page_obj->exportFO($a_xml_writer);