36 $this->export_types = array(
"SCORM 2004 3rd",
"SCORM 2004 4th",
"SCORM 1.2",
"HTML",
"ISO",
"PDF",
39 if(!in_array($a_mode,$this->export_types))
40 die(
"Unsupported format");
42 $this->cont_obj =& $a_cont_obj;
47 $this->mode = $a_mode;
51 $this->inst_id = IL_INST_ID;
53 switch ($this->cont_obj->getType())
56 $this->module_id = $this->cont_obj->getId();
57 $this->cont_obj_id = $this->cont_obj->getId();
60 $this->module_id = $this->cont_obj->slm_id;
61 $this->cont_obj_id = $this->cont_obj->getId();
86 case "SCORM 2004 3rd":
87 return $ret.
"_scorm2004";
88 case "SCORM 2004 4th":
89 return $ret.
"_scorm2004_4th";
93 return $ret.
"_html_one";
95 return $ret.
"_scorm12";
102 return $this->date.
"__".$this->inst_id.
"__".$this->cont_obj->getType().
"_".
$this->cont_obj_id;
110 return $this->subdir.
".iso";
112 return $this->subdir.
".pdf";
114 return $this->subdir.
".zip";
138 case "SCORM 2004 3rd":
140 case "SCORM 2004 4th":
162 $ilBench->start(
"ContentObjectExport",
"buildExportFile");
164 require_once(
"./Services/Xml/classes/class.ilXmlWriter.php");
172 include_once
'./Services/Logging/classes/class.ilLog.php';
173 $expLog =
new ilLog($expDir,
"export.log");
175 $expLog->setLogFormat(
"");
176 $expLog->write(date(
"[y-m-d H:i:s] ").
"Start Export");
180 $ilBench->start(
"ContentObjectExport",
"buildExportFile_getXML");
181 $this->cont_obj->exportScorm($this->inst_id, $this->export_dir.
"/".$this->subdir, $ver, $expLog);
182 $ilBench->stop(
"ContentObjectExport",
"buildExportFile_getXML");
185 $ilBench->start(
"ContentObjectExport",
"buildExportFile_zipFile");
186 ilUtil::zip($this->export_dir.
"/".$this->subdir, $this->export_dir.
"/".$this->subdir.
".zip",
true);
187 $ilBench->stop(
"ContentObjectExport",
"buildExportFile_zipFile");
191 $expLog->write(date(
"[y-m-d H:i:s] ").
"Finished Export");
192 $ilBench->stop(
"ContentObjectExport",
"buildExportFile");
194 return $this->export_dir.
"/".$this->subdir.
".zip";
202 require_once(
"./Services/Xml/classes/class.ilXmlWriter.php");
210 include_once
'./Services/Logging/classes/class.ilLog.php';
211 $expLog =
new ilLog($expDir,
"export.log");
213 $expLog->setLogFormat(
"");
214 $expLog->write(date(
"[y-m-d H:i:s] ").
"Start Export");
217 $this->cont_obj->exportHTML($this->inst_id, $this->export_dir.
"/".$this->subdir, $expLog);
220 ilUtil::zip($this->export_dir.
"/".$this->subdir, $this->export_dir.
"/".$this->subdir.
".zip",
true);
224 $expLog->write(date(
"[y-m-d H:i:s] ").
"Finished Export");
226 return $this->export_dir.
"/".$this->subdir.
".zip";
234 require_once(
"./Services/Xml/classes/class.ilXmlWriter.php");
242 include_once
'./Services/Logging/classes/class.ilLog.php';
243 $expLog =
new ilLog($expDir,
"export.log");
245 $expLog->setLogFormat(
"");
246 $expLog->write(date(
"[y-m-d H:i:s] ").
"Start Export");
249 $this->cont_obj->exportHTMLOne($this->inst_id, $this->export_dir.
"/".$this->subdir, $expLog);
252 ilUtil::zip($this->export_dir.
"/".$this->subdir, $this->export_dir.
"/".$this->subdir.
".zip",
true);
256 $expLog->write(date(
"[y-m-d H:i:s] ").
"Finished Export");
258 return $this->export_dir.
"/".$this->subdir.
".zip";
265 $ilBench->start(
"ContentObjectExport",
"buildExportFile");
267 require_once(
"./Services/Xml/classes/class.ilXmlWriter.php");
275 include_once
'./Services/Logging/classes/class.ilLog.php';
276 $expLog =
new ilLog($expDir,
"export.log");
278 $expLog->setLogFormat(
"");
279 $expLog->write(date(
"[y-m-d H:i:s] ").
"Start Export");
283 $ilBench->start(
"ContentObjectExport",
"buildExportFile_getXML");
284 $this->cont_obj->exportHTML($this->inst_id, $this->export_dir.
"/".$this->subdir, $expLog);
285 $ilBench->stop(
"ContentObjectExport",
"buildExportFile_getXML");
288 $ilBench->start(
"ContentObjectExport",
"buildExportFile_zipFile");
291 $result = $this->export_dir.
"/".$this->subdir.
".iso";
293 $ilBench->stop(
"ContentObjectExport",
"buildExportFile_zipFile");
297 $expLog->write(date(
"[y-m-d H:i:s] ").
"Finished Export");
298 $ilBench->stop(
"ContentObjectExport",
"buildExportFile");
314 $ilBench->start(
"ContentObjectExport",
"buildExportFile");
316 require_once(
"./Services/Xml/classes/class.ilXmlWriter.php");
324 include_once
'./Services/Logging/classes/class.ilLog.php';
325 $expLog =
new ilLog($expDir,
"export.log");
327 $expLog->setLogFormat(
"");
328 $expLog->write(date(
"[y-m-d H:i:s] ").
"Start Export");
330 $ilBench->start(
"ContentObjectExport",
"buildExportFile_getXML");
331 $fo_string = $this->cont_obj->exportPDF($this->inst_id, $this->export_dir.
"/".$this->subdir, $expLog);
333 $ilBench->stop(
"ContentObjectExport",
"buildExportFile_getXML");
335 $ilBench->start(
"ContentObjectExport",
"buildExportFile_pdfFile");
336 fputs(fopen($this->export_dir.
"/".$this->subdir.
'/temp.fo',
'w+'),$fo_string);
339 include_once
'./Services/WebServices/RPC/classes/class.ilRpcClientFactory.php';
344 fputs(fopen($this->export_dir.
'/'.$this->subdir.
'.pdf',
'w+'),$pdf_base64->scalar);
356 $ilBench->stop(
"ContentObjectExport",
"buildExportFile_pdfFile");
360 $expLog->write(date(
"[y-m-d H:i:s] ").
"Finished Export");
361 $ilBench->stop(
"ContentObjectExport",
"buildExportFile");
363 return $this->export_dir.
"/".$this->subdir.
".pdf";
369 if(!is_writable($lm_data_dir))
371 $this->
ilias->raiseError(
"Content object Data Directory (".$lm_data_dir.
") not writeable.",$this->ilias->error_obj->FATAL);
376 if(!@is_dir($lm_dir))
378 $this->
ilias->raiseError(
"Creation of Learning Module Directory failed.",$this->
ilias->error_obj->FATAL);
384 if(!@is_dir($this->export_dir))
386 $this->
ilias->raiseError(
"Creation of Export Directory failed.",$this->
ilias->error_obj->FATAL);
buildExportFileHTML()
build xml export file
getExportDirectoryForType($type)
redirection script todo: (a better solution should control the processing via a xml file) ...
static CreateIsoFromFolder($a_dir, $a_file)
Export class for SCORM 2004 object.
ilScorm2004Export(&$a_cont_obj, $a_mode="SCORM 2004 3rd")
Constructor public.
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static factory($a_package)
Create an XML_RPC2 client instance.
static getDataDir()
get data directory (outside webspace)
buildExportFileHTMLOne()
build xml export file
getSupportedExportTypes()
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
buildExportFileSCORM($ver)
build xml export file
buildExportFile()
build export file (complete zip file)