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();
184 $a_time_scheduled_activation =
false)
189 $query =
"SELECT * FROM lm_data WHERE obj_id = ".
190 $ilDB->quote($a_st_id,
"integer");
191 $st_set = $ilDB->query(
$query);
192 $st_rec = $ilDB->fetchAssoc($st_set);
195 $tree->setTableNames(
'lm_tree',
'lm_data');
196 $tree->setTreeTablePK(
"lm_id");
198 if ($a_include_numbers)
200 if (
$tree->isInTree($st_rec[
"obj_id"]))
203 $query =
"SELECT * FROM lm_tree WHERE child = ".
204 $ilDB->quote($a_st_id,
"integer").
" AND lm_id = ".
205 $ilDB->quote($st_rec[
"lm_id"],
"integer");
206 $tree_set = $ilDB->query(
$query);
208 $depth = $tree_node[
"depth"];
210 $nr =
$tree->getChildSequenceNumber($tree_node,
"st").
" ";
211 for ($i = $depth - 1; $i > 1; $i --)
214 $query =
"SELECT * FROM lm_tree WHERE child = ".
215 $ilDB->quote($tree_node[
"parent"],
"integer").
" AND lm_id = ".
216 $ilDB->quote($st_rec[
"lm_id"],
"integer");
217 $tree_set = $ilDB->query(
$query);
219 $seq =
$tree->getChildSequenceNumber($tree_node,
"st");
226 return $nr.$st_rec[
"title"];
239 include_once
'./Modules/LearningModule/classes/class.ilLMPageObject.php';
243 $this->tree =
new ilTree($this->getLmId());
244 $this->tree->setTableNames(
'lm_tree',
'lm_data');
245 $this->tree->setTreeTablePK(
"lm_id");
247 $childs = $this->tree->getChilds($this->
getId());
248 foreach ($childs as $child)
250 if($child[
"type"] !=
"pg")
256 $ilBench->start(
"ContentObjectExport",
"exportStructureObject_exportPageObjectAlias");
263 $ilBench->stop(
"ContentObjectExport",
"exportStructureObject_exportPageObjectAlias");
276 $this->tree =
new ilTree($this->getLmId());
277 $this->tree->setTableNames(
'lm_tree',
'lm_data');
278 $this->tree->setTreeTablePK(
"lm_id");
280 $childs = $this->tree->getChilds($this->
getId());
281 foreach ($childs as $child)
283 if($child[
"type"] !=
"st")
291 $structure_obj->exportXML($a_xml_writer, $a_inst, $expLog);
292 unset($structure_obj);
310 $attrs[
"font-family"] =
"Times";
311 $attrs[
"font-size"] =
"14pt";
312 $a_xml_writer->xmlElement(
"fo:block", $attrs, $this->
getTitle());
334 $this->tree =
new ilTree($this->getLmId());
335 $this->tree->setTableNames(
'lm_tree',
'lm_data');
336 $this->tree->setTreeTablePK(
"lm_id");
338 $childs = $this->tree->getChilds($this->
getId());
339 foreach ($childs as $child)
341 if($child[
"type"] !=
"pg")
350 $page_obj->exportFO($a_xml_writer);