4 require_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
28 public function __construct(&$a_cont_obj, $a_mode =
"xml", $a_lang =
"")
33 $ilDB = $DIC->database();
35 $this->cont_obj = $a_cont_obj;
39 $this->mode = $a_mode;
40 $this->lang = $a_lang;
42 $this->inst_id = IL_INST_ID;
45 switch ($this->mode) {
47 if ($this->lang ==
"") {
48 $this->export_dir = $this->cont_obj->getExportDirectory(
"html");
50 $this->export_dir = $this->cont_obj->getExportDirectory(
"html_" . $this->lang);
52 $this->subdir = $this->cont_obj->getType() .
"_" . $this->cont_obj->getId();
53 $this->filename = $this->subdir .
".zip";
57 $this->export_dir = $this->cont_obj->getExportDirectory(
"scorm");
58 $this->subdir = $this->cont_obj->getType() .
"_" . $this->cont_obj->getId();
59 $this->filename = $this->subdir .
".zip";
63 $this->export_dir = $this->cont_obj->getOfflineDirectory();
64 $this->subdir = $date .
"__" . $this->inst_id .
"__" .
65 $this->cont_obj->getType() .
"_" . $this->cont_obj->getId();
66 $this->filename = $this->subdir .
".fo";
70 $this->export_dir = $this->cont_obj->getExportDirectory();
71 $this->subdir = $date .
"__" . $this->inst_id .
"__" .
72 $this->cont_obj->getType() .
"_" . $this->cont_obj->getId();
73 $this->filename = $this->subdir .
".xml";
91 switch ($this->mode) {
115 if (in_array($a_mode,
array(
"master",
"masternomedia"))) {
116 include_once(
"./Services/Export/classes/class.ilExport.php");
118 $conf = $exp->getConfig(
"Modules/LearningModule");
119 $conf->setMasterLanguageOnly(
true, ($a_mode ==
"master"));
120 $exp->exportObject($this->cont_obj->getType(), $this->cont_obj->getId(),
"5.1.0");
124 require_once(
"./Services/Xml/classes/class.ilXmlWriter.php");
129 $this->xml->
xmlSetDtdDef(
"<!DOCTYPE ContentObject SYSTEM \"http://www.ilias.de/download/dtd/ilias_co_3_7.dtd\">");
132 $this->xml->xmlSetGenCmt(
"Export of ILIAS Content Module " .
133 $this->cont_obj->getId() .
" of installation " . $this->inst .
".");
136 $this->xml->xmlHeader();
139 $this->cont_obj->createExportDirectory();
144 $expDir = $this->cont_obj->getExportDirectory();
145 include_once
'./Services/Logging/classes/class.ilLog.php';
146 $expLog =
new ilLog($expDir,
"export.log");
148 $expLog->setLogFormat(
"");
149 $expLog->write(
date(
"[y-m-d H:i:s] ") .
"Start Export");
152 $this->cont_obj->exportXML(
155 $this->export_dir .
"/" . $this->subdir,
160 if ($this->cont_obj->getStyleSheetId() > 0) {
161 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
162 $style_obj =
new ilObjStyleSheet($this->cont_obj->getStyleSheetId(),
false);
165 $style_file = $style_obj->export();
166 if (is_file($style_file)) {
167 copy($style_file, $this->export_dir .
"/" . $this->subdir .
"/style.zip");
179 $this->xml->xmlDumpFile($this->export_dir .
"/" . $this->subdir .
"/" . $this->filename,
false);
183 include_once(
"./Services/Export/classes/class.ilExport.php");
187 $this->cont_obj->getId(),
191 $this->export_dir .
"/" . $this->subdir
197 $this->export_dir .
"/" . $this->subdir,
198 $this->export_dir .
"/" . $this->subdir .
".zip" 202 $this->xml->_XmlWriter;
204 $expLog->write(
date(
"[y-m-d H:i:s] ") .
"Finished Export");
206 return $this->export_dir .
"/" . $this->subdir .
".zip";
223 if ($this->lang ==
"") {
224 $this->cont_obj->createExportDirectory(
"html");
226 $this->cont_obj->createExportDirectory(
"html_" . $this->lang);
231 $this->cont_obj->exportHTML($this->export_dir .
"/" . $this->subdir, $expLog,
true,
"html", $this->lang);
240 $this->cont_obj->createExportDirectory(
"scorm");
243 $this->cont_obj->exportSCORM($this->export_dir .
"/" . $this->subdir, $expLog);
xmlSetDtdDef($dtdDef)
Sets dtd definition.
buildExportFile($a_mode="")
build export file (complete zip file)
setExportSubDir($a_dir)
Set local directory, that will be included within the zip file.
buildExportFileXML($a_mode="")
build xml export file
Export class for content objects.
__construct(&$a_cont_obj, $a_mode="xml", $a_lang="")
Constructor public.
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
buildExportFilePDF()
build pdf offline file
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 makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static isOnlineHelpModule($a_id, $a_as_obj_id=false)
Is module an online module.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
buildExportFileHTML()
build html package
buildExportFileSCORM()
build scorm package