22 throw new Exception(
'METHOD_NOT_IN_USE', 1456435027);
25 require_once
'Modules/Chatroom/classes/class.ilChatroom.php';
26 require_once
'Modules/Chatroom/classes/class.ilChatroomUser.php';
30 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", ROOT_FOLDER_ID);
31 $ilCtrl->redirectByClass(
"ilrepositorygui",
"");
37 $user_id = $chat_user->getUserId();
43 else if(!$room->isSubscribed($chat_user->getUserId()))
47 else if(isset($_REQUEST[
'sub']) && !$room->userIsInPrivateRoom($_REQUEST[
'sub'], $chat_user->getUserId()))
49 $response = json_encode(
array(
51 'reason' =>
'not subscribed to private room' 53 echo json_encode($response);
57 $scope = $room->getRoomId();
60 if(($recipient = $_REQUEST[
'recipient']))
62 $params[
'recipients'] = join(
',', array_unique(
array($user_id, $recipient)));
63 $params[
'recipient_names'] = implode(
',',
array($chat_user->getUsername(), $_REQUEST[
'recipient_name']));
64 $params[
'public'] = isset($_REQUEST[
'public']) ? (int)$_REQUEST[
'public'] : 0;
72 $params[
'sub'] = (int)$_REQUEST[
'sub'];
80 $message = json_encode($messageObject);
85 $connector = $this->gui->getConnector();
86 $response = $connector->post($scope,
$query);
88 $responseObject = json_decode($response);
90 if($responseObject->success ==
true )
92 $room->addHistoryEntry($messageObject, $recipient, $publicMessage);
110 $data =
new stdClass();
112 $data->user = $this->gui->object->getPersonalInformation($chat_user);
113 $data->message = $messageString;
115 $data->type =
'message';
executeDefault($method)
Prepares and posts message fetched from $_REQUEST['message'] to recipients fetched from $_REQUEST['re...
static checkUserPermissions($permissions, $ref_id, $send_info=true)
Checks user permissions by given array and ref_id.
Class ilChatroomGUIHandler.
buildMessage($messageString, $params, ilChatroomUser $chat_user)
Instantiates stdClass, sets $data->user, $data->message, $data->public and $data->recipients using gi...
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Create styles array
The data for the language used.
static byObjectId($object_id)
Returns ilChatroom object by given $object_id.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
Class ilChatroomPostMessageGUI.