55 $this->export_types = array(
"SCORM 2004 3rd",
"SCORM 2004 4th",
"SCORM 1.2",
"HTML",
"ISO",
"PDF");
57 if(!in_array($a_mode,$this->export_types))
58 die(
"Unsupported format");
60 $this->cont_obj =& $a_cont_obj;
65 $this->mode = $a_mode;
67 $settings = $this->ilias->getAllSettings();
69 $this->inst_id = IL_INST_ID;
71 switch ($this->cont_obj->getType())
74 $this->module_id = $this->cont_obj->getId();
75 $this->cont_obj_id = $this->cont_obj->getId();
78 $this->module_id = $this->cont_obj->slm_id;
79 $this->cont_obj_id = $this->cont_obj->getId();
104 case "SCORM 2004 3rd":
105 return $ret.
"_scorm2004";
106 case "SCORM 2004 4th":
107 return $ret.
"_scorm2004_4th";
111 return $ret.
"_scorm12";
118 return $this->date.
"__".$this->inst_id.
"__".$this->cont_obj->getType().
"_".
$this->cont_obj_id;
126 return $this->subdir.
".iso";
128 return $this->subdir.
".pdf";
130 return $this->subdir.
".zip";
154 case "SCORM 2004 3rd":
156 case "SCORM 2004 4th":
176 $ilBench->start(
"ContentObjectExport",
"buildExportFile");
178 require_once(
"./Services/Xml/classes/class.ilXmlWriter.php");
186 $expLog =
new ilLog($expDir,
"export.log");
188 $expLog->setLogFormat(
"");
189 $expLog->write(date(
"[y-m-d H:i:s] ").
"Start Export");
193 $ilBench->start(
"ContentObjectExport",
"buildExportFile_getXML");
194 $this->cont_obj->exportScorm($this->inst_id, $this->export_dir.
"/".$this->subdir, $ver, $expLog);
195 $ilBench->stop(
"ContentObjectExport",
"buildExportFile_getXML");
198 $ilBench->start(
"ContentObjectExport",
"buildExportFile_zipFile");
199 ilUtil::zip($this->export_dir.
"/".$this->subdir, $this->export_dir.
"/".$this->subdir.
".zip",
true);
200 $ilBench->stop(
"ContentObjectExport",
"buildExportFile_zipFile");
204 $expLog->write(date(
"[y-m-d H:i:s] ").
"Finished Export");
205 $ilBench->stop(
"ContentObjectExport",
"buildExportFile");
207 return $this->export_dir.
"/".$this->subdir.
".zip";
217 $ilBench->start(
"ContentObjectExport",
"buildExportFile");
219 require_once(
"./Services/Xml/classes/class.ilXmlWriter.php");
227 $expLog =
new ilLog($expDir,
"export.log");
229 $expLog->setLogFormat(
"");
230 $expLog->write(date(
"[y-m-d H:i:s] ").
"Start Export");
234 $ilBench->start(
"ContentObjectExport",
"buildExportFile_getXML");
235 $this->cont_obj->exportHTML($this->inst_id, $this->export_dir.
"/".$this->subdir, $expLog);
236 $ilBench->stop(
"ContentObjectExport",
"buildExportFile_getXML");
239 $ilBench->start(
"ContentObjectExport",
"buildExportFile_zipFile");
240 ilUtil::zip($this->export_dir.
"/".$this->subdir, $this->export_dir.
"/".$this->subdir.
".zip",
true);
241 $ilBench->stop(
"ContentObjectExport",
"buildExportFile_zipFile");
245 $expLog->write(date(
"[y-m-d H:i:s] ").
"Finished Export");
246 $ilBench->stop(
"ContentObjectExport",
"buildExportFile");
248 return $this->export_dir.
"/".$this->subdir.
".zip";
255 $ilBench->start(
"ContentObjectExport",
"buildExportFile");
257 require_once(
"./Services/Xml/classes/class.ilXmlWriter.php");
265 $expLog =
new ilLog($expDir,
"export.log");
267 $expLog->setLogFormat(
"");
268 $expLog->write(date(
"[y-m-d H:i:s] ").
"Start Export");
272 $ilBench->start(
"ContentObjectExport",
"buildExportFile_getXML");
273 $this->cont_obj->exportHTML($this->inst_id, $this->export_dir.
"/".$this->subdir, $expLog);
274 $ilBench->stop(
"ContentObjectExport",
"buildExportFile_getXML");
277 $ilBench->start(
"ContentObjectExport",
"buildExportFile_zipFile");
280 $result = $this->export_dir.
"/".$this->subdir.
".iso";
282 $ilBench->stop(
"ContentObjectExport",
"buildExportFile_zipFile");
286 $expLog->write(date(
"[y-m-d H:i:s] ").
"Finished Export");
287 $ilBench->stop(
"ContentObjectExport",
"buildExportFile");
303 $ilBench->start(
"ContentObjectExport",
"buildExportFile");
305 require_once(
"./Services/Xml/classes/class.ilXmlWriter.php");
313 $expLog =
new ilLog($expDir,
"export.log");
315 $expLog->setLogFormat(
"");
316 $expLog->write(date(
"[y-m-d H:i:s] ").
"Start Export");
318 $ilBench->start(
"ContentObjectExport",
"buildExportFile_getXML");
319 $fo_string = $this->cont_obj->exportPDF($this->inst_id, $this->export_dir.
"/".$this->subdir, $expLog);
321 $ilBench->stop(
"ContentObjectExport",
"buildExportFile_getXML");
323 $ilBench->start(
"ContentObjectExport",
"buildExportFile_pdfFile");
324 fputs(fopen($this->export_dir.
"/".$this->subdir.
'/temp.fo',
'w+'),$fo_string);
336 include_once
'./Services/WebServices/RPC/classes/class.ilRpcClientFactory.php';
341 fputs(fopen($this->export_dir.
'/'.$this->subdir.
'.pdf',
'w+'),$pdf_base64->scalar);
353 $ilBench->stop(
"ContentObjectExport",
"buildExportFile_pdfFile");
357 $expLog->write(date(
"[y-m-d H:i:s] ").
"Finished Export");
358 $ilBench->stop(
"ContentObjectExport",
"buildExportFile");
360 return $this->export_dir.
"/".$this->subdir.
".pdf";
366 if(!is_writable($lm_data_dir))
368 $this->ilias->raiseError(
"Content object Data Directory (".$lm_data_dir.
") not writeable.",$this->ilias->error_obj->FATAL);
373 if(!@is_dir($lm_dir))
375 $this->ilias->raiseError(
"Creation of Learning Module Directory failed.",$this->ilias->error_obj->FATAL);
381 if(!@is_dir($this->export_dir))
383 $this->ilias->raiseError(
"Creation of Export Directory failed.",$this->ilias->error_obj->FATAL);