ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilOnScreenChatAppEventListener Class Reference

Class ilOnScreenChatAppEventListener. More...

+ Inheritance diagram for ilOnScreenChatAppEventListener:
+ Collaboration diagram for ilOnScreenChatAppEventListener:

Static Public Member Functions

static handleEvent ($a_component, $a_event, $a_parameter)
 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" => ...)
More...
 

Detailed Description

Member Function Documentation

◆ handleEvent()

static ilOnScreenChatAppEventListener::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 14 of file class.ilOnScreenChatAppEventListener.php.

References $GLOBALS, and ilUtil\yn2tf().

15  {
16  switch($a_component)
17  {
18  case 'Services/User':
19  switch($a_event)
20  {
21  case 'chatSettingsChanged':
22  $GLOBALS['ilLog']->info("Received event: chatSettingsChanged");
23 
24  $message = [
25  $a_parameter['user']->getId() => [
26  'acceptsMessages' => (bool)ilUtil::yn2tf($a_parameter['user']->getPref('chat_osc_accept_msg')),
27  ]
28  ];
29 
30  require_once 'Modules/Chatroom/classes/class.ilChatroomServerConnector.php';
31  require_once 'Modules/Chatroom/classes/class.ilChatroomAdmin.php';
32 
33  $settings = ilChatroomAdmin::getDefaultConfiguration()->getServerSettings();
34  $connector = new ilChatroomServerConnector($settings);
35  $connector->sendUserConfigChange(json_encode($message));
36  break;
37  }
38  break;
39  }
40  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Class ilChatroomServerConnector.
static yn2tf($a_yn)
convert "y"/"n" to true/false
+ Here is the call graph for this function:

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