120 $this->obj_id = $a_obj_id;
130 if (!self::$instances[$a_obj_id])
135 return self::$instances[$a_obj_id];
142 $res = $this->db->queryf(
' 143 SELECT * FROM frm_settings 145 array(
'integer'), array($this->obj_id));
147 $row = $this->db->fetchObject(
$res);
151 $this->default_view =
$row->default_view;
152 $this->anonymized =
$row->anonymized ;
153 $this->statistics_enabled =
$row->statistics_enabled ;
154 $this->post_activation_enabled =
$row->post_activation ;
155 $this->admin_force_noti =
$row->admin_force_noti == 1 ? true :
false;
156 $this->user_toggle_noti =
$row->user_toggle_noti == 1 ? true :
false;
157 $this->preset_subject =
$row->preset_subject;
158 $this->add_re_subject =
$row->add_re_subject;
160 $this->notification_type =
$row->notification_type == null ?
'default':
$row->notification_type;
161 $this->mark_mod_posts =
$row->mark_mod_posts == 1 ? true :
false;
162 $this->thread_sorting =
$row->thread_sorting == 1? true :
false;
177 $this->db->insert(
'frm_settings',
178 array(
'obj_id' => array(
'integer', $this->obj_id),
179 'default_view' => array(
'integer', $this->default_view),
180 'anonymized' => array(
'integer', $this->anonymized),
181 'statistics_enabled'=> array(
'integer', $this->statistics_enabled),
182 'post_activation' => array(
'integer', $this->post_activation_enabled),
183 'admin_force_noti' => array(
'integer', $this->admin_force_noti),
184 'user_toggle_noti' => array(
'integer', $this->user_toggle_noti),
185 'preset_subject' => array(
'integer', $this->preset_subject),
186 'add_re_subject' => array(
'integer', $this->add_re_subject),
187 'notification_type' => array(
'text', $this->notification_type),
188 'mark_mod_posts' => array(
'integer', $this->mark_mod_posts),
189 'thread_sorting' => array(
'integer', $this->thread_sorting)
203 $this->db->update(
'frm_settings',
204 array(
'default_view' => array(
'integer', $this->default_view),
205 'anonymized' => array(
'integer', $this->anonymized),
206 'statistics_enabled'=> array(
'integer', $this->statistics_enabled),
207 'post_activation' => array(
'integer', $this->post_activation_enabled),
208 'admin_force_noti' => array(
'integer', $this->admin_force_noti),
209 'user_toggle_noti' => array(
'integer', $this->user_toggle_noti),
210 'preset_subject' => array(
'integer', $this->preset_subject),
211 'add_re_subject' => array(
'integer', $this->add_re_subject),
212 'notification_type' => array(
'text', $this->notification_type),
213 'mark_mod_posts' => array(
'integer', $this->mark_mod_posts),
214 'thread_sorting' => array(
'integer', $this->thread_sorting)
216 array(
'obj_id' => array(
'integer', $this->obj_id))
223 public function copy($a_new_obj_id)
227 $this->db->insert(
'frm_settings',
228 array(
'obj_id' => array(
'integer', $a_new_obj_id),
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)
250 $this->default_view = $a_default_view;
258 $this->statistics_enabled = $a_statistic_status;
266 $this->anonymized = $a_anonymized;
276 $result = $ilDB->queryf(
"SELECT anonymized FROM frm_settings WHERE obj_id = %s",
277 array(
'integer'),array($a_obj_id));
279 while($record = $ilDB->fetchAssoc(
$result))
281 return $record[
'anonymized'];
289 $this->post_activation_enabled = $a_post_activation;
297 $this->obj_id = $a_obj_id;
307 $this->admin_force_noti = $a_admin_force;
317 $this->user_toggle_noti = $a_user_toggle;
329 $res = $ilDB->queryF(
"SELECT admin_force_noti FROM frm_settings WHERE obj_id = %s",
332 while($record = $ilDB->fetchAssoc(
$res))
334 return $record[
'admin_force_noti'];
344 $res = $ilDB->queryF(
"SELECT user_toggle_noti FROM frm_settings WHERE obj_id = %s",
347 while($record = $ilDB->fetchAssoc(
$res))
349 return $record[
'user_toggle_noti'];
356 if(null === $a_allow_rating)
361 $this->thread_ratings_allowed = $a_allow_rating;
368 $this->preset_subject = $a_preset_subject;
376 $this->add_re_subject = $a_add_re_subject;
385 if($a_notification_type == null)
386 $this->notification_type =
'default';
388 $this->notification_type = $a_notification_type;
400 return "empty_subject";
404 return "preset_subject";
408 return "add_re_to_subject";
410 else return "preset_subject";
414 if($a_subject_setting ==
'empty_subject')
419 else if($a_subject_setting ==
'preset_subject')
424 else if($a_subject_setting ==
'add_re_to_subject')
433 $this->mark_mod_posts = $a_mod_post;
443 $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)
$add_re_subject
Add 'Re: ' to subject on reply.
static _isUserToggleNoti($a_obj_id)
static _isAdminForceNoti($a_obj_id)
setAddReSubject($a_add_re_subject)
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)
isThreadRatingAllowed($a_allow_rating=null)
$notification_type
Global notification-type setting (CRS/GRP) possible values: 'all_users', 'per_user', null (default)