4 require_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
25 parent::ilObjContentObject($a_id, $a_call_by_reference);
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");
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(
"./Services/Xml/classes/class.ilNestedSetXML.php");
137 $objRow[
"obj_id"] = ilOject::_lookupObjId();
138 $objRow[
"title"] = ilOject::_lookupTitle($objRow[
"obj_id"]);
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();
readAssignedTranslations()
Class NestedSetXML functions for storing XML-Data into nested-set-database-strcture.
getExportDirectory($a_type="xml")
get export directory of lm
domxml_open_mem($str, $mode=DOMXML_LOAD_PARSING, &$error=NULL)
ilObjDlBook($a_id=0, $a_call_by_reference=true)
Constructor public.
xpath_new_context($dom_document)
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
export($a_deliver=true)
exports the digi-lib-object into a xml structure
xpath_eval($xpath_context, $eval_str, $contextnode=null)
deleteTranslation($a_ref_id)
initBibItemObject()
init bib object (contains all bib item data)
createExportDirectory($a_type="xml")
creates data directory for export files (data_dir/lm_data/lm_<id>/export, depending on data directory...
exportRekursiv($obj_id, $depth, $left, $right)
export lm_data-table to xml-structure
redirection script todo: (a better solution should control the processing via a xml file) ...
deleteTranslations($a_arr_ref_id)
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
addTranslations($a_arr_ref_id)
addTranslation($a_ref_id)
Class ilObjContentObject.