ILIAS  trunk Revision v11.0_alpha-1744-gb0451eebef4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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. "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.ilOnScreenChatAppEventListener.php.

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

26  : void
27  {
28  switch ($a_component) {
29  case 'components/ILIAS/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  }
static getDefaultConfiguration()
Instantiates and returns ilChatroomAdmin object using instance_id and settings from settingsTable...
$GLOBALS["DIC"]
Definition: wac.php:53
Class ilChatroomServerConnector.
static yn2tf(string $a_yn)
$message
Definition: xapiexit.php:31
+ Here is the call graph for this function:

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