ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilForumAppEventListener Class Reference

Forum listener. More...

+ Inheritance diagram for ilForumAppEventListener:
+ Collaboration diagram for ilForumAppEventListener:

Static Protected Attributes

static $ref_ids = array()
 

Static Private Member Functions

static getCachedReferences ($obj_id)
 
static delegateNotification (ilObjForumNotificationDataProvider $provider, $notification_type, \ilLogger $logger)
 

Additional Inherited Members

- Static Public Member Functions inherited from ilAppEventListener
static handleEvent ($a_component, $a_event, $a_parameter)
 Handle an event in a listener. More...
 

Detailed Description

Forum listener.

Listens to events of other components.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 14 of file class.ilForumAppEventListener.php.

Member Function Documentation

◆ delegateNotification()

static ilForumAppEventListener::delegateNotification ( ilObjForumNotificationDataProvider  $provider,
  $notification_type,
\ilLogger  $logger 
)
staticprivate
Parameters
ilObjForumNotificationDataProvider$provider
int$notification_type
ilLogger$logger

Definition at line 322 of file class.ilForumAppEventListener.php.

References ilObjForumNotificationDataProvider\getForumNotificationRecipients(), ilObjForumNotificationDataProvider\getPostActivationRecipients(), ilObjForumNotificationDataProvider\getPostAnsweredRecipients(), ilObjForumNotificationDataProvider\getThreadNotificationRecipients(), ilForumMailNotification\TYPE_POST_ACTIVATION, and ilForumMailNotification\TYPE_POST_ANSWERED.

326  {
327  switch ($notification_type) {
329  $mailNotification = new ilForumMailNotification($provider, $logger);
330  $mailNotification->setType($notification_type);
331  $mailNotification->setRecipients($provider->getPostActivationRecipients());
332  $mailNotification->send();
333  break;
334 
336  $mailNotification = new ilForumMailNotification($provider, $logger);
337  $mailNotification->setType($notification_type);
338  $mailNotification->setRecipients($provider->getPostAnsweredRecipients());
339  $mailNotification->send();
340  break;
341 
342  default:
343  $mailNotification = new ilForumMailNotification($provider, $logger);
344  $mailNotification->setType($notification_type);
345 
346  // get recipients who wants to get forum notifications
347  $frm_recipients = $provider->getForumNotificationRecipients();
348 
349  // get recipients who wants to get thread notifications
350  $thread_recipients = $provider->getThreadNotificationRecipients();
351  $recipients = array_unique(array_merge($frm_recipients, $thread_recipients));
352 
353  $mailNotification->setRecipients($recipients);
354  $mailNotification->send();
355  break;
356  }
357  }
+ Here is the call graph for this function:

◆ getCachedReferences()

static ilForumAppEventListener::getCachedReferences (   $obj_id)
staticprivate
Parameters
int$obj_id

Definition at line 309 of file class.ilForumAppEventListener.php.

References ilObject\_getAllReferences().

310  {
311  if (!array_key_exists($obj_id, self::$ref_ids)) {
312  self::$ref_ids[$obj_id] = ilObject::_getAllReferences($obj_id);
313  }
314  return self::$ref_ids[$obj_id];
315  }
static _getAllReferences($a_id)
get all reference ids of object
+ Here is the call graph for this function:

Field Documentation

◆ $ref_ids

ilForumAppEventListener::$ref_ids = array()
staticprotected

Definition at line 16 of file class.ilForumAppEventListener.php.


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