32 parent::__construct();
38 $this->forum_id =
$id;
50 $this->target_dir_relative = $a_rel;
51 $this->target_dir_absolute = $a_abs;
57 $ilDB = $DIC->database();
65 ON top_frm_fk = od.obj_id 66 LEFT JOIN frm_settings fs 67 ON fs.obj_id = od.obj_id 68 WHERE od.obj_id = ' .
$ilDB->quote($this->forum_id,
'integer');
84 $this->
xmlElement(
"Statistics", null, (
int)
$row->statistics_enabled);
85 $this->
xmlElement(
"ThreadRatings", null, (
int)
$row->thread_rating);
87 $this->
xmlElement(
"MarkModeratorPosts", null, (
int)
$row->mark_mod_posts);
88 $this->
xmlElement(
"PostingActivation", null, (
int)
$row->post_activation);
89 $this->
xmlElement(
"PresetSubject", null, (
int)
$row->preset_subject);
91 $this->
xmlElement(
"NotificationType", null,
$row->notification_type);
92 $this->
xmlElement(
"ForceNotification", null, (
int)
$row->admin_force_noti);
93 $this->
xmlElement(
"ToggleNotification", null, (
int)
$row->user_toggle_noti);
98 $this->
xmlElement(
"FileUpload", null, (
int)
$row->file_upload_allowed);
103 $query_thr =
"SELECT frm_threads.* " .
104 " FROM frm_threads " .
105 " INNER JOIN frm_data ON top_pk = thr_top_fk " .
106 'WHERE top_frm_fk = ' .
$ilDB->quote($this->forum_id,
'integer');
115 $this->
xmlElement(
"UserId", null, (
int)
$row->thr_display_user_id);
125 $query =
'SELECT frm_posts.*, frm_posts_tree.* 128 ON top_pk = pos_top_fk 129 INNER JOIN frm_posts_tree 131 WHERE pos_thr_fk = ' .
$ilDB->quote(
$row->thr_pk,
'integer') .
' ';
132 $query .=
" ORDER BY frm_posts_tree.lft ASC";
136 while ($rowPost =
$ilDB->fetchObject($resPosts)) {
148 $this->
xmlElement(
"Id", null, (
int) $rowPost->pos_pk);
149 $this->
xmlElement(
"UserId", null, (
int) $rowPost->pos_display_user_id);
150 $this->
xmlElement(
"AuthorId", null, (
int) $rowPost->pos_author_id);
151 $this->
xmlElement(
"Alias", null, $rowPost->pos_usr_alias);
152 $this->
xmlElement(
"Subject", null, $rowPost->pos_subject);
153 $this->
xmlElement(
"CreateDate", null, $rowPost->pos_date);
154 $this->
xmlElement(
"UpdateDate", null, $rowPost->pos_update);
155 $this->
xmlElement(
"UpdateUserId", null, (
int) $rowPost->update_user);
156 $this->
xmlElement(
"Censorship", null, (
int) $rowPost->pos_cens);
157 $this->
xmlElement(
"CensorshipMessage", null, $rowPost->pos_cens_com);
158 $this->
xmlElement(
"Notification", null, $rowPost->notify);
159 $this->
xmlElement(
"ImportName", null, $rowPost->import_name);
160 $this->
xmlElement(
"Status", null, (
int) $rowPost->pos_status);
163 if ($rowPost->is_author_moderator === null) {
164 $is_moderator_string =
'NULL';
166 $is_moderator_string = (string) $rowPost->is_author_moderator;
169 $this->
xmlElement(
"isAuthorModerator", null, $is_moderator_string);
171 $media_exists =
false;
173 foreach (
$mobs as $mob) {
174 $moblabel =
"il_" . IL_INST_ID .
"_mob_" . $mob;
176 if (!$media_exists) {
178 $media_exists =
true;
183 "label" => $moblabel,
184 "uri" => $this->target_dir_relative .
"/objects/" .
"il_" . IL_INST_ID .
"_mob_" . $mob .
"/" . $mob_obj->getTitle()
187 $this->
xmlElement(
"MediaObject", $imgattrs, null);
188 $mob_obj->exportFiles($this->target_dir_absolute);
195 $this->
xmlElement(
"Lft", null, (
int) $rowPost->lft);
196 $this->
xmlElement(
"Rgt", null, (
int) $rowPost->rgt);
197 $this->
xmlElement(
"Depth", null, (
int) $rowPost->depth);
198 $this->
xmlElement(
"ParentId", null, (
int) $rowPost->parent_pos);
206 if (count($tmp_file_obj->getFilesOfPost())) {
207 foreach ($tmp_file_obj->getFilesOfPost() as $file) {
210 copy($file[
'path'], $this->target_dir_absolute .
"/" . basename($file[
'path']));
211 $content = $this->target_dir_relative .
"/" . basename($file[
'path']);
244 return str_replace(
'',
'', $this->
xmlDumpMem(
false));
xmlStartTag($tag, $attrs=null, $empty=false, $encode=true, $escape=true)
Writes a starttag.
xmlDumpMem($format=true)
Returns xml document from memory.
if(!array_key_exists('StateId', $_REQUEST)) $id
static _replaceMediaObjectImageSrc($a_text, $a_direction=0, $nic=IL_INST_ID)
Replaces image source from mob image urls with the mob id or replaces mob id with the correct image s...
xmlEndTag($tag)
Writes an endtag.
foreach($_POST as $key=> $value) $res
setFileTargetDirectories($a_rel, $a_abs)
Set file target directories.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
xmlElement($tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
This class handles all operations on files for the forum object.