126 $this->obj_id = $a_obj_id;
140 if (!self::$instances[$a_obj_id])
145 return self::$instances[$a_obj_id];
152 $res = $this->db->queryf(
' 153 SELECT * FROM frm_settings 157 $row = $this->db->fetchObject(
$res);
161 $this->default_view =
$row->default_view;
162 $this->anonymized =
$row->anonymized ;
163 $this->statistics_enabled =
$row->statistics_enabled ;
164 $this->post_activation_enabled =
$row->post_activation ;
165 $this->admin_force_noti =
$row->admin_force_noti == 1 ? true :
false;
166 $this->user_toggle_noti =
$row->user_toggle_noti == 1 ? true :
false;
167 $this->preset_subject =
$row->preset_subject;
168 $this->add_re_subject =
$row->add_re_subject;
170 $this->notification_type =
$row->notification_type == null ?
'default':
$row->notification_type;
171 $this->mark_mod_posts =
$row->mark_mod_posts == 1 ? true :
false;
172 $this->thread_sorting =
$row->thread_sorting == 1? true :
false;
174 $this->file_upload_allowed =
$row->file_upload_allowed == 1 ? true :
false;
189 $this->db->insert(
'frm_settings',
191 'obj_id' =>
array(
'integer', $this->obj_id),
192 'default_view' =>
array(
'integer', $this->default_view),
193 'anonymized' =>
array(
'integer', $this->anonymized),
194 'statistics_enabled' =>
array(
'integer', $this->statistics_enabled),
195 'post_activation' =>
array(
'integer', $this->post_activation_enabled),
196 'admin_force_noti' =>
array(
'integer', $this->admin_force_noti),
197 'user_toggle_noti' =>
array(
'integer', $this->user_toggle_noti),
198 'preset_subject' =>
array(
'integer', $this->preset_subject),
199 'add_re_subject' =>
array(
'integer', $this->add_re_subject),
200 'notification_type' =>
array(
'text', $this->notification_type),
201 'mark_mod_posts' =>
array(
'integer', $this->mark_mod_posts),
202 'thread_sorting' =>
array(
'integer', $this->thread_sorting),
204 'file_upload_allowed' =>
array(
'integer', $this->file_upload_allowed)
218 $this->db->update(
'frm_settings',
220 'default_view' =>
array(
'integer', $this->default_view),
221 'anonymized' =>
array(
'integer', $this->anonymized),
222 'statistics_enabled' =>
array(
'integer', $this->statistics_enabled),
223 'post_activation' =>
array(
'integer', $this->post_activation_enabled),
224 'admin_force_noti' =>
array(
'integer', $this->admin_force_noti),
225 'user_toggle_noti' =>
array(
'integer', $this->user_toggle_noti),
226 'preset_subject' =>
array(
'integer', $this->preset_subject),
227 'add_re_subject' =>
array(
'integer', $this->add_re_subject),
228 'notification_type' =>
array(
'text', $this->notification_type),
229 'mark_mod_posts' =>
array(
'integer', $this->mark_mod_posts),
230 'thread_sorting' =>
array(
'integer', $this->thread_sorting),
232 'file_upload_allowed' =>
array(
'integer', $this->file_upload_allowed)
235 'obj_id' =>
array(
'integer', $this->obj_id)
243 public function copy($a_new_obj_id)
247 $this->db->update(
'frm_settings',
249 'default_view' =>
array(
'integer', $this->default_view),
250 'anonymized' =>
array(
'integer', $this->anonymized),
251 'statistics_enabled' =>
array(
'integer', $this->statistics_enabled),
252 'post_activation' =>
array(
'integer', $this->post_activation_enabled),
253 'admin_force_noti' =>
array(
'integer', $this->admin_force_noti),
254 'user_toggle_noti' =>
array(
'integer', $this->user_toggle_noti),
255 'preset_subject' =>
array(
'integer', $this->preset_subject),
256 'add_re_subject' =>
array(
'integer', $this->add_re_subject),
257 'notification_type' =>
array(
'text', $this->notification_type),
258 'mark_mod_posts' =>
array(
'integer', $this->mark_mod_posts),
259 'thread_sorting' =>
array(
'integer', $this->thread_sorting),
261 'file_upload_allowed' =>
array(
'integer', $this->file_upload_allowed)
264 'obj_id' =>
array(
'integer', $a_new_obj_id)
291 $this->default_view = $a_default_view;
299 $this->statistics_enabled = $a_statistic_status;
307 $this->anonymized = $a_anonymized;
317 $result = $ilDB->queryf(
"SELECT anonymized FROM frm_settings WHERE obj_id = %s",
320 while($record = $ilDB->fetchAssoc(
$result))
322 return $record[
'anonymized'];
330 $this->post_activation_enabled = $a_post_activation;
338 $this->obj_id = $a_obj_id;
348 $this->admin_force_noti = $a_admin_force;
358 $this->user_toggle_noti = $a_user_toggle;
370 $res = $ilDB->queryF(
"SELECT admin_force_noti FROM frm_settings WHERE obj_id = %s",
373 while($record = $ilDB->fetchAssoc(
$res))
375 return $record[
'admin_force_noti'];
385 $res = $ilDB->queryF(
"SELECT user_toggle_noti FROM frm_settings WHERE obj_id = %s",
388 while($record = $ilDB->fetchAssoc(
$res))
390 return $record[
'user_toggle_noti'];
397 $this->preset_subject = $a_preset_subject;
405 $this->add_re_subject = $a_add_re_subject;
414 if($a_notification_type == null)
415 $this->notification_type =
'default';
417 $this->notification_type = $a_notification_type;
429 return "empty_subject";
433 return "preset_subject";
437 return "add_re_to_subject";
439 else return "preset_subject";
443 if($a_subject_setting ==
'empty_subject')
448 else if($a_subject_setting ==
'preset_subject')
453 else if($a_subject_setting ==
'add_re_to_subject')
462 $this->mark_mod_posts = $a_mod_post;
472 $this->thread_sorting = $a_thread_sorting;
501 $this->file_upload_allowed = $allowed;
517 if(self::isFileUploadGloballyAllowed())
533 public static function isFileUploadGloballyAllowed()
540 return $ilSetting->get(
'file_upload_allowed_fora', self::FILE_UPLOAD_GLOBALLY_ALLOWED) == self::FILE_UPLOAD_GLOBALLY_ALLOWED;
546 public static function isSendAttachmentsByMailEnabled()
553 return $ilSetting->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)
$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)
Create styles array
The data for the language used.
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)