4 require_once
'Modules/Chatroom/classes/class.ilChatroom.php';
5 require_once
'Modules/Chatroom/classes/class.ilChatroomUser.php';
31 parent::__construct($gui);
49 $subRoomId = $room->addPrivateRoom(
$title, $chat_user,
array(
'public' =>
false));
51 $connector = $this->gui->getConnector();
52 $response = $connector->sendCreatePrivateRoom($room->getRoomId(), $subRoomId, $chat_user->getUserId(),
$title);
58 'owner' => $chat_user->getUserId(),
59 'subRoomId' => $subRoomId
72 if (!$room->isSubscribed($chat_user->getUserId())) {
75 'reason' =>
'not subscribed' 80 public function delete()
83 $subRoom = $_REQUEST[
'sub'];
89 $room->closePrivateRoom($subRoom);
91 $connector = $this->gui->getConnector();
92 $response = $connector->sendDeletePrivateRoom($room->getRoomId(), $subRoom, $chat_user->getUserId());
101 $subRoom = $_REQUEST[
'sub'];
106 $connector = $this->gui->getConnector();
107 $response = $connector->sendLeavePrivateRoom($room->getRoomId(), $subRoom, $chat_user->getUserId());
109 if ($room->userIsInPrivateRoom($subRoom, $chat_user->getUserId())) {
110 $room->unsubscribeUserFromPrivateRoom($subRoom, $chat_user->getUserId());
123 $subRoom = $_REQUEST[
'sub'];
139 $connector = $this->gui->getConnector();
140 $response = $connector->sendEnterPrivateRoom($room->getRoomId(), $subRoom, $chat_user->getUserId());
143 $room->subscribeUserToPrivateRoom($subRoom, $chat_user->getUserId());
164 if (!$room->isAllowedToEnterPrivateRoom($chat_user->getUserId(), $subRoom)) {
167 'reason' =>
'not allowed enter to private room' 176 $response = $room->listUsersInPrivateRoom($_REQUEST[
'sub']);
Class ilChatroomPrivateRoomGUI.
redirectIfNoPermission($permission)
Checks for requested permissions and redirects if the permission check failed.
sendResponse($response)
Sends a json encoded response and exits the php process.
exitIfNoRoomExists($room)
Checks if a ilChatroom exists.
exitIfEnterRoomIsNotAllowed($room, $subRoom, $chat_user)
Class ilChatroomGUIHandler.
exitIfNoRoomSubscription($room, $chat_user)
isSuccessful($response)
Checks for success param in an json decoded response.
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.
__construct(ilChatroomObjectGUI $gui)
ilChatroomPrivateRoomGUI constructor.
static byObjectId($object_id)
Returns ilChatroom object by given $object_id.