ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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...
 
static handleEvent ($a_component, $a_event, $a_parameter)
 Handle an event in a listener. 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.

15 {
16 switch ($a_component) {
17 case 'Modules/Chatroom':
18 switch ($a_event) {
19 case 'chatSettingsChanged':
20 $GLOBALS['ilLog']->info("Received event: chatSettingsChanged");
21
22 $message = [
23 $a_parameter['user']->getId() => [
24 'acceptsMessages' => (bool) ilUtil::yn2tf($a_parameter['user']->getPref('chat_osc_accept_msg')),
25 ]
26 ];
27
28 require_once 'Modules/Chatroom/classes/class.ilChatroomServerConnector.php';
29 require_once 'Modules/Chatroom/classes/class.ilChatroomAdmin.php';
30
31 $settings = ilChatroomAdmin::getDefaultConfiguration()->getServerSettings();
32 $connector = new ilChatroomServerConnector($settings);
33 $connector->sendUserConfigChange(json_encode($message));
34 break;
35 }
36 break;
37 }
38 }
static getDefaultConfiguration()
Instantiates and returns ilChatroomAdmin object using instance_id and settings from settingsTable.
Class ilChatroomServerConnector.
static yn2tf($a_yn)
convert "y"/"n" to true/false
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
catch(Exception $e) $message

References $GLOBALS, $message, ilChatroomAdmin\getDefaultConfiguration(), and ilUtil\yn2tf().

+ Here is the call graph for this function:

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