ILIAS  release_7 Revision v7.30-3-g800a261c036
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 12 of file class.ilOnScreenChatAppEventListener.php.

13 {
14 switch ($a_component) {
15 case 'Modules/Chatroom':
16 switch ($a_event) {
17 case 'chatSettingsChanged':
18 $GLOBALS['ilLog']->info("Received event: chatSettingsChanged");
19
20 $message = [
21 $a_parameter['user']->getId() => [
22 'acceptsMessages' => (bool) ilUtil::yn2tf($a_parameter['user']->getPref('chat_osc_accept_msg')),
23 ]
24 ];
25
26 $settings = ilChatroomAdmin::getDefaultConfiguration()->getServerSettings();
27 $connector = new ilChatroomServerConnector($settings);
28 $connector->sendUserConfigChange(json_encode($message));
29 break;
30 }
31 break;
32 }
33 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
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
$message
Definition: xapiexit.php:14

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: