32 function __construct(&$a_cont_obj, $a_mode =
"SCORM 2004 3rd")
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";
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");
165 include_once
'./Services/MathJax/classes/class.ilMathJax.php';
168 require_once(
"./Services/Xml/classes/class.ilXmlWriter.php");
176 include_once
'./Services/Logging/classes/class.ilLog.php';
177 $expLog =
new ilLog($expDir,
"export.log");
179 $expLog->setLogFormat(
"");
180 $expLog->write(
date(
"[y-m-d H:i:s] ").
"Start Export");
184 $ilBench->start(
"ContentObjectExport",
"buildExportFile_getXML");
185 $this->cont_obj->exportScorm($this->inst_id, $this->export_dir.
"/".$this->subdir, $ver, $expLog);
186 $ilBench->stop(
"ContentObjectExport",
"buildExportFile_getXML");
189 $ilBench->start(
"ContentObjectExport",
"buildExportFile_zipFile");
190 ilUtil::zip($this->export_dir.
"/".$this->subdir, $this->export_dir.
"/".$this->subdir.
".zip",
true);
191 $ilBench->stop(
"ContentObjectExport",
"buildExportFile_zipFile");
195 $expLog->write(
date(
"[y-m-d H:i:s] ").
"Finished Export");
196 $ilBench->stop(
"ContentObjectExport",
"buildExportFile");
198 return $this->export_dir.
"/".$this->subdir.
".zip";
206 require_once(
"./Services/Xml/classes/class.ilXmlWriter.php");
209 include_once
'./Services/MathJax/classes/class.ilMathJax.php';
218 include_once
'./Services/Logging/classes/class.ilLog.php';
219 $expLog =
new ilLog($expDir,
"export.log");
221 $expLog->setLogFormat(
"");
222 $expLog->write(
date(
"[y-m-d H:i:s] ").
"Start Export");
225 $this->cont_obj->exportHTML($this->inst_id, $this->export_dir.
"/".$this->subdir, $expLog);
228 ilUtil::zip($this->export_dir.
"/".$this->subdir, $this->export_dir.
"/".$this->subdir.
".zip",
true);
232 $expLog->write(
date(
"[y-m-d H:i:s] ").
"Finished Export");
234 return $this->export_dir.
"/".$this->subdir.
".zip";
242 require_once(
"./Services/Xml/classes/class.ilXmlWriter.php");
245 include_once
'./Services/MathJax/classes/class.ilMathJax.php';
254 include_once
'./Services/Logging/classes/class.ilLog.php';
255 $expLog =
new ilLog($expDir,
"export.log");
257 $expLog->setLogFormat(
"");
258 $expLog->write(
date(
"[y-m-d H:i:s] ").
"Start Export");
261 $this->cont_obj->exportHTMLOne($this->inst_id, $this->export_dir.
"/".$this->subdir, $expLog);
264 ilUtil::zip($this->export_dir.
"/".$this->subdir, $this->export_dir.
"/".$this->subdir.
".zip",
true);
268 $expLog->write(
date(
"[y-m-d H:i:s] ").
"Finished Export");
270 return $this->export_dir.
"/".$this->subdir.
".zip";
277 $ilBench->start(
"ContentObjectExport",
"buildExportFile");
280 include_once
'./Services/MathJax/classes/class.ilMathJax.php';
283 require_once(
"./Services/Xml/classes/class.ilXmlWriter.php");
291 include_once
'./Services/Logging/classes/class.ilLog.php';
292 $expLog =
new ilLog($expDir,
"export.log");
294 $expLog->setLogFormat(
"");
295 $expLog->write(
date(
"[y-m-d H:i:s] ").
"Start Export");
299 $ilBench->start(
"ContentObjectExport",
"buildExportFile_getXML");
300 $this->cont_obj->exportHTML($this->inst_id, $this->export_dir.
"/".$this->subdir, $expLog);
301 $ilBench->stop(
"ContentObjectExport",
"buildExportFile_getXML");
304 $ilBench->start(
"ContentObjectExport",
"buildExportFile_zipFile");
307 $result = $this->export_dir.
"/".$this->subdir.
".iso";
309 $ilBench->stop(
"ContentObjectExport",
"buildExportFile_zipFile");
313 $expLog->write(
date(
"[y-m-d H:i:s] ").
"Finished Export");
314 $ilBench->stop(
"ContentObjectExport",
"buildExportFile");
330 $ilBench->start(
"ContentObjectExport",
"buildExportFile");
333 include_once
'./Services/MathJax/classes/class.ilMathJax.php';
336 require_once(
"./Services/Xml/classes/class.ilXmlWriter.php");
344 include_once
'./Services/Logging/classes/class.ilLog.php';
345 $expLog =
new ilLog($expDir,
"export.log");
347 $expLog->setLogFormat(
"");
348 $expLog->write(
date(
"[y-m-d H:i:s] ").
"Start Export");
350 $ilBench->start(
"ContentObjectExport",
"buildExportFile_getXML");
351 $fo_string = $this->cont_obj->exportPDF($this->inst_id, $this->export_dir.
"/".$this->subdir, $expLog);
357 ->insertLatexImages($fo_string);
359 $ilBench->stop(
"ContentObjectExport",
"buildExportFile_getXML");
361 $ilBench->start(
"ContentObjectExport",
"buildExportFile_pdfFile");
362 fputs(fopen($this->export_dir.
"/".$this->subdir.
'/temp.fo',
'w+'),$fo_string);
365 include_once
'./Services/WebServices/RPC/classes/class.ilRpcClientFactory.php';
370 fputs(fopen($this->export_dir.
'/'.$this->subdir.
'.pdf',
'w+'),$pdf_base64->scalar);
377 $ilBench->stop(
"ContentObjectExport",
"buildExportFile_pdfFile");
381 $expLog->write(
date(
"[y-m-d H:i:s] ").
"Finished Export");
382 $ilBench->stop(
"ContentObjectExport",
"buildExportFile");
384 return $this->export_dir.
"/".$this->subdir.
".pdf";
390 if(!is_writable($lm_data_dir))
392 $this->
ilias->raiseError(
"Content object Data Directory (".$lm_data_dir.
") not writeable.",$this->ilias->error_obj->FATAL);
397 if(!@is_dir($lm_dir))
399 $this->
ilias->raiseError(
"Creation of Learning Module Directory failed.",$this->
ilias->error_obj->FATAL);
405 if(!@is_dir($this->export_dir))
407 $this->
ilias->raiseError(
"Creation of Export Directory failed.",$this->
ilias->error_obj->FATAL);
buildExportFileHTML()
build xml export file
static factory($a_package, $a_timeout=0)
Creates an ilRpcClient instance to our ilServer.
getExportDirectoryForType($type)
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
redirection script todo: (a better solution should control the processing via a xml file) ...
__construct(&$a_cont_obj, $a_mode="SCORM 2004 3rd")
Constructor public.
static CreateIsoFromFolder($a_dir, $a_file)
Export class for SCORM 2004 object.
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
const RENDER_PNG_AS_FO_FILE
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static getDataDir()
get data directory (outside webspace)
static getInstance()
Singleton: get instance.
buildExportFileHTMLOne()
build xml export file
getSupportedExportTypes()
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
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
const PURPOSE_DEFERRED_PDF
buildExportFile()
build export file (complete zip file)