118 $this->obj_id = $a_obj_id;
132 if (!self::$instances[$a_obj_id])
137 return self::$instances[$a_obj_id];
144 $res = $this->db->queryf(
' 145 SELECT * FROM frm_settings 147 array(
'integer'), array($this->obj_id));
149 $row = $this->db->fetchObject(
$res);
153 $this->default_view =
$row->default_view;
154 $this->anonymized =
$row->anonymized ;
155 $this->statistics_enabled =
$row->statistics_enabled ;
156 $this->post_activation_enabled =
$row->post_activation ;
157 $this->admin_force_noti =
$row->admin_force_noti == 1 ? true :
false;
158 $this->user_toggle_noti =
$row->user_toggle_noti == 1 ? true :
false;
159 $this->preset_subject =
$row->preset_subject;
160 $this->add_re_subject =
$row->add_re_subject;
162 $this->notification_type =
$row->notification_type == null ?
'default':
$row->notification_type;
163 $this->mark_mod_posts =
$row->mark_mod_posts == 1 ? true :
false;
164 $this->thread_sorting =
$row->thread_sorting == 1? true :
false;
180 $this->db->insert(
'frm_settings',
181 array(
'obj_id' => array(
'integer', $this->obj_id),
182 'default_view' => array(
'integer', $this->default_view),
183 'anonymized' => array(
'integer', $this->anonymized),
184 'statistics_enabled'=> array(
'integer', $this->statistics_enabled),
185 'post_activation' => array(
'integer', $this->post_activation_enabled),
186 'admin_force_noti' => array(
'integer', $this->admin_force_noti),
187 'user_toggle_noti' => array(
'integer', $this->user_toggle_noti),
188 'preset_subject' => array(
'integer', $this->preset_subject),
189 'add_re_subject' => array(
'integer', $this->add_re_subject),
190 'notification_type' => array(
'text', $this->notification_type),
191 'mark_mod_posts' => array(
'integer', $this->mark_mod_posts),
192 'thread_sorting' => array(
'integer', $this->thread_sorting),
207 $this->db->update(
'frm_settings',
208 array(
'default_view' => array(
'integer', $this->default_view),
209 'anonymized' => array(
'integer', $this->anonymized),
210 'statistics_enabled'=> array(
'integer', $this->statistics_enabled),
211 'post_activation' => array(
'integer', $this->post_activation_enabled),
212 'admin_force_noti' => array(
'integer', $this->admin_force_noti),
213 'user_toggle_noti' => array(
'integer', $this->user_toggle_noti),
214 'preset_subject' => array(
'integer', $this->preset_subject),
215 'add_re_subject' => array(
'integer', $this->add_re_subject),
216 'notification_type' => array(
'text', $this->notification_type),
217 'mark_mod_posts' => array(
'integer', $this->mark_mod_posts),
218 'thread_sorting' => array(
'integer', $this->thread_sorting),
221 array(
'obj_id' => array(
'integer', $this->obj_id))
228 public function copy($a_new_obj_id)
232 $this->db->update(
'frm_settings',
234 'default_view' => array(
'integer', $this->default_view),
235 'anonymized' => array(
'integer', $this->anonymized),
236 'statistics_enabled'=> array(
'integer', $this->statistics_enabled),
237 'post_activation' => array(
'integer', $this->post_activation_enabled),
238 'admin_force_noti' => array(
'integer', $this->admin_force_noti),
239 'user_toggle_noti' => array(
'integer', $this->user_toggle_noti),
240 'preset_subject' => array(
'integer', $this->preset_subject),
241 'add_re_subject' => array(
'integer', $this->add_re_subject),
242 'notification_type' => array(
'text', $this->notification_type),
243 'mark_mod_posts' => array(
'integer', $this->mark_mod_posts),
244 'thread_sorting' => array(
'integer', $this->thread_sorting),
248 'obj_id' => array(
'integer', $a_new_obj_id)
275 $this->default_view = $a_default_view;
283 $this->statistics_enabled = $a_statistic_status;
291 $this->anonymized = $a_anonymized;
301 $result = $ilDB->queryf(
"SELECT anonymized FROM frm_settings WHERE obj_id = %s",
302 array(
'integer'),array($a_obj_id));
304 while($record = $ilDB->fetchAssoc(
$result))
306 return $record[
'anonymized'];
314 $this->post_activation_enabled = $a_post_activation;
322 $this->obj_id = $a_obj_id;
332 $this->admin_force_noti = $a_admin_force;
342 $this->user_toggle_noti = $a_user_toggle;
354 $res = $ilDB->queryF(
"SELECT admin_force_noti FROM frm_settings WHERE obj_id = %s",
357 while($record = $ilDB->fetchAssoc(
$res))
359 return $record[
'admin_force_noti'];
369 $res = $ilDB->queryF(
"SELECT user_toggle_noti FROM frm_settings WHERE obj_id = %s",
372 while($record = $ilDB->fetchAssoc(
$res))
374 return $record[
'user_toggle_noti'];
381 $this->preset_subject = $a_preset_subject;
389 $this->add_re_subject = $a_add_re_subject;
398 if($a_notification_type == null)
399 $this->notification_type =
'default';
401 $this->notification_type = $a_notification_type;
413 return "empty_subject";
417 return "preset_subject";
421 return "add_re_to_subject";
423 else return "preset_subject";
427 if($a_subject_setting ==
'empty_subject')
432 else if($a_subject_setting ==
'preset_subject')
437 else if($a_subject_setting ==
'add_re_to_subject')
446 $this->mark_mod_posts = $a_mod_post;
456 $this->thread_sorting = $a_thread_sorting;
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.
$thread_sorting
sorting type for threads 0 = default 1 = manual
static _isAnonymized($a_obj_id)
static getInstance($a_obj_id=0)
$is_thread_rating_enabled
setIsThreadRatingEnabled($is_thread_rating_enabled)
$add_re_subject
Add 'Re: ' to subject on reply.
static _isUserToggleNoti($a_obj_id)
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.
$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)