4 require_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
29 function __construct(&$a_cont_obj, $a_mode =
"xml", $a_lang =
"")
33 $this->cont_obj = $a_cont_obj;
37 $this->mode = $a_mode;
38 $this->lang = $a_lang;
40 $this->inst_id = IL_INST_ID;
46 if ($this->lang ==
"")
48 $this->export_dir = $this->cont_obj->getExportDirectory(
"html");
52 $this->export_dir = $this->cont_obj->getExportDirectory(
"html_".$this->lang);
54 $this->subdir = $this->cont_obj->getType().
"_".$this->cont_obj->getId();
55 $this->filename = $this->subdir.
".zip";
59 $this->export_dir = $this->cont_obj->getExportDirectory(
"scorm");
60 $this->subdir = $this->cont_obj->getType().
"_".$this->cont_obj->getId();
61 $this->filename = $this->subdir.
".zip";
65 $this->export_dir = $this->cont_obj->getOfflineDirectory();
66 $this->subdir = $date.
"__".$this->inst_id.
"__".
67 $this->cont_obj->getType().
"_".$this->cont_obj->getId();
68 $this->filename = $this->subdir.
".fo";
72 $this->export_dir = $this->cont_obj->getExportDirectory();
73 $this->subdir = $date.
"__".$this->inst_id.
"__".
74 $this->cont_obj->getType().
"_".$this->cont_obj->getId();
75 $this->filename = $this->subdir.
".xml";
122 include_once(
"./Services/Export/classes/class.ilExport.php");
124 $conf = $exp->getConfig(
"Modules/LearningModule");
125 $conf->setMasterLanguageOnly(
true);
126 $exp->exportObject($this->cont_obj->getType(),$this->cont_obj->getId(),
"5.1.0");
130 $ilBench->start(
"ContentObjectExport",
"buildExportFile");
132 require_once(
"./Services/Xml/classes/class.ilXmlWriter.php");
137 $this->xml->
xmlSetDtdDef(
"<!DOCTYPE ContentObject SYSTEM \"http://www.ilias.de/download/dtd/ilias_co_3_7.dtd\">");
140 $this->xml->xmlSetGenCmt(
"Export of ILIAS Content Module ".
141 $this->cont_obj->getId().
" of installation ".$this->inst.
".");
144 $this->xml->xmlHeader();
147 $this->cont_obj->createExportDirectory();
152 $expDir = $this->cont_obj->getExportDirectory();
153 include_once
'./Services/Logging/classes/class.ilLog.php';
154 $expLog =
new ilLog($expDir,
"export.log");
156 $expLog->setLogFormat(
"");
157 $expLog->write(
date(
"[y-m-d H:i:s] ").
"Start Export");
161 $ilBench->start(
"ContentObjectExport",
"buildExportFile_getXML");
162 $this->cont_obj->exportXML($this->xml, $this->inst_id,
163 $this->export_dir.
"/".$this->subdir, $expLog);
164 $ilBench->stop(
"ContentObjectExport",
"buildExportFile_getXML");
167 if ($this->cont_obj->getStyleSheetId() > 0)
169 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
170 $style_obj =
new ilObjStyleSheet($this->cont_obj->getStyleSheetId(),
false);
173 $style_file = $style_obj->export();
174 if (is_file($style_file))
176 copy($style_file, $this->export_dir.
"/".$this->subdir.
"/style.zip");
188 $this->xml->xmlDumpFile($this->export_dir.
"/".$this->subdir.
"/".$this->filename
194 include_once(
"./Services/Export/classes/class.ilExport.php");
196 $exp->exportEntity(
"help", $this->cont_obj->getId(),
"4.3.0",
"Services/Help",
197 "OnlineHelp", $this->export_dir.
"/".$this->subdir);
202 $this->export_dir.
"/".$this->subdir.
".zip");
205 $this->xml->_XmlWriter;
207 $expLog->write(
date(
"[y-m-d H:i:s] ").
"Finished Export");
208 $ilBench->stop(
"ContentObjectExport",
"buildExportFile");
210 return $this->export_dir.
"/".$this->subdir.
".zip";
229 if ($this->lang ==
"")
231 $this->cont_obj->createExportDirectory(
"html");
235 $this->cont_obj->createExportDirectory(
"html_".$this->lang);
240 $this->cont_obj->exportHTML($this->export_dir.
"/".$this->subdir, $expLog,
true,
"html", $this->lang);
250 $ilBench->start(
"ContentObjectExport",
"buildSCORMPackage");
253 $this->cont_obj->createExportDirectory(
"scorm");
256 $ilBench->start(
"ContentObjectExport",
"buildSCORMPackage_getSCORM");
257 $this->cont_obj->exportSCORM($this->export_dir.
"/".$this->subdir, $expLog);
258 $ilBench->stop(
"ContentObjectExport",
"buildSCORMPackage_getSCORM");
261 $ilBench->stop(
"ContentObjectExport",
"buildSCORMPackage");
xmlSetDtdDef($dtdDef)
Sets dtd definition.
setExportSubDir($a_dir)
Set local directory, that will be included within the zip file.
Export class for content objects.
__construct(&$a_cont_obj, $a_mode="xml", $a_lang="")
Constructor public.
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
buildExportFileXML($a_master_only=false)
build xml export file
buildExportFilePDF()
build pdf offline file
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
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.
buildExportFile($a_master_only=false)
build export file (complete zip file)
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