ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 array, ilBadgeHandler\getInstance(), and ilLPStatus\LP_STATUS_COMPLETED_NUM.

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

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