ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilBadgeAppEventListener Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

Static Public Member Functions

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

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning 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

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

Member Function Documentation

◆ handleEvent()

static ilBadgeAppEventListener::handleEvent ( string  $a_component,
string  $a_event,
array  $a_parameter 
)
static

Handle an event in a listener.

Parameters
string$a_componentcomponent, e.g. "components/ILIAS/Forum" or "components/ILIAS/User"
string$a_eventevent e.g. "createUser", "updateUser", "deleteUser", ...
array<string,mixed>$a_parameter parameter array (assoc), array("name" => ..., "phone_office" => ...)

Implements ilAppEventListener.

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

26 : void
27 {
28 switch ($a_component) {
29 case 'components/ILIAS/User':
30 switch ($a_event) {
31 case 'afterUpdate':
32 $user_obj = $a_parameter['user_obj'];
33 ilBadgeHandler::getInstance()->triggerEvaluation(
34 'user/profile',
35 $user_obj->getId()
36 );
37 break;
38 }
39 break;
40
41 case 'components/ILIAS/Tracking':
42 switch ($a_event) {
43 case 'updateStatus':
44 if ((int) $a_parameter['status'] === ilLPStatus::LP_STATUS_COMPLETED_NUM) {
45 ilBadgeHandler::getInstance()->triggerEvaluation(
46 'crs/course_lp',
47 (int) $a_parameter['usr_id'],
48 ['obj_id' => (int) $a_parameter['obj_id']]
49 );
50 }
51 break;
52 }
53 break;
54 }
55 }
const LP_STATUS_COMPLETED_NUM

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

+ Here is the call graph for this function:

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