Export class for content objects.
More...
◆ __construct()
ilContObjectExport::__construct |
( |
& |
$a_cont_obj, |
|
|
|
$a_mode = "xml" , |
|
|
|
$a_lang = "" |
|
) |
| |
Constructor public.
Definition at line 28 of file class.ilContObjectExport.php.
References $DIC, $ilDB, and $ilErr.
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";
◆ buildExportFile()
ilContObjectExport::buildExportFile |
( |
|
$a_mode = "" | ) |
|
◆ buildExportFileHTML()
ilContObjectExport::buildExportFileHTML |
( |
| ) |
|
build html package
Definition at line 220 of file class.ilContObjectExport.php.
Referenced by buildExportFile().
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);
◆ buildExportFilePDF()
ilContObjectExport::buildExportFilePDF |
( |
| ) |
|
◆ buildExportFileSCORM()
ilContObjectExport::buildExportFileSCORM |
( |
| ) |
|
build scorm package
Definition at line 237 of file class.ilContObjectExport.php.
Referenced by buildExportFile().
240 $this->cont_obj->createExportDirectory(
"scorm");
243 $this->cont_obj->exportSCORM($this->export_dir .
"/" . $this->subdir, $expLog);
◆ buildExportFileXML()
ilContObjectExport::buildExportFileXML |
( |
|
$a_mode = "" | ) |
|
build xml export file
Definition at line 113 of file class.ilContObjectExport.php.
References $_GET, ilObjContentObject\isOnlineHelpModule(), ilUtil\makeDir(), ilObjStyleSheet\setExportSubDir(), ilXmlWriter\xmlSetDtdDef(), and ilUtil\zip().
Referenced by buildExportFile().
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";
xmlSetDtdDef($dtdDef)
Sets dtd definition.
setExportSubDir($a_dir)
Set local directory, that will be included within the zip 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.
◆ getInstId()
ilContObjectExport::getInstId |
( |
| ) |
|
◆ $cont_obj
ilContObjectExport::$cont_obj |
◆ $db
◆ $err
◆ $inst_id
ilContObjectExport::$inst_id |
◆ $mode
ilContObjectExport::$mode |
The documentation for this class was generated from the following file: