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;
 
  310        $this->statistics_enabled = $a_statistic_status;
 
  320        $this->anonymized = $a_anonymized;
 
  334            "SELECT anonymized FROM frm_settings WHERE obj_id = %s",
 
  340            return $record[
'anonymized'];
 
  348        $this->post_activation_enabled = $a_post_activation;
 
  358        $this->obj_id = $a_obj_id;
 
  369        $this->admin_force_noti = $a_admin_force;
 
  379        $this->user_toggle_noti = $a_user_toggle;
 
  393            "SELECT admin_force_noti FROM frm_settings WHERE obj_id = %s",
 
  397        while ($record = 
$ilDB->fetchAssoc(
$res)) {
 
  398            return $record[
'admin_force_noti'];
 
  410            "SELECT user_toggle_noti FROM frm_settings WHERE obj_id = %s",
 
  414        while ($record = 
$ilDB->fetchAssoc(
$res)) {
 
  415            return $record[
'user_toggle_noti'];
 
  422        $this->preset_subject = $a_preset_subject;
 
  432        $this->add_re_subject = $a_add_re_subject;
 
  442        if ($a_notification_type == 
null) {
 
  443            $this->notification_type = 
'default';
 
  445            $this->notification_type = $a_notification_type;
 
  458            return "empty_subject";
 
  461                return "preset_subject";
 
  464                    return "add_re_to_subject";
 
  466                    return "preset_subject";
 
  474        if ($a_subject_setting == 
'empty_subject') {
 
  478            if ($a_subject_setting == 
'preset_subject') {
 
  482                if ($a_subject_setting == 
'add_re_to_subject') {
 
  492        $this->mark_mod_posts = $a_mod_post;
 
  502        $this->thread_sorting = $a_thread_sorting;
 
  532        $this->file_upload_allowed = $allowed;
 
  548        if (self::isFileUploadGloballyAllowed()) {
 
  565        return $DIC->settings()->get(
 
  566            'file_upload_allowed_fora',
 
  567            self::FILE_UPLOAD_GLOBALLY_ALLOWED
 
  577        return $DIC->settings()->get(
'send_attachments_by_mail') == 
true ? true : 
false;
 
An exception for terminatinating execution or to throw for unit testing.
$anonymized
Defines if a forum is anonymized or not @access private.
static _isUserToggleNoti($a_obj_id)
setMarkModeratorPosts($a_mod_post)
const FILE_UPLOAD_INDIVIDUAL
setSubjectSetting($a_subject_setting)
setPostActivation($a_post_activation)
$admin_force_noti
Activation of (CRS/GRP) forum notification by mod/admin @access private.
const FORUM_OVERVIEW_WITH_NEW_POSTS
$post_activation_enabled
Activation of new posts @access private.
static isSendAttachmentsByMailEnabled()
setAnonymisation($a_anonymized)
$obj_id
Object id of current forum @access private.
setUserToggleNoti($a_user_toggle)
$db
DB Object @access private.
$preset_subject
Preset subject on reply.
isPostActivationEnabled()
setPresetSubject($a_preset_subject)
$add_re_subject
Add 'Re: ' to subject on reply.
$thread_sorting
sorting type for threads (manual sorting) 0 = default 1 = manual
const FORUM_OVERVIEW_NO_NEW_POSTS
setNotificationType($a_notification_type)
const FILE_UPLOAD_GLOBALLY_ALLOWED
static _isAdminForceNoti($a_obj_id)
setAddReSubject($a_add_re_subject)
static _isAnonymized($a_obj_id)
setIsThreadRatingEnabled($is_thread_rating_enabled)
setStatisticsStatus($a_statistic_status)
$user_toggle_noti
Activation of allowing members to deactivate (CRS/GRP)forum notification @access private.
setAdminForceNoti($a_admin_force)
$statistics_enabled
Defines if a forum can show ranking statistics @access private.
setThreadSorting($a_thread_sorting)
static getInstance($a_obj_id=0)
static isFileUploadGloballyAllowed()
$notification_type
Global notification-type setting (CRS/GRP) possible values: 'all_users', 'per_user',...
$is_thread_rating_enabled
isIsThreadRatingEnabled()
setFileUploadAllowed($allowed)
$default_view
Default view ( 1 => 'order by answers', 2 => 'order by date ascending', 3 => 'order by date descendin...
setDefaultView($a_default_view)
foreach($_POST as $key=> $value) $res