ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilOnScreenChatAppEventListener Class Reference

Class ilOnScreenChatAppEventListener. More...

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

Static Public Member Functions

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

Detailed Description

Member Function Documentation

◆ handleEvent()

static ilOnScreenChatAppEventListener::handleEvent ( string  $a_component,
string  $a_event,
array  $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 26 of file class.ilOnScreenChatAppEventListener.php.

References $GLOBALS, $message, ILIAS\LTI\ToolProvider\$settings, ilChatroomAdmin\getDefaultConfiguration(), and ilUtil\yn2tf().

26  : void
27  {
28  switch ($a_component) {
29  case 'Modules/Chatroom':
30  switch ($a_event) {
31  case 'chatSettingsChanged':
32  $GLOBALS['ilLog']->info("Received event: chatSettingsChanged");
33 
34  $message = [
35  $a_parameter['user']->getId() => [
36  'acceptsMessages' => ilUtil::yn2tf((string) $a_parameter['user']->getPref('chat_osc_accept_msg')),
37  ]
38  ];
39 
40  $settings = ilChatroomAdmin::getDefaultConfiguration()->getServerSettings();
41  $connector = new ilChatroomServerConnector($settings);
42  $connector->sendUserConfigChange(json_encode($message, JSON_THROW_ON_ERROR));
43  break;
44  }
45  break;
46  }
47  }
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200
static getDefaultConfiguration()
Instantiates and returns ilChatroomAdmin object using instance_id and settings from settingsTable...
Class ilChatroomServerConnector.
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static yn2tf(string $a_yn)
$message
Definition: xapiexit.php:32
+ Here is the call graph for this function:

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