ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilChatroomClearTask Class Reference

Class ilChatroomKickTask. More...

+ Inheritance diagram for ilChatroomClearTask:
+ Collaboration diagram for ilChatroomClearTask:

Public Member Functions

 __construct (ilChatroomObjectGUI $gui)
 Constructor.
 executeDefault ($method)
 Displays window box to kick a user fetched from $_REQUEST['user'].

Private Member Functions

 buildMessage ($messageString, ilChatroomUser $chat_user)
 Instantiates stdClass, sets $data->user and $data->userToKick using given $messageString and $chat_user and returns $data.

Private Attributes

 $gui

Detailed Description

Class ilChatroomKickTask.

Author
Jan Posselt jposs.nosp@m.elt@.nosp@m.datab.nosp@m.ay.d.nosp@m.e
Version
$Id$

Definition at line 13 of file class.ilChatroomClearTask.php.

Constructor & Destructor Documentation

ilChatroomClearTask::__construct ( ilChatroomObjectGUI  $gui)

Constructor.

Sets $this->gui using given $gui.

Parameters
ilChatroomObjectGUI$gui

Reimplemented from ilChatroomTaskHandler.

Definition at line 25 of file class.ilChatroomClearTask.php.

References $gui.

{
$this->gui = $gui;
}

Member Function Documentation

ilChatroomClearTask::buildMessage (   $messageString,
ilChatroomUser  $chat_user 
)
private

Instantiates stdClass, sets $data->user and $data->userToKick using given $messageString and $chat_user and returns $data.

Parameters
string$messageString
ilChatroomUser$chat_user
Returns
stdClass

Definition at line 93 of file class.ilChatroomClearTask.php.

Referenced by executeDefault().

{
$data = new stdClass();
$data->user = $this->gui->object->getPersonalInformation( $chat_user );
$data->timestamp = date( 'c' );
$data->type = 'clear';
$data->sub = $messageString;
return $data;
}

+ Here is the caller graph for this function:

ilChatroomClearTask::executeDefault (   $method)

Displays window box to kick a user fetched from $_REQUEST['user'].

ilObjUser $ilUser

Parameters
string$method

Reimplemented from ilChatroomTaskHandler.

Definition at line 36 of file class.ilChatroomClearTask.php.

References $_REQUEST, $ilCtrl, $ilUser, $query, buildMessage(), ilChatroom\byObjectId(), ilChatroom\checkUserPermissions(), exit, and ilUtil\stripSlashes().

{
global $ilUser, $ilCtrl;
require_once 'Modules/Chatroom/classes/class.ilChatroom.php';
require_once 'Modules/Chatroom/classes/class.ilChatroomUser.php';
if ( !ilChatroom::checkUserPermissions( array('moderate') , $this->gui->ref_id ) )
{
$ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", ROOT_FOLDER_ID);
$ilCtrl->redirectByClass("ilrepositorygui", "");
}
$room = ilChatroom::byObjectId( $this->gui->object->getId() );
if( $room )
{
// if user is in scope
$scope = $room->getRoomId();
$chat_user = new ilChatroomUser( $ilUser, $room );
$message = json_encode( $this->buildMessage(
ilUtil::stripSlashes( (int)$_REQUEST['sub'] ), $chat_user
) );
$params = array(
'message' => $message,
);
$query = http_build_query( $params );
$connector = $this->gui->getConnector();
$response = $connector->post( $scope, $query );
$responseObject = json_decode( $response );
$room->clearMessages($_REQUEST['sub']);
}
else
{
$response = json_encode( array(
'success' => false,
'reason' => 'unkown room'
) );
}
echo $response;
}

+ Here is the call graph for this function:

Field Documentation

ilChatroomClearTask::$gui
private

Definition at line 16 of file class.ilChatroomClearTask.php.

Referenced by __construct().


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