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

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

◆ __construct()

ilForumProperties::__construct (   $a_obj_id = 0)
protected

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

114 {
115 global $ilDB;
116
117 $this->db = $ilDB;
118 $this->obj_id = $a_obj_id;
119 $this->read();
120 }
global $ilDB

References $ilDB, and read().

+ Here is the call graph for this function:

Member Function Documentation

◆ __clone()

ilForumProperties::__clone ( )
private

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

123 {
124 }

◆ _isAdminForceNoti()

static ilForumProperties::_isAdminForceNoti (   $a_obj_id)
static

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

351 {
352 global $ilDB;
353
354 $res = $ilDB->queryF("SELECT admin_force_noti FROM frm_settings WHERE obj_id = %s",
355 array('integer'),
356 array($a_obj_id));
357 while($record = $ilDB->fetchAssoc($res))
358 {
359 return $record['admin_force_noti'];
360 }
361
362 return 0;
363 }

References $ilDB, and $res.

Referenced by ilForumNotification\checkForumsExistsInsert().

+ Here is the caller graph for this function:

◆ _isAnonymized()

static ilForumProperties::_isAnonymized (   $a_obj_id)
static

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

298 {
299 global $ilDB;
300
301 $result = $ilDB->queryf("SELECT anonymized FROM frm_settings WHERE obj_id = %s",
302 array('integer'),array($a_obj_id));
303
304 while($record = $ilDB->fetchAssoc($result))
305 {
306 return $record['anonymized'];
307 }
308
309 return 0;
310 }
$result

References $ilDB, and $result.

Referenced by ilPDNewsTableGUI\fillRow().

+ Here is the caller graph for this function:

◆ _isUserToggleNoti()

static ilForumProperties::_isUserToggleNoti (   $a_obj_id)
static

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

366 {
367 global $ilDB;
368
369 $res = $ilDB->queryF("SELECT user_toggle_noti FROM frm_settings WHERE obj_id = %s",
370 array('integer'),
371 array($a_obj_id));
372 while($record = $ilDB->fetchAssoc($res))
373 {
374 return $record['user_toggle_noti'];
375 }
376 return 0;
377 }

References $ilDB, and $res.

Referenced by ilForumNotification\checkForumsExistsInsert().

+ Here is the caller graph for this function:

◆ copy()

ilForumProperties::copy (   $a_new_obj_id)

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

229 {
230 if ($a_new_obj_id)
231 {
232 $this->db->update('frm_settings',
233 array(
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),
245 'thread_rating' => array('integer', $this->isIsThreadRatingEnabled())
246 ),
247 array(
248 'obj_id' => array('integer', $a_new_obj_id)
249 )
250 );
251 return true;
252 }
253
254 return false;
255 }

References isIsThreadRatingEnabled().

+ Here is the call graph for this function:

◆ getAddReSubject()

ilForumProperties::getAddReSubject ( )

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

392 {
394 }
$add_re_subject
Add 'Re: ' to subject on reply.

References $add_re_subject.

Referenced by getSubjectSetting().

+ Here is the caller graph for this function:

◆ getAdminForceNoti()

ilForumProperties::getAdminForceNoti ( )
Returns
mixed

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

475 {
477 }
$admin_force_noti
Activation of (CRS/GRP) forum notification by mod/admin @access private.

References $admin_force_noti.

◆ getDefaultView()

ilForumProperties::getDefaultView ( )

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

278 {
279 return $this->default_view;
280 }
$default_view
Default view ( 1 => 'order by answers', 2 => 'order by date ascending', 3 => 'order by date descendin...

References $default_view.

◆ getInstance()

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

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

131 {
132 if (!self::$instances[$a_obj_id])
133 {
134 self::$instances[$a_obj_id] = new ilForumProperties($a_obj_id);
135 }
136
137 return self::$instances[$a_obj_id];
138 }

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

+ Here is the caller graph for this function:

◆ getMarkModeratorPosts()

ilForumProperties::getMarkModeratorPosts ( )

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

References $mark_mod_posts.

◆ getNotificationType()

ilForumProperties::getNotificationType ( )

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

404 {
406 }
$notification_type
Global notification-type setting (CRS/GRP) possible values: 'all_users', 'per_user',...

References $notification_type.

◆ getObjId()

ilForumProperties::getObjId ( )

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

326 {
327 return $this->obj_id;
328 }
$obj_id
Object id of current forum @access private.

References $obj_id.

◆ getPresetSubject()

ilForumProperties::getPresetSubject ( )

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

384 {
386 }
$preset_subject
Preset subject on reply.

References $preset_subject.

Referenced by getSubjectSetting().

+ Here is the caller graph for this function:

◆ getSubjectSetting()

ilForumProperties::getSubjectSetting ( )

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

409 {
410 if($this->getPresetSubject() == 0
411 && $this->getAddReSubject() == 0)
412 {
413 return "empty_subject";
414 }
415 else if($this->getPresetSubject() == 1)
416 {
417 return "preset_subject";
418 }
419 else if($this->getAddReSubject() == 1)
420 {
421 return "add_re_to_subject";
422 }
423 else return "preset_subject";
424 }

References getAddReSubject(), and getPresetSubject().

+ Here is the call graph for this function:

◆ getThreadSorting()

ilForumProperties::getThreadSorting ( )

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

459 {
461 }
$thread_sorting
sorting type for threads 0 = default 1 = manual

References $thread_sorting.

◆ getUserToggleNoti()

ilForumProperties::getUserToggleNoti ( )
Returns
mixed

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

467 {
469 }
$user_toggle_noti
Activation of allowing members to deactivate (CRS/GRP)forum notification @access private.

References $user_toggle_noti.

◆ insert()

ilForumProperties::insert ( )

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

177 {
178 if ($this->obj_id)
179 {
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),
193 'thread_rating' => array('integer', $this->isIsThreadRatingEnabled())
194 )
195 );
196
197 return true;
198 }
199
200 return false;
201 }

References isIsThreadRatingEnabled().

+ Here is the call graph for this function:

◆ isAdminForceNoti()

ilForumProperties::isAdminForceNoti ( )

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

336 {
338 }

References $admin_force_noti.

◆ isAnonymized()

ilForumProperties::isAnonymized ( )

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

294 {
295 return $this->anonymized;
296 }
$anonymized
Defines if a forum is anonymized or not @access private.

References $anonymized.

◆ isIsThreadRatingEnabled()

ilForumProperties::isIsThreadRatingEnabled ( )
Returns
boolean

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

261 {
263 }

References $is_thread_rating_enabled.

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

+ Here is the caller graph for this function:

◆ isPostActivationEnabled()

ilForumProperties::isPostActivationEnabled ( )

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

317 {
319 }
$post_activation_enabled
Activation of new posts @access private.

References $post_activation_enabled.

◆ isStatisticEnabled()

ilForumProperties::isStatisticEnabled ( )

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

286 {
288 }
$statistics_enabled
Defines if a forum can show ranking statistics @access private.

References $statistics_enabled.

◆ isUserToggleNoti()

ilForumProperties::isUserToggleNoti ( )

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

346 {
348 }

References $user_toggle_noti.

◆ read()

ilForumProperties::read ( )
private

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

141 {
142 if ($this->obj_id)
143 {
144 $res = $this->db->queryf('
145 SELECT * FROM frm_settings
146 WHERE obj_id = %s',
147 array('integer'), array($this->obj_id));
148
149 $row = $this->db->fetchObject($res);
150
151 if (is_object($row))
152 {
153 $this->default_view = $row->default_view;
154 $this->anonymized = $row->anonymized ;// == 1 ? true : false;
155 $this->statistics_enabled = $row->statistics_enabled ;// == 1 ? true : false;
156 $this->post_activation_enabled = $row->post_activation ;// == 1 ? true : false;
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;
161
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;
165 $this->setIsThreadRatingEnabled((bool)$row->thread_rating);
166
167 return true;
168 }
169
170 return false;
171 }
172
173 return false;
174 }
setIsThreadRatingEnabled($is_thread_rating_enabled)

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

Referenced by __construct(), and setObjId().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAddReSubject()

ilForumProperties::setAddReSubject (   $a_add_re_subject)

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

388 {
389 $this->add_re_subject = $a_add_re_subject;
390 }

Referenced by setSubjectSetting().

+ Here is the caller graph for this function:

◆ setAdminForceNoti()

ilForumProperties::setAdminForceNoti (   $a_admin_force)

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

331 {
332 $this->admin_force_noti = $a_admin_force;
333 }

◆ setAnonymisation()

ilForumProperties::setAnonymisation (   $a_anonymized)

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

290 {
291 $this->anonymized = $a_anonymized;
292 }

◆ setDefaultView()

ilForumProperties::setDefaultView (   $a_default_view)

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

274 {
275 $this->default_view = $a_default_view;
276 }

◆ setIsThreadRatingEnabled()

ilForumProperties::setIsThreadRatingEnabled (   $is_thread_rating_enabled)
Parameters
boolean$is_thread_rating_enabled

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

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

References $is_thread_rating_enabled.

Referenced by read().

+ Here is the caller graph for this function:

◆ setMarkModeratorPosts()

ilForumProperties::setMarkModeratorPosts (   $a_mod_post)

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

445 {
446 $this->mark_mod_posts = $a_mod_post;
447 }

◆ setNotificationType()

ilForumProperties::setNotificationType (   $a_notification_type)

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

397 {
398 if($a_notification_type == null)
399 $this->notification_type = 'default';
400 else
401 $this->notification_type = $a_notification_type;
402 }

◆ setObjId()

ilForumProperties::setObjId (   $a_obj_id = 0)

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

321 {
322 $this->obj_id = $a_obj_id;
323 $this->read();
324 }

References read().

+ Here is the call graph for this function:

◆ setPostActivation()

ilForumProperties::setPostActivation (   $a_post_activation)

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

313 {
314 $this->post_activation_enabled = $a_post_activation;
315 }

◆ setPresetSubject()

ilForumProperties::setPresetSubject (   $a_preset_subject)

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

380 {
381 $this->preset_subject = $a_preset_subject;
382 }

Referenced by setSubjectSetting().

+ Here is the caller graph for this function:

◆ setStatisticsStatus()

ilForumProperties::setStatisticsStatus (   $a_statistic_status)

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

282 {
283 $this->statistics_enabled = $a_statistic_status;
284 }

◆ setSubjectSetting()

ilForumProperties::setSubjectSetting (   $a_subject_setting)

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

426 {
427 if($a_subject_setting == 'empty_subject')
428 {
429 $this->setPresetSubject(0);
430 $this->setAddReSubject(0);
431 }
432 else if($a_subject_setting == 'preset_subject')
433 {
434 $this->setPresetSubject(1);
435 $this->setAddReSubject(0);
436 }
437 else if($a_subject_setting == 'add_re_to_subject')
438 {
439 $this->setPresetSubject(0);
440 $this->setAddReSubject(1);
441 }
442 }
setPresetSubject($a_preset_subject)
setAddReSubject($a_add_re_subject)

References setAddReSubject(), and setPresetSubject().

+ Here is the call graph for this function:

◆ setThreadSorting()

ilForumProperties::setThreadSorting (   $a_thread_sorting)

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

455 {
456 $this->thread_sorting = $a_thread_sorting;
457 }

◆ setUserToggleNoti()

ilForumProperties::setUserToggleNoti (   $a_user_toggle)

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

341 {
342 $this->user_toggle_noti = $a_user_toggle;
343 }

◆ update()

ilForumProperties::update ( )

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

204 {
205 if ($this->obj_id)
206 {
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),
219 'thread_rating' => array('integer', $this->isIsThreadRatingEnabled())
220 ),
221 array( 'obj_id' => array('integer', $this->obj_id))
222 );
223 return true;
224 }
225 return false;
226 }

References isIsThreadRatingEnabled().

+ Here is the call graph for this function:

Field Documentation

◆ $add_re_subject

ilForumProperties::$add_re_subject = 0
private

Add 'Re: ' to subject on reply.

@access private

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

Referenced by getAddReSubject().

◆ $admin_force_noti

ilForumProperties::$admin_force_noti = false
private

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

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

Referenced by getAdminForceNoti(), and isAdminForceNoti().

◆ $anonymized

ilForumProperties::$anonymized = 0
private

Defines if a forum is anonymized or not @access private.

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

Referenced by isAnonymized().

◆ $db

ilForumProperties::$db = null
private

DB Object @access private.

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

◆ $default_view

ilForumProperties::$default_view = self::VIEW_TREE
private

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

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

Referenced by getDefaultView().

◆ $instances

ilForumProperties::$instances = array()
staticprivate

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

◆ $is_thread_rating_enabled

ilForumProperties::$is_thread_rating_enabled = false
private

◆ $mark_mod_posts

ilForumProperties::$mark_mod_posts = 0
private

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

Referenced by getMarkModeratorPosts().

◆ $notification_type

ilForumProperties::$notification_type = null
private

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

@access private

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

Referenced by getNotificationType().

◆ $obj_id

ilForumProperties::$obj_id
private

Object id of current forum @access private.

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

Referenced by getObjId().

◆ $post_activation_enabled

ilForumProperties::$post_activation_enabled = 0
private

Activation of new posts @access private.

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

Referenced by isPostActivationEnabled().

◆ $preset_subject

ilForumProperties::$preset_subject = 1
private

Preset subject on reply.

If deactivated, user is forced to enter a new subject

@access private

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

Referenced by getPresetSubject().

◆ $statistics_enabled

ilForumProperties::$statistics_enabled = 0
private

Defines if a forum can show ranking statistics @access private.

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

Referenced by isStatisticEnabled().

◆ $thread_sorting

ilForumProperties::$thread_sorting = 0
private

sorting type for threads 0 = default 1 = manual

@access private

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

Referenced by getThreadSorting().

◆ $user_toggle_noti

ilForumProperties::$user_toggle_noti = false
private

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

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

Referenced by getUserToggleNoti(), and isUserToggleNoti().

◆ FORUM_OVERVIEW_NO_NEW_POSTS

const ilForumProperties::FORUM_OVERVIEW_NO_NEW_POSTS = 1

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

◆ FORUM_OVERVIEW_WITH_NEW_POSTS

const ilForumProperties::FORUM_OVERVIEW_WITH_NEW_POSTS = 0

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

◆ VIEW_DATE

const ilForumProperties::VIEW_DATE = 2

◆ VIEW_DATE_ASC

const ilForumProperties::VIEW_DATE_ASC = 2

◆ VIEW_DATE_DESC

const ilForumProperties::VIEW_DATE_DESC = 3

◆ VIEW_TREE

const ilForumProperties::VIEW_TREE = 1

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