128 $this->db = $DIC->database();
129 $this->obj_id = $a_obj_id;
143 if (!self::$instances[$a_obj_id]) {
147 return self::$instances[$a_obj_id];
153 $res = $this->db->queryf(
155 SELECT * FROM frm_settings 161 $row = $this->db->fetchObject(
$res);
163 if (is_object(
$row)) {
164 $this->default_view =
$row->default_view;
165 $this->anonymized =
$row->anonymized ;
166 $this->statistics_enabled =
$row->statistics_enabled ;
167 $this->post_activation_enabled =
$row->post_activation ;
168 $this->admin_force_noti =
$row->admin_force_noti == 1 ? true :
false;
169 $this->user_toggle_noti =
$row->user_toggle_noti == 1 ? true :
false;
170 $this->preset_subject =
$row->preset_subject;
171 $this->add_re_subject =
$row->add_re_subject;
173 $this->notification_type =
$row->notification_type == null ?
'default':
$row->notification_type;
174 $this->mark_mod_posts =
$row->mark_mod_posts == 1 ? true :
false;
175 $this->thread_sorting =
$row->thread_sorting == 1? true :
false;
177 $this->file_upload_allowed =
$row->file_upload_allowed == 1 ? true :
false;
179 $this->exists =
true;
191 if ($this->obj_id && !$this->exists) {
195 'obj_id' => array(
'integer', $this->obj_id),
196 'default_view' => array(
'integer', $this->default_view),
197 'anonymized' => array(
'integer', $this->anonymized),
198 'statistics_enabled' => array(
'integer', $this->statistics_enabled),
199 'post_activation' => array(
'integer', $this->post_activation_enabled),
200 'admin_force_noti' => array(
'integer', $this->admin_force_noti),
201 'user_toggle_noti' => array(
'integer', $this->user_toggle_noti),
202 'preset_subject' => array(
'integer', $this->preset_subject),
203 'add_re_subject' => array(
'integer', $this->add_re_subject),
204 'notification_type' => array(
'text', $this->notification_type),
205 'mark_mod_posts' => array(
'integer', $this->mark_mod_posts),
206 'thread_sorting' => array(
'integer', $this->thread_sorting),
208 'file_upload_allowed' => array(
'integer', $this->file_upload_allowed)
212 $this->exists =
true;
222 if (!$this->exists) {
229 'default_view' => array(
'integer', $this->default_view),
230 'anonymized' => array(
'integer', $this->anonymized),
231 'statistics_enabled' => array(
'integer', $this->statistics_enabled),
232 'post_activation' => array(
'integer', $this->post_activation_enabled),
233 'admin_force_noti' => array(
'integer', $this->admin_force_noti),
234 'user_toggle_noti' => array(
'integer', $this->user_toggle_noti),
235 'preset_subject' => array(
'integer', $this->preset_subject),
236 'add_re_subject' => array(
'integer', $this->add_re_subject),
237 'notification_type' => array(
'text', $this->notification_type),
238 'mark_mod_posts' => array(
'integer', $this->mark_mod_posts),
239 'thread_sorting' => array(
'integer', $this->thread_sorting),
241 'file_upload_allowed' => array(
'integer', $this->file_upload_allowed)
244 'obj_id' => array(
'integer', $this->obj_id)
252 public function copy($a_new_obj_id)
258 'default_view' => array(
'integer', $this->default_view),
259 'anonymized' => array(
'integer', $this->anonymized),
260 'statistics_enabled' => array(
'integer', $this->statistics_enabled),
261 'post_activation' => array(
'integer', $this->post_activation_enabled),
262 'admin_force_noti' => array(
'integer', $this->admin_force_noti),
263 'user_toggle_noti' => array(
'integer', $this->user_toggle_noti),
264 'preset_subject' => array(
'integer', $this->preset_subject),
265 'add_re_subject' => array(
'integer', $this->add_re_subject),
266 'notification_type' => array(
'text', $this->notification_type),
267 'mark_mod_posts' => array(
'integer', $this->mark_mod_posts),
268 'thread_sorting' => array(
'integer', $this->thread_sorting),
270 'file_upload_allowed' => array(
'integer', $this->file_upload_allowed)
273 'obj_id' => array(
'integer', $a_new_obj_id)
300 $this->default_view = $a_default_view;
308 $this->statistics_enabled = $a_statistic_status;
316 $this->anonymized = $a_anonymized;
325 $ilDB = $DIC->database();
328 "SELECT anonymized FROM frm_settings WHERE obj_id = %s",
334 return $record[
'anonymized'];
342 $this->post_activation_enabled = $a_post_activation;
350 $this->obj_id = $a_obj_id;
360 $this->admin_force_noti = $a_admin_force;
370 $this->user_toggle_noti = $a_user_toggle;
381 $ilDB = $DIC->database();
384 "SELECT admin_force_noti FROM frm_settings WHERE obj_id = %s",
388 while ($record =
$ilDB->fetchAssoc(
$res)) {
389 return $record[
'admin_force_noti'];
398 $ilDB = $DIC->database();
401 "SELECT user_toggle_noti FROM frm_settings WHERE obj_id = %s",
405 while ($record =
$ilDB->fetchAssoc(
$res)) {
406 return $record[
'user_toggle_noti'];
413 $this->preset_subject = $a_preset_subject;
421 $this->add_re_subject = $a_add_re_subject;
430 if ($a_notification_type == null) {
431 $this->notification_type =
'default';
433 $this->notification_type = $a_notification_type;
445 return "empty_subject";
447 return "preset_subject";
449 return "add_re_to_subject";
451 return "preset_subject";
456 if ($a_subject_setting ==
'empty_subject') {
459 } elseif ($a_subject_setting ==
'preset_subject') {
462 } elseif ($a_subject_setting ==
'add_re_to_subject') {
470 $this->mark_mod_posts = $a_mod_post;
480 $this->thread_sorting = $a_thread_sorting;
509 $this->file_upload_allowed = $allowed;
525 if (self::isFileUploadGloballyAllowed()) {
542 return $DIC->settings()->get(
'file_upload_allowed_fora', self::FILE_UPLOAD_GLOBALLY_ALLOWED) == self::FILE_UPLOAD_GLOBALLY_ALLOWED;
551 return $DIC->settings()->get(
'send_attachments_by_mail') ==
true ? true :
false;
setThreadSorting($a_thread_sorting)
setPostActivation($a_post_activation)
setUserToggleNoti($a_user_toggle)
$statistics_enabled
Defines if a forum can show ranking statistics private.
setStatisticsStatus($a_statistic_status)
setPresetSubject($a_preset_subject)
setAdminForceNoti($a_admin_force)
setDefaultView($a_default_view)
$user_toggle_noti
Activation of allowing members to deactivate (CRS/GRP)forum notification private.
setAnonymisation($a_anonymized)
$default_view
Default view ( 1 => 'order by answers', 2 => 'order by date ascending', 3 => 'order by date descendin...
$obj_id
Object id of current forum private.
const FORUM_OVERVIEW_NO_NEW_POSTS
$admin_force_noti
Activation of (CRS/GRP) forum notification by mod/admin private.
const FILE_UPLOAD_INDIVIDUAL
$thread_sorting
sorting type for threads (manual sorting) 0 = default 1 = manual
static _isAnonymized($a_obj_id)
static getInstance($a_obj_id=0)
$is_thread_rating_enabled
const FILE_UPLOAD_GLOBALLY_ALLOWED
setIsThreadRatingEnabled($is_thread_rating_enabled)
foreach($_POST as $key=> $value) $res
static isSendAttachmentsByMailEnabled()
$add_re_subject
Add 'Re: ' to subject on reply.
static _isUserToggleNoti($a_obj_id)
setFileUploadAllowed($allowed)
static _isAdminForceNoti($a_obj_id)
setAddReSubject($a_add_re_subject)
isIsThreadRatingEnabled()
const FORUM_OVERVIEW_WITH_NEW_POSTS
setMarkModeratorPosts($a_mod_post)
isPostActivationEnabled()
$post_activation_enabled
Activation of new posts private.
static isFileUploadGloballyAllowed()
$anonymized
Defines if a forum is anonymized or not private.
$preset_subject
Preset subject on reply.
setSubjectSetting($a_subject_setting)
setNotificationType($a_notification_type)
$notification_type
Global notification-type setting (CRS/GRP) possible values: 'all_users', 'per_user', null (default)