47 string $a_mode =
"xml",
51 $this->export_factory =
new ExportFactory();
54 $ilDB = $DIC->database();
56 $this->cont_obj = $a_cont_obj;
58 $this->usr = $DIC->user();
60 $this->mode = $a_mode;
61 $this->lang = $a_lang;
66 switch ($this->mode) {
68 if ($this->lang ==
"") {
69 $this->export_dir = $this->cont_obj->getExportDirectory(
"html");
71 $this->export_dir = $this->cont_obj->getExportDirectory(
"html_" . $this->lang);
73 $this->subdir = $this->cont_obj->getType() .
"_" . $this->cont_obj->getId();
74 $this->filename = $this->subdir .
".zip";
78 $this->export_dir = $this->cont_obj->getExportDirectory();
79 $this->subdir = $date .
"__" . $this->inst_id .
"__" .
80 $this->cont_obj->getType() .
"_" . $this->cont_obj->getId();
81 $this->filename = $this->subdir .
".xml";
94 switch ($this->mode) {
100 $this->buildExportFileXML($a_mode);
108 public function buildExportFileXML(
111 if (in_array($a_mode, array(
"master",
"masternomedia"))) {
113 $configs = $this->export_factory->consumer()->exportConfig()->allExportConfigs();
114 $config = $configs->getElementByComponent(
'components/ILIAS/LearningModule');
115 $config->setMasterLanguageOnly(
true, ($a_mode ==
"master"));
116 $this->export_factory->consumer()->handler()->createStandardExport(
118 $this->data_factory->objId($this->cont_obj->getId()),
127 $this->xml->xmlSetDtdDef(
"<!DOCTYPE ContentObject SYSTEM \"https://www.ilias.de/download/dtd/ilias_co_3_7.dtd\">");
130 $this->xml->xmlSetGenCmt(
"Export of ILIAS Content Module " .
131 $this->cont_obj->getId() .
" of installation " . $this->inst .
".");
134 $this->xml->xmlHeader();
137 $this->cont_obj->createExportDirectory();
142 $expDir = $this->cont_obj->getExportDirectory();
143 $expLog =
new ilLog($expDir,
"export.log");
145 $expLog->setLogFormat(
"");
146 $expLog->write(date(
"[y-m-d H:i:s] ") .
"Start Export");
149 $this->cont_obj->exportXML(
152 $this->export_dir .
"/" . $this->subdir,
168 $this->xml->xmlDumpFile($this->export_dir .
"/" . $this->subdir .
"/" . $this->filename,
false);
172 $this->cont_obj->getRefId()
177 $this->cont_obj->getId(),
179 "components/ILIAS/Help",
187 $this->export_dir .
"/" . $this->subdir,
188 $this->export_dir .
"/" . $this->subdir .
".zip" 191 $expLog->write(date(
"[y-m-d H:i:s] ") .
"Finished Export");
193 return $this->export_dir .
"/" . $this->subdir .
".zip";
199 if ($this->lang ==
"") {
200 $this->cont_obj->createExportDirectory(
"html");
202 $this->cont_obj->createExportDirectory(
"html_" . $this->lang);
206 $exp = new \ILIAS\LearningModule\Export\LMHtmlExport(
213 $exp->exportHTML(
true);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilObjLearningModule $cont_obj
DataFactory $data_factory
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ExportFactory $export_factory
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static zip(string $a_dir, string $a_file, bool $compress_content=false)
__construct(ilObjLearningModule $a_cont_obj, string $a_mode="xml", string $a_lang="")
buildExportFile(string $a_mode="")
static isOnlineHelpModule(int $a_id, bool $a_as_obj_id=false)
Is module an online module.
static makeDir(string $a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...