ILIAS  release_4-3 Revision
 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 (ilDBayObjectGUI $gui)
 Constructor.
 executeDefault ($method)
 Displays window box to kick a user fetched from $_REQUEST['user'].
- Public Member Functions inherited from ilDBayTaskHandler
 execute ($method)
 Executes given $method if existing, otherwise executes executeDefault() method.

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 ( ilDBayObjectGUI  $gui)

Constructor.

Sets $this->gui using given $gui.

Parameters
ilDBayObjectGUI$gui

Reimplemented from ilDBayTaskHandler.

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.

References $data.

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 ilDBayTaskHandler.

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: