ILIAS  release_4-4 Revision
ilForumProperties Class Reference
+ Collaboration diagram for ilForumProperties:

Public Member Functions

 insert ()
 
 update ()
 
 copy ($a_new_obj_id)
 
 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 ()
 
 isThreadRatingAllowed ($a_allow_rating=null)
 
 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. More...
 
 $default_view = self::VIEW_TREE
 Default view ( 1 => 'order by answers', 2 => 'order by date ascending', 3 => 'order by date descending') private. More...
 
 $anonymized = 0
 Defines if a forum is anonymized or not private. More...
 
 $statistics_enabled = 0
 Defines if a forum can show ranking statistics private. More...
 
 $post_activation_enabled = 0
 Activation of new posts 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 private. More...
 
 $user_toggle_noti = false
 Activation of allowing members to deactivate (CRS/GRP)forum notification private. More...
 
 $thread_ratings_allowed = false
 
 $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...
 
 $db = null
 DB Object 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 115 of file class.ilForumProperties.php.

References read().

116  {
117  global $ilDB;
118 
119  $this->db = $ilDB;
120  $this->obj_id = $a_obj_id;
121  $this->read();
122  }
+ Here is the call graph for this function:

Member Function Documentation

◆ __clone()

ilForumProperties::__clone ( )
private

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

125  {
126  }

◆ _isAdminForceNoti()

static ilForumProperties::_isAdminForceNoti (   $a_obj_id)
static

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

References $res.

Referenced by ilForumNotification\checkForumsExistsInsert().

326  {
327  global $ilDB;
328 
329  $res = $ilDB->queryF("SELECT admin_force_noti FROM frm_settings WHERE obj_id = %s",
330  array('integer'),
331  array($a_obj_id));
332  while($record = $ilDB->fetchAssoc($res))
333  {
334  return $record['admin_force_noti'];
335  }
336 
337  return 0;
338  }
+ Here is the caller graph for this function:

◆ _isAnonymized()

static ilForumProperties::_isAnonymized (   $a_obj_id)
static

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

References $result.

Referenced by ilPDNewsTableGUI\fillRow().

273  {
274  global $ilDB;
275 
276  $result = $ilDB->queryf("SELECT anonymized FROM frm_settings WHERE obj_id = %s",
277  array('integer'),array($a_obj_id));
278 
279  while($record = $ilDB->fetchAssoc($result))
280  {
281  return $record['anonymized'];
282  }
283 
284  return 0;
285  }
$result
+ Here is the caller graph for this function:

◆ _isUserToggleNoti()

static ilForumProperties::_isUserToggleNoti (   $a_obj_id)
static

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

References $res.

Referenced by ilForumNotification\checkForumsExistsInsert().

341  {
342  global $ilDB;
343 
344  $res = $ilDB->queryF("SELECT user_toggle_noti FROM frm_settings WHERE obj_id = %s",
345  array('integer'),
346  array($a_obj_id));
347  while($record = $ilDB->fetchAssoc($res))
348  {
349  return $record['user_toggle_noti'];
350  }
351  return 0;
352  }
+ Here is the caller graph for this function:

◆ copy()

ilForumProperties::copy (   $a_new_obj_id)

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

224  {
225  if ($a_new_obj_id)
226  {
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)
240  )
241  );
242  return true;
243  }
244 
245  return false;
246  }

◆ getAddReSubject()

ilForumProperties::getAddReSubject ( )

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

References $add_re_subject.

Referenced by getSubjectSetting().

379  {
380  return $this->add_re_subject;
381  }
$add_re_subject
Add 'Re: ' to subject on reply.
+ Here is the caller graph for this function:

◆ getAdminForceNoti()

ilForumProperties::getAdminForceNoti ( )
Returns
mixed

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

References $admin_force_noti.

462  {
464  }
$admin_force_noti
Activation of (CRS/GRP) forum notification by mod/admin private.

◆ getDefaultView()

ilForumProperties::getDefaultView ( )

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

References $default_view.

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

◆ getInstance()

static ilForumProperties::getInstance (   $a_obj_id = 0)
static

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

Referenced by ilForumModeratorsGUI\addModerator(), ilForum\deletePost(), ilForumModeratorsGUI\detachModeratorRole(), ilForumExportGUI\executeCommand(), ilObjForum\getDiskUsage(), ilForumXMLParser\handlerEndTag(), and ilObjForumListGUI\initItem().

129  {
130  if (!self::$instances[$a_obj_id])
131  {
132  self::$instances[$a_obj_id] = new ilForumProperties($a_obj_id);
133  }
134 
135  return self::$instances[$a_obj_id];
136  }
+ Here is the caller graph for this function:

◆ getMarkModeratorPosts()

ilForumProperties::getMarkModeratorPosts ( )

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

References $mark_mod_posts.

437  {
438  return $this->mark_mod_posts;
439  }

◆ getNotificationType()

ilForumProperties::getNotificationType ( )

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

References $notification_type.

391  {
393  }
$notification_type
Global notification-type setting (CRS/GRP) possible values: 'all_users', 'per_user', null (default)

◆ getObjId()

ilForumProperties::getObjId ( )

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

References $obj_id.

301  {
302  return $this->obj_id;
303  }
$obj_id
Object id of current forum private.

◆ getPresetSubject()

ilForumProperties::getPresetSubject ( )

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

References $preset_subject.

Referenced by getSubjectSetting().

371  {
372  return $this->preset_subject;
373  }
$preset_subject
Preset subject on reply.
+ Here is the caller graph for this function:

◆ getSubjectSetting()

ilForumProperties::getSubjectSetting ( )

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

References getAddReSubject(), and getPresetSubject().

396  {
397  if($this->getPresetSubject() == 0
398  && $this->getAddReSubject() == 0)
399  {
400  return "empty_subject";
401  }
402  else if($this->getPresetSubject() == 1)
403  {
404  return "preset_subject";
405  }
406  else if($this->getAddReSubject() == 1)
407  {
408  return "add_re_to_subject";
409  }
410  else return "preset_subject";
411  }
+ Here is the call graph for this function:

◆ getThreadSorting()

ilForumProperties::getThreadSorting ( )

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

References $thread_sorting.

446  {
447  return $this->thread_sorting;
448  }
$thread_sorting
sorting type for threads 0 = default 1 = manual

◆ getUserToggleNoti()

ilForumProperties::getUserToggleNoti ( )
Returns
mixed

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

References $user_toggle_noti.

454  {
456  }
$user_toggle_noti
Activation of allowing members to deactivate (CRS/GRP)forum notification private.

◆ insert()

ilForumProperties::insert ( )

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

174  {
175  if ($this->obj_id)
176  {
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)
190  )
191  );
192 
193  return true;
194  }
195 
196  return false;
197  }

◆ isAdminForceNoti()

ilForumProperties::isAdminForceNoti ( )

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

References $admin_force_noti.

311  {
313  }
$admin_force_noti
Activation of (CRS/GRP) forum notification by mod/admin private.

◆ isAnonymized()

ilForumProperties::isAnonymized ( )

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

References $anonymized.

269  {
270  return $this->anonymized;
271  }
$anonymized
Defines if a forum is anonymized or not private.

◆ isPostActivationEnabled()

ilForumProperties::isPostActivationEnabled ( )

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

References $post_activation_enabled.

292  {
294  }
$post_activation_enabled
Activation of new posts private.

◆ isStatisticEnabled()

ilForumProperties::isStatisticEnabled ( )

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

References $statistics_enabled.

261  {
263  }
$statistics_enabled
Defines if a forum can show ranking statistics private.

◆ isThreadRatingAllowed()

ilForumProperties::isThreadRatingAllowed (   $a_allow_rating = null)

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

References $thread_ratings_allowed.

355  {
356  if(null === $a_allow_rating)
357  {
359  }
360 
361  $this->thread_ratings_allowed = $a_allow_rating;
362 
363  return $this;
364  }

◆ isUserToggleNoti()

ilForumProperties::isUserToggleNoti ( )

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

References $user_toggle_noti.

321  {
323  }
$user_toggle_noti
Activation of allowing members to deactivate (CRS/GRP)forum notification private.

◆ read()

ilForumProperties::read ( )
private

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

References $res, and $row.

Referenced by __construct(), and setObjId().

139  {
140  if ($this->obj_id)
141  {
142  $res = $this->db->queryf('
143  SELECT * FROM frm_settings
144  WHERE obj_id = %s',
145  array('integer'), array($this->obj_id));
146 
147  $row = $this->db->fetchObject($res);
148 
149  if (is_object($row))
150  {
151  $this->default_view = $row->default_view;
152  $this->anonymized = $row->anonymized ;// == 1 ? true : false;
153  $this->statistics_enabled = $row->statistics_enabled ;// == 1 ? true : false;
154  $this->post_activation_enabled = $row->post_activation ;// == 1 ? true : false;
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;
159 
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;
163 
164  return true;
165  }
166 
167  return false;
168  }
169 
170  return false;
171  }
+ Here is the caller graph for this function:

◆ setAddReSubject()

ilForumProperties::setAddReSubject (   $a_add_re_subject)

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

Referenced by setSubjectSetting().

375  {
376  $this->add_re_subject = $a_add_re_subject;
377  }
+ Here is the caller graph for this function:

◆ setAdminForceNoti()

ilForumProperties::setAdminForceNoti (   $a_admin_force)

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

306  {
307  $this->admin_force_noti = $a_admin_force;
308  }

◆ setAnonymisation()

ilForumProperties::setAnonymisation (   $a_anonymized)

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

265  {
266  $this->anonymized = $a_anonymized;
267  }

◆ setDefaultView()

ilForumProperties::setDefaultView (   $a_default_view)

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

249  {
250  $this->default_view = $a_default_view;
251  }

◆ setMarkModeratorPosts()

ilForumProperties::setMarkModeratorPosts (   $a_mod_post)

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

432  {
433  $this->mark_mod_posts = $a_mod_post;
434  }

◆ setNotificationType()

ilForumProperties::setNotificationType (   $a_notification_type)

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

384  {
385  if($a_notification_type == null)
386  $this->notification_type = 'default';
387  else
388  $this->notification_type = $a_notification_type;
389  }

◆ setObjId()

ilForumProperties::setObjId (   $a_obj_id = 0)

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

References read().

296  {
297  $this->obj_id = $a_obj_id;
298  $this->read();
299  }
+ Here is the call graph for this function:

◆ setPostActivation()

ilForumProperties::setPostActivation (   $a_post_activation)

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

288  {
289  $this->post_activation_enabled = $a_post_activation;
290  }

◆ setPresetSubject()

ilForumProperties::setPresetSubject (   $a_preset_subject)

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

Referenced by setSubjectSetting().

367  {
368  $this->preset_subject = $a_preset_subject;
369  }
+ Here is the caller graph for this function:

◆ setStatisticsStatus()

ilForumProperties::setStatisticsStatus (   $a_statistic_status)

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

257  {
258  $this->statistics_enabled = $a_statistic_status;
259  }

◆ setSubjectSetting()

ilForumProperties::setSubjectSetting (   $a_subject_setting)

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

References setAddReSubject(), and setPresetSubject().

413  {
414  if($a_subject_setting == 'empty_subject')
415  {
416  $this->setPresetSubject(0);
417  $this->setAddReSubject(0);
418  }
419  else if($a_subject_setting == 'preset_subject')
420  {
421  $this->setPresetSubject(1);
422  $this->setAddReSubject(0);
423  }
424  else if($a_subject_setting == 'add_re_to_subject')
425  {
426  $this->setPresetSubject(0);
427  $this->setAddReSubject(1);
428  }
429  }
setPresetSubject($a_preset_subject)
setAddReSubject($a_add_re_subject)
+ Here is the call graph for this function:

◆ setThreadSorting()

ilForumProperties::setThreadSorting (   $a_thread_sorting)

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

442  {
443  $this->thread_sorting = $a_thread_sorting;
444  }

◆ setUserToggleNoti()

ilForumProperties::setUserToggleNoti (   $a_user_toggle)

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

316  {
317  $this->user_toggle_noti = $a_user_toggle;
318  }

◆ update()

ilForumProperties::update ( )

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

200  {
201  if ($this->obj_id)
202  {
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)
215  ),
216  array( 'obj_id' => array('integer', $this->obj_id))
217  );
218  return true;
219  }
220  return false;
221  }

Field Documentation

◆ $add_re_subject

ilForumProperties::$add_re_subject = 0
private

Add 'Re: ' to subject on reply.

private

Definition at line 94 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 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 private.

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

Referenced by isAnonymized().

◆ $db

ilForumProperties::$db = null
private

DB Object private.

Definition at line 111 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') private.

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

Referenced by getDefaultView().

◆ $instances

ilForumProperties::$instances = array()
staticprivate

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

◆ $mark_mod_posts

ilForumProperties::$mark_mod_posts = 0
private

Definition at line 96 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)

private

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

Referenced by getNotificationType().

◆ $obj_id

ilForumProperties::$obj_id
private

Object id of current forum 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 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

private

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

Referenced by getPresetSubject().

◆ $statistics_enabled

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().

◆ $thread_ratings_allowed

ilForumProperties::$thread_ratings_allowed = false
private

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

Referenced by isThreadRatingAllowed().

◆ $thread_sorting

ilForumProperties::$thread_sorting = 0
private

sorting type for threads 0 = default 1 = manual

private

Definition at line 105 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 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

◆ VIEW_DATE

◆ VIEW_DATE_ASC

◆ VIEW_DATE_DESC

const ilForumProperties::VIEW_DATE_DESC = 3

◆ VIEW_TREE


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