ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilChatroomClearGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once 'Modules/Chatroom/classes/class.ilChatroom.php';
5 require_once 'Modules/Chatroom/classes/class.ilChatroomUser.php';
6 
15 {
19  public function executeDefault($method)
20  {
21  $this->redirectIfNoPermission('moderate');
22 
23  $room = $this->getRoomByObjectId($this->gui->object->getId());
24  $this->exitIfNoRoomExists($room);
25 
26  $chat_user = new ilChatroomUser($this->ilUser, $room);
27  $subRoomId = $_REQUEST['sub'];
28 
29  $room->clearMessages($subRoomId);
30 
31  $connector = $this->gui->getConnector();
32  $response = $connector->sendClearMessages($room->getRoomId(), $subRoomId, $chat_user->getUserId());
33 
34  $this->sendResponse($response);
35  }
36 }
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.
Class ilChatroomGUIHandler.
Class ilChatroomUser.
$response
Class ilChatroomKickGUI.