4 require_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
39 include_once(
"./Modules/LearningModule/classes/class.ilBibItem.php");
42 $this->bib_obj->read();
64 WHERE lm_tree.lm_id = ".$ilDB->quote($obj_id,
"integer").
"
65 AND lm_tree.child = lm_data.obj_id
66 AND ( lm_data.type = 'st' OR lm_data.type = 'pg' )
67 AND lm_tree.depth = ".$ilDB->quote($depth,
"integer").
"
68 AND lm_tree.lft > ".$ilDB->quote($left,
"integer").
69 " and lm_tree.rgt < ".$ilDB->quote($right,
"integer").
"
70 ORDER BY lm_tree.lft";
72 while (is_array(
$row = $ilDB->fetchAssoc(
$result)) )
74 if (
$row[
"type"] ==
"st")
76 $xml .=
"<StructureObject>";
79 $xml .= $nested->export(
$row[
"obj_id"],
"st");
84 $xml .=
"</StructureObject>";
87 if (
$row[
"type"] ==
"pg")
90 $query =
"SELECT * FROM page_object WHERE page_id= ".$ilDB->quote(
$row[
"obj_id"],
"integer");
91 $result2 = $this->ilias->db->query(
$query);
95 $PO = $row2[
"content"].
"\n";
97 if (stristr($PO,
"MediaObject"))
102 $path =
"//MediaObject/MediaAlias";
104 for($i = 0; $i < count(
$res->nodeset); $i++)
106 $id_arr = explode(
"_",
$res->nodeset[$i]->get_attribute(
"OriginId"));
107 $mob_id = $id_arr[count($id_arr) - 1];
108 $this->mob_ids[$mob_id] =
true;
113 $mdxml = $nested->export(
$row[
"obj_id"],
"pg");
115 $PO = str_replace(
"<PageObject>",
"<PageObject>\n$mdxml\n",$PO);
133 include_once(
"./classes/class.ilNestedSetXML.php");
139 $obj_id = $objRow[
"obj_id"];
141 $this->mob_ids = array();
146 $xml =
"<?xml version=\"1.0\"?>\n<!DOCTYPE ContentObject SYSTEM \"ilias_co.dtd\">\n<ContentObject Type=\"LibObject\">\n";
152 $xml .= $nested->export($obj_id,
"dbk").
"\n";
159 FROM lm_tree, lm_data
160 WHERE lm_tree.lm_id = ".$ilDB->quote($obj_id,
"integer").
"
161 AND lm_tree.child = lm_data.obj_id
162 AND ( lm_data.type = 'du' )
163 AND lm_tree.depth = 1
164 ORDER BY lm_tree.lft";
166 $treeData = $ilDB->fetchAssoc(
$result);
168 $xml .= $this->
exportRekursiv($obj_id,2, $treeData[
"lft"], $treeData[
"rgt"]);
179 $mob_ids = $this->mob_ids;
180 if (is_array($mob_ids) && count($mob_ids)>0)
183 while (list ($key, $val) = each ($mob_ids))
186 $xml .=
"<MediaObject>";
188 $query =
"SELECT * FROM media_item WHERE mob_id= ".
189 $ilDB->quote($key,
"integer").
" ";
199 $metaxml = $nested->export($key,
"mob");
200 $metaxml = preg_replace(
"/Entry=\"(.*?)\"/",
"Entry=\"il__mob_".$key.
"\"",$metaxml);
202 $metaxml2 =
"<Technical>";
203 $metaxml2 .=
"<Format>".$row[
"format"].
"</Format>";
204 $metaxml2 .=
"<Size>14559</Size>";
205 $metaxml2 .=
"<Location Type=\"".$row[
"location_type"].
"\">".
$row[
"location"].
"</Location>";
206 $metaxml2 .=
"</Technical>";
208 $metaxml = str_replace(
"</MetaData>",$metaxml2.
"</MetaData>",$metaxml);
215 $xml .=
"<MediaItem Purpose=\"".$row[
"purpose"].
"\">";
216 $xml .=
"<Location Type=\"".$row[
"location_type"].
"\">".
$row[
"location"].
"</Location>";
217 $xml .=
"<Format>".$row[
"format"].
"</Format>";
218 $xml .=
"<Layout Width=\"".$row[
"width"].
"\" Height=\"".
$row[
"height"].
"\"/>";
219 $xml .=
"</MediaItem>";
222 $xml .=
"</MediaObject>";
231 $bib = $nested->export($obj_id,
"bib");
238 $xml .=
"</ContentObject>";
243 $fileName = $objRow[
"title"];
244 $fileName = str_replace(
" ",
"_",$fileName);
246 if (!file_exists($export_dir.
"/".$fileName))
248 @mkdir($export_dir.
"/".$fileName);
249 @chmod($export_dir.
"/".$fileName,0755);
252 if (!file_exists($export_dir.
"/".$fileName.
"/objects"))
254 @mkdir($export_dir.
"/".$fileName.
"/objects");
255 @chmod($export_dir.
"/".$fileName.
"/objects",0755);
261 $mob_ids = $this->mob_ids;
262 if (is_array($mob_ids) && count($mob_ids)>0)
265 while (list ($key, $val) = each ($mob_ids))
268 if (!file_exists($export_dir.
"/".$fileName.
"/objects/mm".$key))
270 @mkdir($export_dir.
"/".$fileName.
"/objects/mm".$key);
271 @chmod($export_dir.
"/".$fileName.
"/objects/mm".$key,0755);
274 $mobdir =
"./data/mobs/mm_".$key;
275 ilUtil::rCopy($mobdir, $export_dir.
"/".$fileName.
"/objects/mm".$key);
282 $fp = fopen($export_dir.
"/".$fileName.
"/".$fileName.
".xml",
"wb");
289 ilUtil::zip($export_dir.
"/".$fileName, $export_dir.
"/".$fileName.
".zip");
301 return $export_dir.
"/".$fileName.
".zip";
330 $ilDB->manipulate(
"DELETE FROM dbk_translations ".
331 " WHERE id = ".$ilDB->quote($this->ref_id,
"integer").
" ".
332 " AND tr_id = ".$ilDB->quote($a_ref_id,
"integer"));
334 $ilDB->manipulate(
"INSERT INTO dbk_translations (id, tr_id) VALUES ".
335 "(".$ilDB->quote($this->ref_id,
"integer").
", ".
336 "".$ilDB->quote($a_ref_id,
"integer").
")");
338 $ilDB->manipulate(
"DELETE FROM dbk_translations ".
339 " WHERE id = ".$ilDB->quote($a_ref_id,
"integer").
" ".
340 " AND tr_id = ".$ilDB->quote($this->ref_id,
"integer"));
342 $ilDB->manipulate(
"INSERT INTO dbk_translations (id, tr_id) VALUES ".
343 "(".$ilDB->quote($a_ref_id,
"integer").
", ".
344 "".$ilDB->quote($this->ref_id,
"integer").
")");
354 if(!is_array($a_arr_ref_id))
358 foreach($a_arr_ref_id as
$ref_id)
373 $ilDB->manipulate(
"DELETE FROM dbk_translations ".
374 "WHERE id = ".$ilDB->quote($this->ref_id,
"integer").
" ".
375 "AND tr_id = ".$ilDB->quote($a_ref_id,
"integer"));
377 $ilDB->manipulate(
"DELETE FROM dbk_translations ".
378 "WHERE id = ".$ilDB->quote($a_ref_id,
"integer").
" ".
379 "AND tr_id = ".$ilDB->quote($this->ref_id,
"integer"));
389 if(!is_array($a_arr_ref_id))
393 foreach($a_arr_ref_id as
$ref_id)
401 return $this->tr_ids;
406 return $this->
export(
false);
415 $query =
"SELECT tr_id FROM dbk_translations ".
416 "WHERE id = ".$ilDB->quote($this->ref_id,
"integer");
419 while (
$row = $ilDB->fetchObject(
$res))
421 $tmp_tr_ids[] =
$row->tr_id;
423 return $this->tr_ids = $tmp_tr_ids ? $tmp_tr_ids : array();