49 $this->survey_obj = $a_survey_obj;
52 $this->mode = $a_mode;
53 $this->inst_id = IL_INST_ID;
59 $this->export_dir = $this->survey_obj->getExportDirectory();
60 $this->subdir = $date.
"__".$this->inst_id.
"__".
61 "svy".
"_".$this->survey_obj->getId();
62 $this->filename = $this->subdir.
".xml";
96 $ilBench->start(
"SurveyExport",
"buildExportFile");
99 $this->survey_obj->createExportDirectory();
104 $expDir = $this->survey_obj->getExportDirectory();
105 include_once
"./Services/Logging/classes/class.ilLog.php";
106 $expLog =
new ilLog($expDir,
"export.log");
108 $expLog->setLogFormat(
"");
109 $expLog->write(
date(
"[y-m-d H:i:s] ").
"Start Export");
112 $xmlFile = fopen($this->export_dir.
"/".$this->subdir.
"/".$this->filename,
"w");
113 fwrite($xmlFile, $this->survey_obj->toXML());
120 $ilBench->start(
"SurveyExport",
"buildExportFileXML_zipFile");
121 ilUtil::zip($this->export_dir.
"/".$this->subdir, $this->export_dir.
"/".$this->subdir.
".zip");
122 $ilBench->stop(
"SurveyExport",
"buildExportFileXML_zipFile");
124 if (@file_exists($this->export_dir.
"/".$this->subdir.
".zip"))
127 if (@is_dir($this->export_dir.
"/".$this->subdir))
132 $expLog->write(
date(
"[y-m-d H:i:s] ").
"Finished Export");
133 $ilBench->stop(
"SurveyExport",
"buildExportFile");
135 return $this->export_dir.
"/".$this->subdir.
".zip";
141 $ilBench->start(
"SurveyExport",
"exportXHTMLMediaObjects");
142 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
145 foreach (
$mobs as $mob)
148 $mob_obj->exportFiles($a_export_dir);
152 foreach ($this->survey_obj->questions as $question_id)
155 foreach (
$mobs as $mob)
158 $mob_obj->exportFiles($a_export_dir);
162 $ilBench->stop(
"SurveyExport",
"exportXHTMLMediaObjects");
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