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());
115 $expLog->write(date(
"[y-m-d H:i:s] ").
"Structure Object ".$this->
getId());
117 $a_xml_writer->xmlStartTag(
"StructureObject", $attrs);
120 $ilBench->start(
"ContentObjectExport",
"exportStructureObject_exportMeta");
122 $ilBench->stop(
"ContentObjectExport",
"exportStructureObject_exportMeta");
125 $ilBench->start(
"ContentObjectExport",
"exportStructureObject_exportPageObjects");
127 $ilBench->stop(
"ContentObjectExport",
"exportStructureObject_exportPageObjects");
135 $a_xml_writer->xmlEndTag(
"StructureObject");
147 include_once(
"Services/MetaData/classes/class.ilMD2XML.php");
149 $md2xml->setExportMode(
true);
150 $md2xml->startExport();
151 $a_xml_writer->appendXML($md2xml->getXML());
156 if ($a_tag ==
"Identifier" && $a_param ==
"Entry")
158 $a_value =
"il_".IL_INST_ID.
"_st_".$this->
getId();
169 $a_time_scheduled_activation =
false)
174 $query =
"SELECT * FROM lm_data WHERE obj_id = ".
175 $ilDB->quote($a_st_id,
"integer");
176 $st_set = $ilDB->query(
$query);
177 $st_rec = $ilDB->fetchAssoc($st_set);
180 $tree->setTableNames(
'lm_tree',
'lm_data');
181 $tree->setTreeTablePK(
"lm_id");
183 if ($a_include_numbers)
185 if (
$tree->isInTree($st_rec[
"obj_id"]))
188 $query =
"SELECT * FROM lm_tree WHERE child = ".
189 $ilDB->quote($a_st_id,
"integer").
" AND lm_id = ".
190 $ilDB->quote($st_rec[
"lm_id"],
"integer");
191 $tree_set = $ilDB->query(
$query);
193 $depth = $tree_node[
"depth"];
195 $nr =
$tree->getChildSequenceNumber($tree_node,
"st").
" ";
196 for ($i = $depth - 1; $i > 1; $i --)
199 $query =
"SELECT * FROM lm_tree WHERE child = ".
200 $ilDB->quote($tree_node[
"parent"],
"integer").
" AND lm_id = ".
201 $ilDB->quote($st_rec[
"lm_id"],
"integer");
202 $tree_set = $ilDB->query(
$query);
204 $seq =
$tree->getChildSequenceNumber($tree_node,
"st");
211 return $nr.$st_rec[
"title"];
224 include_once
'./Modules/LearningModule/classes/class.ilLMPageObject.php';
228 $this->tree =
new ilTree($this->getLmId());
229 $this->tree->setTableNames(
'lm_tree',
'lm_data');
230 $this->tree->setTreeTablePK(
"lm_id");
232 $childs = $this->tree->getChilds($this->
getId());
233 foreach ($childs as $child)
235 if($child[
"type"] !=
"pg")
241 $ilBench->start(
"ContentObjectExport",
"exportStructureObject_exportPageObjectAlias");
248 $ilBench->stop(
"ContentObjectExport",
"exportStructureObject_exportPageObjectAlias");
261 $this->tree =
new ilTree($this->getLmId());
262 $this->tree->setTableNames(
'lm_tree',
'lm_data');
263 $this->tree->setTreeTablePK(
"lm_id");
265 $childs = $this->tree->getChilds($this->
getId());
266 foreach ($childs as $child)
268 if($child[
"type"] !=
"st")
276 $structure_obj->exportXML($a_xml_writer, $a_inst, $expLog);
277 unset($structure_obj);
295 $attrs[
"font-family"] =
"Times";
296 $attrs[
"font-size"] =
"14pt";
297 $a_xml_writer->xmlElement(
"fo:block", $attrs, $this->
getTitle());
319 $this->tree =
new ilTree($this->getLmId());
320 $this->tree->setTableNames(
'lm_tree',
'lm_data');
321 $this->tree->setTreeTablePK(
"lm_id");
323 $childs = $this->tree->getChilds($this->
getId());
324 foreach ($childs as $child)
326 if($child[
"type"] !=
"pg")
335 $page_obj->exportFO($a_xml_writer);
350 $tree->setTableNames(
'lm_tree',
'lm_data');
351 $tree->setTreeTablePK(
"lm_id");
354 $ndata =
$tree->getNodeData(
$tree->readRootId());
355 $childs =
$tree->getSubtree($ndata);
356 foreach ($childs as $child)
358 if($child[
"type"] ==
"st")
360 $chapters[] = $child;