ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilForumProperties Class Reference
+ Collaboration diagram for ilForumProperties:

Public Member Functions

 insert ()
 update ()
 copy ($a_new_obj_id)
 isIsThreadRatingEnabled ()
 setIsThreadRatingEnabled ($is_thread_rating_enabled)
 setDefaultView ($a_default_view)
 getDefaultView ()
 setStatisticsStatus ($a_statistic_status)
 isStatisticEnabled ()
 setAnonymisation ($a_anonymized)
 isAnonymized ()
 setPostActivation ($a_post_activation)
 isPostActivationEnabled ()
 setObjId ($a_obj_id=0)
 getObjId ()
 setAdminForceNoti ($a_admin_force)
 isAdminForceNoti ()
 setUserToggleNoti ($a_user_toggle)
 isUserToggleNoti ()
 setPresetSubject ($a_preset_subject)
 getPresetSubject ()
 setAddReSubject ($a_add_re_subject)
 getAddReSubject ()
 setNotificationType ($a_notification_type)
 getNotificationType ()
 getSubjectSetting ()
 setSubjectSetting ($a_subject_setting)
 setMarkModeratorPosts ($a_mod_post)
 getMarkModeratorPosts ()
 setThreadSorting ($a_thread_sorting)
 getThreadSorting ()
 getUserToggleNoti ()
 getAdminForceNoti ()

Static Public Member Functions

static getInstance ($a_obj_id=0)
static _isAnonymized ($a_obj_id)
static _isAdminForceNoti ($a_obj_id)
static _isUserToggleNoti ($a_obj_id)

Data Fields

const VIEW_TREE = 1
const VIEW_DATE = 2
const VIEW_DATE_ASC = 2
const VIEW_DATE_DESC = 3
const FORUM_OVERVIEW_WITH_NEW_POSTS = 0
const FORUM_OVERVIEW_NO_NEW_POSTS = 1

Protected Member Functions

 __construct ($a_obj_id=0)

Private Member Functions

 __clone ()
 read ()

Private Attributes

 $obj_id
 Object id of current forum private.
 $default_view = self::VIEW_TREE
 Default view ( 1 => 'order by answers', 2 => 'order by date ascending', 3 => 'order by date descending') private.
 $anonymized = 0
 Defines if a forum is anonymized or not private.
 $statistics_enabled = 0
 Defines if a forum can show ranking statistics private.
 $post_activation_enabled = 0
 Activation of new posts private.
 $notification_type = null
 Global notification-type setting (CRS/GRP) possible values: 'all_users', 'per_user', null (default)
 $admin_force_noti = false
 Activation of (CRS/GRP) forum notification by mod/admin private.
 $user_toggle_noti = false
 Activation of allowing members to deactivate (CRS/GRP)forum notification private.
 $preset_subject = 1
 Preset subject on reply.
 $add_re_subject = 0
 Add 'Re: ' to subject on reply.
 $mark_mod_posts = 0
 $thread_sorting = 0
 sorting type for threads 0 = default 1 = manual
 $is_thread_rating_enabled = false
 $db = null
 DB Object private.

Static Private Attributes

static $instances = array()

Detailed Description

Author
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de
Version
Id:

Definition at line 10 of file class.ilForumProperties.php.

Constructor & Destructor Documentation

ilForumProperties::__construct (   $a_obj_id = 0)
protected

Definition at line 113 of file class.ilForumProperties.php.

References $ilDB, and read().

{
global $ilDB;
$this->db = $ilDB;
$this->obj_id = $a_obj_id;
$this->read();
}

+ Here is the call graph for this function:

Member Function Documentation

ilForumProperties::__clone ( )
private

Definition at line 122 of file class.ilForumProperties.php.

{
}
static ilForumProperties::_isAdminForceNoti (   $a_obj_id)
static

Definition at line 350 of file class.ilForumProperties.php.

References $ilDB, and $res.

Referenced by ilForumNotification\checkForumsExistsInsert().

{
global $ilDB;
$res = $ilDB->queryF("SELECT admin_force_noti FROM frm_settings WHERE obj_id = %s",
array('integer'),
array($a_obj_id));
while($record = $ilDB->fetchAssoc($res))
{
return $record['admin_force_noti'];
}
return 0;
}

+ Here is the caller graph for this function:

static ilForumProperties::_isAnonymized (   $a_obj_id)
static

Definition at line 297 of file class.ilForumProperties.php.

References $ilDB, and $result.

Referenced by ilPDNewsTableGUI\fillRow().

{
global $ilDB;
$result = $ilDB->queryf("SELECT anonymized FROM frm_settings WHERE obj_id = %s",
array('integer'),array($a_obj_id));
while($record = $ilDB->fetchAssoc($result))
{
return $record['anonymized'];
}
return 0;
}

+ Here is the caller graph for this function:

static ilForumProperties::_isUserToggleNoti (   $a_obj_id)
static

Definition at line 365 of file class.ilForumProperties.php.

References $ilDB, and $res.

Referenced by ilForumNotification\checkForumsExistsInsert().

{
global $ilDB;
$res = $ilDB->queryF("SELECT user_toggle_noti FROM frm_settings WHERE obj_id = %s",
array('integer'),
array($a_obj_id));
while($record = $ilDB->fetchAssoc($res))
{
return $record['user_toggle_noti'];
}
return 0;
}

+ Here is the caller graph for this function:

ilForumProperties::copy (   $a_new_obj_id)

Definition at line 228 of file class.ilForumProperties.php.

References isIsThreadRatingEnabled().

{
if ($a_new_obj_id)
{
$this->db->update('frm_settings',
array(
'default_view' => array('integer', $this->default_view),
'anonymized' => array('integer', $this->anonymized),
'statistics_enabled'=> array('integer', $this->statistics_enabled),
'post_activation' => array('integer', $this->post_activation_enabled),
'admin_force_noti' => array('integer', $this->admin_force_noti),
'user_toggle_noti' => array('integer', $this->user_toggle_noti),
'preset_subject' => array('integer', $this->preset_subject),
'add_re_subject' => array('integer', $this->add_re_subject),
'notification_type' => array('text', $this->notification_type),
'mark_mod_posts' => array('integer', $this->mark_mod_posts),
'thread_sorting' => array('integer', $this->thread_sorting),
'thread_rating' => array('integer', $this->isIsThreadRatingEnabled())
),
array(
'obj_id' => array('integer', $a_new_obj_id)
)
);
return true;
}
return false;
}

+ Here is the call graph for this function:

ilForumProperties::getAddReSubject ( )

Definition at line 391 of file class.ilForumProperties.php.

References $add_re_subject.

Referenced by getSubjectSetting().

{
}

+ Here is the caller graph for this function:

ilForumProperties::getAdminForceNoti ( )
Returns
mixed

Definition at line 474 of file class.ilForumProperties.php.

References $admin_force_noti.

ilForumProperties::getDefaultView ( )

Definition at line 277 of file class.ilForumProperties.php.

References $default_view.

{
}
static ilForumProperties::getInstance (   $a_obj_id = 0)
static
Parameters
int$a_obj_id
Returns
ilForumProperties

Definition at line 130 of file class.ilForumProperties.php.

Referenced by ilForumModeratorsGUI\addModerator(), ilObjForum\create(), ilForumModeratorsGUI\detachModeratorRole(), ilForumTopic\getNestedSetPostChildren(), and ilForumXMLParser\handlerEndTag().

{
if (!self::$instances[$a_obj_id])
{
self::$instances[$a_obj_id] = new ilForumProperties($a_obj_id);
}
return self::$instances[$a_obj_id];
}

+ Here is the caller graph for this function:

ilForumProperties::getMarkModeratorPosts ( )

Definition at line 449 of file class.ilForumProperties.php.

References $mark_mod_posts.

{
}
ilForumProperties::getNotificationType ( )

Definition at line 403 of file class.ilForumProperties.php.

References $notification_type.

ilForumProperties::getObjId ( )

Definition at line 325 of file class.ilForumProperties.php.

References $obj_id.

{
return $this->obj_id;
}
ilForumProperties::getPresetSubject ( )

Definition at line 383 of file class.ilForumProperties.php.

References $preset_subject.

Referenced by getSubjectSetting().

{
}

+ Here is the caller graph for this function:

ilForumProperties::getSubjectSetting ( )

Definition at line 408 of file class.ilForumProperties.php.

References getAddReSubject(), and getPresetSubject().

{
if($this->getPresetSubject() == 0
&& $this->getAddReSubject() == 0)
{
return "empty_subject";
}
else if($this->getPresetSubject() == 1)
{
return "preset_subject";
}
else if($this->getAddReSubject() == 1)
{
return "add_re_to_subject";
}
else return "preset_subject";
}

+ Here is the call graph for this function:

ilForumProperties::getThreadSorting ( )

Definition at line 458 of file class.ilForumProperties.php.

References $thread_sorting.

{
}
ilForumProperties::getUserToggleNoti ( )
Returns
mixed

Definition at line 466 of file class.ilForumProperties.php.

References $user_toggle_noti.

ilForumProperties::insert ( )

Definition at line 176 of file class.ilForumProperties.php.

References isIsThreadRatingEnabled().

{
if ($this->obj_id)
{
$this->db->insert('frm_settings',
array( 'obj_id' => array('integer', $this->obj_id),
'default_view' => array('integer', $this->default_view),
'anonymized' => array('integer', $this->anonymized),
'statistics_enabled'=> array('integer', $this->statistics_enabled),
'post_activation' => array('integer', $this->post_activation_enabled),
'admin_force_noti' => array('integer', $this->admin_force_noti),
'user_toggle_noti' => array('integer', $this->user_toggle_noti),
'preset_subject' => array('integer', $this->preset_subject),
'add_re_subject' => array('integer', $this->add_re_subject),
'notification_type' => array('text', $this->notification_type),
'mark_mod_posts' => array('integer', $this->mark_mod_posts),
'thread_sorting' => array('integer', $this->thread_sorting),
'thread_rating' => array('integer', $this->isIsThreadRatingEnabled())
)
);
return true;
}
return false;
}

+ Here is the call graph for this function:

ilForumProperties::isAdminForceNoti ( )

Definition at line 335 of file class.ilForumProperties.php.

References $admin_force_noti.

ilForumProperties::isAnonymized ( )

Definition at line 293 of file class.ilForumProperties.php.

References $anonymized.

{
}
ilForumProperties::isIsThreadRatingEnabled ( )
Returns
boolean

Definition at line 260 of file class.ilForumProperties.php.

References $is_thread_rating_enabled.

Referenced by copy(), insert(), and update().

+ Here is the caller graph for this function:

ilForumProperties::isPostActivationEnabled ( )

Definition at line 316 of file class.ilForumProperties.php.

References $post_activation_enabled.

ilForumProperties::isStatisticEnabled ( )

Definition at line 285 of file class.ilForumProperties.php.

References $statistics_enabled.

ilForumProperties::isUserToggleNoti ( )

Definition at line 345 of file class.ilForumProperties.php.

References $user_toggle_noti.

ilForumProperties::read ( )
private

Definition at line 140 of file class.ilForumProperties.php.

References $res, $row, and setIsThreadRatingEnabled().

Referenced by __construct(), and setObjId().

{
if ($this->obj_id)
{
$res = $this->db->queryf('
SELECT * FROM frm_settings
WHERE obj_id = %s',
array('integer'), array($this->obj_id));
$row = $this->db->fetchObject($res);
if (is_object($row))
{
$this->default_view = $row->default_view;
$this->anonymized = $row->anonymized ;// == 1 ? true : false;
$this->statistics_enabled = $row->statistics_enabled ;// == 1 ? true : false;
$this->post_activation_enabled = $row->post_activation ;// == 1 ? true : false;
$this->admin_force_noti = $row->admin_force_noti == 1 ? true : false;
$this->user_toggle_noti = $row->user_toggle_noti == 1 ? true : false;
$this->preset_subject = $row->preset_subject;
$this->add_re_subject = $row->add_re_subject;
$this->notification_type = $row->notification_type == null ? 'default': $row->notification_type;
$this->mark_mod_posts = $row->mark_mod_posts == 1 ? true : false;
$this->thread_sorting = $row->thread_sorting == 1? true : false;
$this->setIsThreadRatingEnabled((bool)$row->thread_rating);
return true;
}
return false;
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilForumProperties::setAddReSubject (   $a_add_re_subject)

Definition at line 387 of file class.ilForumProperties.php.

Referenced by setSubjectSetting().

{
$this->add_re_subject = $a_add_re_subject;
}

+ Here is the caller graph for this function:

ilForumProperties::setAdminForceNoti (   $a_admin_force)

Definition at line 330 of file class.ilForumProperties.php.

{
$this->admin_force_noti = $a_admin_force;
}
ilForumProperties::setAnonymisation (   $a_anonymized)

Definition at line 289 of file class.ilForumProperties.php.

{
$this->anonymized = $a_anonymized;
}
ilForumProperties::setDefaultView (   $a_default_view)

Definition at line 273 of file class.ilForumProperties.php.

{
$this->default_view = $a_default_view;
}
ilForumProperties::setIsThreadRatingEnabled (   $is_thread_rating_enabled)
Parameters
boolean$is_thread_rating_enabled

Definition at line 268 of file class.ilForumProperties.php.

References $is_thread_rating_enabled.

Referenced by read().

{
$this->is_thread_rating_enabled = (bool)$is_thread_rating_enabled;
}

+ Here is the caller graph for this function:

ilForumProperties::setMarkModeratorPosts (   $a_mod_post)

Definition at line 444 of file class.ilForumProperties.php.

{
$this->mark_mod_posts = $a_mod_post;
}
ilForumProperties::setNotificationType (   $a_notification_type)

Definition at line 396 of file class.ilForumProperties.php.

{
if($a_notification_type == null)
$this->notification_type = 'default';
else
$this->notification_type = $a_notification_type;
}
ilForumProperties::setObjId (   $a_obj_id = 0)

Definition at line 320 of file class.ilForumProperties.php.

References read().

{
$this->obj_id = $a_obj_id;
$this->read();
}

+ Here is the call graph for this function:

ilForumProperties::setPostActivation (   $a_post_activation)

Definition at line 312 of file class.ilForumProperties.php.

{
$this->post_activation_enabled = $a_post_activation;
}
ilForumProperties::setPresetSubject (   $a_preset_subject)

Definition at line 379 of file class.ilForumProperties.php.

Referenced by setSubjectSetting().

{
$this->preset_subject = $a_preset_subject;
}

+ Here is the caller graph for this function:

ilForumProperties::setStatisticsStatus (   $a_statistic_status)

Definition at line 281 of file class.ilForumProperties.php.

{
$this->statistics_enabled = $a_statistic_status;
}
ilForumProperties::setSubjectSetting (   $a_subject_setting)

Definition at line 425 of file class.ilForumProperties.php.

References setAddReSubject(), and setPresetSubject().

{
if($a_subject_setting == 'empty_subject')
{
$this->setPresetSubject(0);
$this->setAddReSubject(0);
}
else if($a_subject_setting == 'preset_subject')
{
$this->setPresetSubject(1);
$this->setAddReSubject(0);
}
else if($a_subject_setting == 'add_re_to_subject')
{
$this->setPresetSubject(0);
$this->setAddReSubject(1);
}
}

+ Here is the call graph for this function:

ilForumProperties::setThreadSorting (   $a_thread_sorting)

Definition at line 454 of file class.ilForumProperties.php.

{
$this->thread_sorting = $a_thread_sorting;
}
ilForumProperties::setUserToggleNoti (   $a_user_toggle)

Definition at line 340 of file class.ilForumProperties.php.

{
$this->user_toggle_noti = $a_user_toggle;
}
ilForumProperties::update ( )

Definition at line 203 of file class.ilForumProperties.php.

References isIsThreadRatingEnabled().

{
if ($this->obj_id)
{
$this->db->update('frm_settings',
array( 'default_view' => array('integer', $this->default_view),
'anonymized' => array('integer', $this->anonymized),
'statistics_enabled'=> array('integer', $this->statistics_enabled),
'post_activation' => array('integer', $this->post_activation_enabled),
'admin_force_noti' => array('integer', $this->admin_force_noti),
'user_toggle_noti' => array('integer', $this->user_toggle_noti),
'preset_subject' => array('integer', $this->preset_subject),
'add_re_subject' => array('integer', $this->add_re_subject),
'notification_type' => array('text', $this->notification_type),
'mark_mod_posts' => array('integer', $this->mark_mod_posts),
'thread_sorting' => array('integer', $this->thread_sorting),
'thread_rating' => array('integer', $this->isIsThreadRatingEnabled())
),
array( 'obj_id' => array('integer', $this->obj_id))
);
return true;
}
return false;
}

+ Here is the call graph for this function:

Field Documentation

ilForumProperties::$add_re_subject = 0
private

Add 'Re: ' to subject on reply.

private

Definition at line 84 of file class.ilForumProperties.php.

Referenced by getAddReSubject().

ilForumProperties::$admin_force_noti = false
private

Activation of (CRS/GRP) forum notification by mod/admin private.

Definition at line 64 of file class.ilForumProperties.php.

Referenced by getAdminForceNoti(), and isAdminForceNoti().

ilForumProperties::$anonymized = 0
private

Defines if a forum is anonymized or not private.

Definition at line 36 of file class.ilForumProperties.php.

Referenced by isAnonymized().

ilForumProperties::$db = null
private

DB Object private.

Definition at line 106 of file class.ilForumProperties.php.

ilForumProperties::$default_view = self::VIEW_TREE
private

Default view ( 1 => 'order by answers', 2 => 'order by date ascending', 3 => 'order by date descending') private.

Definition at line 30 of file class.ilForumProperties.php.

Referenced by getDefaultView().

ilForumProperties::$instances = array()
staticprivate

Definition at line 111 of file class.ilForumProperties.php.

ilForumProperties::$is_thread_rating_enabled = false
private
ilForumProperties::$mark_mod_posts = 0
private

Definition at line 86 of file class.ilForumProperties.php.

Referenced by getMarkModeratorPosts().

ilForumProperties::$notification_type = null
private

Global notification-type setting (CRS/GRP) possible values: 'all_users', 'per_user', null (default)

private

Definition at line 58 of file class.ilForumProperties.php.

Referenced by getNotificationType().

ilForumProperties::$obj_id
private

Object id of current forum private.

Definition at line 24 of file class.ilForumProperties.php.

Referenced by getObjId().

ilForumProperties::$post_activation_enabled = 0
private

Activation of new posts private.

Definition at line 48 of file class.ilForumProperties.php.

Referenced by isPostActivationEnabled().

ilForumProperties::$preset_subject = 1
private

Preset subject on reply.

If deactivated, user is forced to enter a new subject

private

Definition at line 77 of file class.ilForumProperties.php.

Referenced by getPresetSubject().

ilForumProperties::$statistics_enabled = 0
private

Defines if a forum can show ranking statistics private.

Definition at line 42 of file class.ilForumProperties.php.

Referenced by isStatisticEnabled().

ilForumProperties::$thread_sorting = 0
private

sorting type for threads 0 = default 1 = manual

private

Definition at line 95 of file class.ilForumProperties.php.

Referenced by getThreadSorting().

ilForumProperties::$user_toggle_noti = false
private

Activation of allowing members to deactivate (CRS/GRP)forum notification private.

Definition at line 69 of file class.ilForumProperties.php.

Referenced by getUserToggleNoti(), and isUserToggleNoti().

const ilForumProperties::FORUM_OVERVIEW_NO_NEW_POSTS = 1

Definition at line 18 of file class.ilForumProperties.php.

const ilForumProperties::FORUM_OVERVIEW_WITH_NEW_POSTS = 0

Definition at line 17 of file class.ilForumProperties.php.

const ilForumProperties::VIEW_DATE = 2
const ilForumProperties::VIEW_DATE_ASC = 2
const ilForumProperties::VIEW_DATE_DESC = 3
const ilForumProperties::VIEW_TREE = 1

The documentation for this class was generated from the following file: