36 public function __construct(&$a_cont_obj, $a_mode =
"SCORM 2004 3rd")
41 $this->log = $DIC[
"ilLog"];
43 $ilDB = $DIC->database();
46 $this->export_types =
array(
"SCORM 2004 3rd",
"SCORM 2004 4th",
"SCORM 1.2",
"HTML",
"ISO",
"PDF",
49 if (!in_array($a_mode, $this->export_types)) {
50 die(
"Unsupported format");
53 $this->cont_obj = $a_cont_obj;
57 $this->mode = $a_mode;
61 $this->inst_id = IL_INST_ID;
63 switch ($this->cont_obj->getType()) {
65 $this->module_id = $this->cont_obj->getId();
66 $this->cont_obj_id = $this->cont_obj->getId();
69 $this->module_id = $this->cont_obj->slm_id;
70 $this->cont_obj_id = $this->cont_obj->getId();
94 case "SCORM 2004 3rd":
95 return $ret .
"_scorm2004";
96 case "SCORM 2004 4th":
97 return $ret .
"_scorm2004_4th";
99 return $ret .
"_html";
101 return $ret .
"_html_one";
103 return $ret .
"_scorm12";
109 return $this->
date .
"__" . $this->inst_id .
"__" . $this->cont_obj->getType() .
"_" .
$this->cont_obj_id;
114 switch ($this->mode) {
116 return $this->subdir .
".iso";
118 return $this->subdir .
".pdf";
120 return $this->subdir .
".zip";
142 switch ($this->mode) {
143 case "SCORM 2004 3rd":
145 case "SCORM 2004 4th":
167 include_once
'./Services/MathJax/classes/class.ilMathJax.php';
170 require_once(
"./Services/Xml/classes/class.ilXmlWriter.php");
178 include_once
'./Services/Logging/classes/class.ilLog.php';
179 $expLog =
new ilLog($expDir,
"export.log");
181 $expLog->setLogFormat(
"");
182 $expLog->write(
date(
"[y-m-d H:i:s] ") .
"Start Export");
186 $this->cont_obj->exportScorm($this->inst_id, $this->export_dir .
"/" . $this->subdir, $ver, $expLog);
189 ilUtil::zip($this->export_dir .
"/" . $this->subdir, $this->export_dir .
"/" . $this->subdir .
".zip",
true);
193 $expLog->write(
date(
"[y-m-d H:i:s] ") .
"Finished Export");
195 return $this->export_dir .
"/" . $this->subdir .
".zip";
203 require_once(
"./Services/Xml/classes/class.ilXmlWriter.php");
206 include_once
'./Services/MathJax/classes/class.ilMathJax.php';
215 include_once
'./Services/Logging/classes/class.ilLog.php';
216 $expLog =
new ilLog($expDir,
"export.log");
218 $expLog->setLogFormat(
"");
219 $expLog->write(
date(
"[y-m-d H:i:s] ") .
"Start Export");
222 $this->cont_obj->exportHTML($this->inst_id, $this->export_dir .
"/" . $this->subdir, $expLog);
225 ilUtil::zip($this->export_dir .
"/" . $this->subdir, $this->export_dir .
"/" . $this->subdir .
".zip",
true);
229 $expLog->write(
date(
"[y-m-d H:i:s] ") .
"Finished Export");
231 return $this->export_dir .
"/" . $this->subdir .
".zip";
239 require_once(
"./Services/Xml/classes/class.ilXmlWriter.php");
242 include_once
'./Services/MathJax/classes/class.ilMathJax.php';
251 include_once
'./Services/Logging/classes/class.ilLog.php';
252 $expLog =
new ilLog($expDir,
"export.log");
254 $expLog->setLogFormat(
"");
255 $expLog->write(
date(
"[y-m-d H:i:s] ") .
"Start Export");
258 $this->cont_obj->exportHTMLOne($this->inst_id, $this->export_dir .
"/" . $this->subdir, $expLog);
261 ilUtil::zip($this->export_dir .
"/" . $this->subdir, $this->export_dir .
"/" . $this->subdir .
".zip",
true);
265 $expLog->write(
date(
"[y-m-d H:i:s] ") .
"Finished Export");
267 return $this->export_dir .
"/" . $this->subdir .
".zip";
275 include_once
'./Services/MathJax/classes/class.ilMathJax.php';
278 require_once(
"./Services/Xml/classes/class.ilXmlWriter.php");
286 include_once
'./Services/Logging/classes/class.ilLog.php';
287 $expLog =
new ilLog($expDir,
"export.log");
289 $expLog->setLogFormat(
"");
290 $expLog->write(
date(
"[y-m-d H:i:s] ") .
"Start Export");
294 $this->cont_obj->exportHTML($this->inst_id, $this->export_dir .
"/" . $this->subdir, $expLog);
298 $result = $this->export_dir .
"/" . $this->subdir .
".iso";
303 $expLog->write(
date(
"[y-m-d H:i:s] ") .
"Finished Export");
312 include_once
'./Services/MathJax/classes/class.ilMathJax.php';
315 require_once(
"./Services/Xml/classes/class.ilXmlWriter.php");
323 include_once
'./Services/Logging/classes/class.ilLog.php';
324 $expLog =
new ilLog($expDir,
"export.log");
326 $expLog->setLogFormat(
"");
327 $expLog->write(
date(
"[y-m-d H:i:s] ") .
"Start Export");
329 $fo_string = $this->cont_obj->exportPDF($this->inst_id, $this->export_dir .
"/" . $this->subdir, $expLog);
335 ->insertLatexImages($fo_string);
338 fputs(fopen($this->export_dir .
"/" . $this->subdir .
'/temp.fo',
'w+'), $fo_string);
341 include_once
'./Services/WebServices/RPC/classes/class.ilRpcClientFactory.php';
345 fputs(fopen($this->export_dir .
'/' . $this->subdir .
'.pdf',
'w+'), $pdf_base64->scalar);
353 $expLog->write(
date(
"[y-m-d H:i:s] ") .
"Finished Export");
355 return $this->export_dir .
"/" . $this->subdir .
".pdf";
363 if (!is_writable($lm_data_dir)) {
364 $ilErr->raiseError(
"Content object Data Directory (" . $lm_data_dir .
") not writeable.",
$ilErr->FATAL);
369 if (!@is_dir($lm_dir)) {
370 $ilErr->raiseError(
"Creation of Learning Module Directory failed.",
$ilErr->FATAL);
376 if (!@is_dir($this->export_dir)) {
377 $ilErr->raiseError(
"Creation of Export Directory failed.",
$ilErr->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())
__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)