ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilForumAppEventListener Class Reference

Forum listener. More...

+ Collaboration diagram for ilForumAppEventListener:

Static Public Member Functions

static handleEvent ($a_component, $a_event, $a_parameter)
 Handle an event in a listener. More...
 

Static Protected Attributes

static $ref_ids = array()
 

Private Member Functions

 getCachedReferences ($obj_id)
 

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 11 of file class.ilForumAppEventListener.php.

Member Function Documentation

◆ getCachedReferences()

ilForumAppEventListener::getCachedReferences (   $obj_id)
private
Parameters
int$obj_id

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

References ilObject\_getAllReferences().

109  {
110  if(!array_key_exists($obj_id, self::$ref_ids))
111  {
112  self::$ref_ids[$obj_id] = ilObject::_getAllReferences($obj_id);
113  }
114  return self::$ref_ids[$obj_id];
115  }
static _getAllReferences($a_id)
get all reference ids of object
+ Here is the call graph for this function:

◆ handleEvent()

static ilForumAppEventListener::handleEvent (   $a_component,
  $a_event,
  $a_parameter 
)
static

Handle an event in a listener.

Parameters
string$a_componentcomponent, e.g. "Modules/Forum" or "Services/User"
string$a_eventevent e.g. "createUser", "updateUser", "deleteUser", ...
array$a_parameterparameter array (assoc), array("name" => ..., "phone_office" => ...)

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

References $ref_id, $ref_ids, ilForumNotification\_clearForcedForumNotifications(), ilForumNotification\checkForumsExistsDelete(), and ilForumNotification\checkForumsExistsInsert().

23  {
24  switch($a_component)
25  {
26  case "Services/News":
27  switch ($a_event)
28  {
29  case "readNews":
30  // here we could set postings to read, if news is
31  // read (has to be implemented)
32  break;
33  }
34  break;
35 
36  case "Services/Tree":
37  switch ($a_event)
38  {
39  case "moveTree":
40  include_once './Modules/Forum/classes/class.ilForumNotification.php';
42  break;
43  }
44  break;
45 
46  case "Modules/Course":
47  switch($a_event)
48  {
49  case "addParticipant":
50  include_once './Modules/Forum/classes/class.ilForumNotification.php';
51 
52  $ref_ids = self::getCachedReferences($a_parameter['obj_id']);
53 
54  foreach($ref_ids as $ref_id)
55  {
56  ilForumNotification::checkForumsExistsInsert($ref_id, $a_parameter['usr_id']);
57  break;
58  }
59 
60  break;
61  case 'deleteParticipant':
62  include_once './Modules/Forum/classes/class.ilForumNotification.php';
63 
64  $ref_ids = self::getCachedReferences($a_parameter['obj_id']);
65 
66  foreach($ref_ids as $ref_id)
67  {
68  ilForumNotification::checkForumsExistsDelete($ref_id, $a_parameter['usr_id']);
69  break;
70  }
71  break;
72  }
73  break;
74  case "Modules/Group":
75  switch($a_event)
76  {
77  case "addParticipant":
78  include_once './Modules/Forum/classes/class.ilForumNotification.php';
79 
80  $ref_ids = self::getCachedReferences($a_parameter['obj_id']);
81 
82  foreach($ref_ids as $ref_id)
83  {
84  ilForumNotification::checkForumsExistsInsert($ref_id, $a_parameter['usr_id']);
85  break;
86  }
87 
88  break;
89  case 'deleteParticipant':
90  include_once './Modules/Forum/classes/class.ilForumNotification.php';
91 
92  $ref_ids = self::getCachedReferences($a_parameter['obj_id']);
93 
94  foreach($ref_ids as $ref_id)
95  {
96  ilForumNotification::checkForumsExistsDelete($ref_id, $a_parameter['usr_id']);
97  break;
98  }
99  break;
100  }
101  break;
102  }
103  }
static _clearForcedForumNotifications($a_parameter)
static checkForumsExistsDelete($ref_id, $user_id=0)
$ref_id
Definition: sahs_server.php:39
static checkForumsExistsInsert($ref_id, $user_id=0)
+ Here is the call graph for this function:

Field Documentation

◆ $ref_ids

ilForumAppEventListener::$ref_ids = array()
staticprotected

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

Referenced by handleEvent().


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