ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilBadgeAppEventListener Class Reference

Trigger activity badges from events. More...

+ Inheritance diagram for ilBadgeAppEventListener:
+ Collaboration diagram for ilBadgeAppEventListener:

Static Public Member Functions

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

Detailed Description

Trigger activity badges from events.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 15 of file class.ilBadgeAppEventListener.php.

Member Function Documentation

◆ handleEvent()

static ilBadgeAppEventListener::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" => ...)

Implements ilAppEventListener.

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

References ilBadgeHandler\getInstance(), and ilLPStatus\LP_STATUS_COMPLETED_NUM.

18  {
19  switch ($a_component) {
20  case 'Services/User':
21  switch ($a_event) {
22  case 'afterUpdate':
23  $user_obj = $a_params['user_obj'];
24  ilBadgeHandler::getInstance()->triggerEvaluation(
25  'user/profile',
26  $user_obj->getId()
27  );
28  break;
29  }
30  break;
31 
32  case 'Services/Tracking':
33  switch ($a_event) {
34  case 'updateStatus':
35  if ($a_params['status'] == ilLPStatus::LP_STATUS_COMPLETED_NUM) {
36  ilBadgeHandler::getInstance()->triggerEvaluation(
37  'crs/course_lp',
38  $a_params['usr_id'],
39  array('obj_id' => $a_params['obj_id'])
40  );
41  }
42  break;
43  }
44  break;
45 
46  }
47  }
const LP_STATUS_COMPLETED_NUM
static getInstance()
Constructor.
+ Here is the call graph for this function:

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