49 $ilDB = $DIC->database();
51 $this->survey_obj = $a_survey_obj;
54 $this->mode = $a_mode;
55 $this->inst_id = IL_INST_ID;
58 switch ($this->mode) {
60 $this->export_dir = $this->survey_obj->getExportDirectory();
61 $this->subdir = $date .
"__" . $this->inst_id .
"__" .
62 "svy" .
"_" . $this->survey_obj->getId();
63 $this->filename = $this->subdir .
".xml";
82 switch ($this->mode) {
96 $this->survey_obj->createExportDirectory();
101 $expDir = $this->survey_obj->getExportDirectory();
102 include_once
"./Services/Logging/classes/class.ilLog.php";
103 $expLog =
new ilLog($expDir,
"export.log");
105 $expLog->setLogFormat(
"");
106 $expLog->write(
date(
"[y-m-d H:i:s] ") .
"Start Export");
109 $xmlFile = fopen($this->export_dir .
"/" . $this->subdir .
"/" . $this->filename,
"w");
110 fwrite($xmlFile, $this->survey_obj->toXML());
117 ilUtil::zip($this->export_dir .
"/" . $this->subdir, $this->export_dir .
"/" . $this->subdir .
".zip");
119 if (@file_exists($this->export_dir .
"/" . $this->subdir .
".zip")) {
121 if (@is_dir($this->export_dir .
"/" . $this->subdir)) {
125 $expLog->write(
date(
"[y-m-d H:i:s] ") .
"Finished Export");
127 return $this->export_dir .
"/" . $this->subdir .
".zip";
132 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
135 foreach (
$mobs as $mob) {
137 $mob_obj->exportFiles($a_export_dir);
141 foreach ($this->survey_obj->questions as $question_id) {
143 foreach (
$mobs as $mob) {
145 $mob_obj->exportFiles($a_export_dir);
buildExportFileXML()
build xml export file
Export class for surveys.
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
__construct($a_survey_obj, $a_mode="xml")
Constructor public.
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
exportXHTMLMediaObjects($a_export_dir)
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
buildExportFile()
build export file (complete zip file)
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