5 include_once
"./Services/Xml/classes/class.ilXmlWriter.php";
57 parent::__construct();
75 $this->omit_header = $a_val;
98 $this->target_dir_relative = $a_rel;
99 $this->target_dir_absolute = $a_abs;
127 "obj_id" =>
"il_" . IL_INST_ID .
"_file_" . $this->
file->getId(),
128 "version" => $this->
file->getVersion(),
129 "size" => $this->
file->getFileSize(),
130 "type" => $this->
file->getFileType(),
137 $this->
xmlElement(
"Description", null, $this->
file->getDescription());
138 $this->
xmlElement(
"Rating", null, (
int) $this->
file->hasRating());
140 if ($this->attachFileContents) {
144 $attribs =
array(
"mode" =>
"COPY");
145 copy(
$filename, $this->target_dir_absolute .
"/" . $this->
file->getFileName());
146 $content = $this->target_dir_relative .
"/" . $this->
file->getFileName();
147 $this->
xmlElement(
"Content", $attribs, $content);
150 $attribs =
array(
'mode' =>
"REST");
151 include_once
'./Services/WebServices/Rest/classes/class.ilRestFileStorage.php';
153 $tmpname = $fs->storeFileForRest(base64_encode(@file_get_contents(
$filename)));
154 $this->
xmlElement(
"Content", $attribs, $tmpname);
157 $content = @file_get_contents(
$filename);
158 $attribs =
array(
"mode" =>
"PLAIN");
160 $attribs [
"mode"] =
"ZLIB";
161 $content = @gzcompress($content, 9);
163 $attribs [
"mode"] =
"GZIP";
164 $content = @gzencode($content, 9);
166 $content = base64_encode($content);
167 $this->
xmlElement(
"Content", $attribs, $content);
172 include_once(
"./Services/History/classes/class.ilHistory.php");
176 if (count($versions)) {
179 $info_params = $version[
"info_params"];
180 list(
$filename, $history_id) = explode(
",", $info_params);
184 "usr_id" =>
"il_" . IL_INST_ID .
"_usr_" . $version[
"user_id"],
208 $this->
xmlSetDtdDef(
"<!DOCTYPE File PUBLIC \"-//ILIAS//DTD FileAdministration//EN\" \"" . ILIAS_HTTP_PATH .
"/xml/ilias_file_3_8.dtd\">");
xmlStartTag($tag, $attrs=null, $empty=false, $encode=true, $escape=true)
Writes a starttag.
xmlSetGenCmt($genCmt)
Sets generated comment.
setAttachFileContents($attachFileContents)
set attachment content mode
xmlSetDtdDef($dtdDef)
Sets dtd definition.
xmlDumpMem($format=true)
Returns xml document from memory.
setOmitHeader($a_val)
Set omit header.
static $CONTENT_ATTACH_NO
getOmitHeader()
Get omit header.
xmlEndTag($tag)
Writes an endtag.
static date_mysql2time($mysql_date_time)
make time object from mysql_date_time
static $CONTENT_ATTACH_REST
static $CONTENT_ATTACH_GZIP_ENCODED
static $CONTENT_ATTACH_ENCODED
Class to report exception.
xmlHeader()
Writes xml header public.
Reload workbook from saved file
static $CONTENT_ATTACH_COPY
static _getEntriesForObject($a_obj_id, $a_obj_type="")
get all history entries for an object
Create styles array
The data for the language used.
static $ID_DEFLATE_METHOD_MISMATCH
xmlElement($tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
setFileTargetDirectories($a_rel, $a_abs)
Set file target directories.
static $CONTENT_ATTACH_ZLIB_ENCODED