ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilChatroomInitialTask Class Reference

Class ilChatroomInitialTask. More...

+ Inheritance diagram for ilChatroomInitialTask:
+ Collaboration diagram for ilChatroomInitialTask:

Public Member Functions

 __construct (ilDBayObjectGUI $gui)
 Constructor.
 executeDefault ($method)
- Public Member Functions inherited from ilDBayTaskHandler
 execute ($method)
 Executes given $method if existing, otherwise executes executeDefault() method.

Private Attributes

 $gui

Detailed Description

Constructor & Destructor Documentation

ilChatroomInitialTask::__construct ( ilDBayObjectGUI  $gui)

Constructor.

Requires ilChatroom and ilChatroomUser. Sets $this->gui using given $gui.

Parameters
ilDBayObjectGUI$gui

Reimplemented from ilDBayTaskHandler.

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

References $gui.

{
$this->gui = $gui;
require_once 'Modules/Chatroom/classes/class.ilChatroom.php';
require_once 'Modules/Chatroom/classes/class.ilChatroomUser.php';
}

Member Function Documentation

ilChatroomInitialTask::executeDefault (   $method)

Reimplemented from ilDBayTaskHandler.

Definition at line 32 of file class.ilChatroomInitialTask.php.

References $_GET, $ilCtrl, $ilUser, $lng, $result, $tpl, ilChatroomSmilies\_getSmilies(), ilChatroom\byObjectId(), and exit.

{
global $tpl, $ilUser, $ilCtrl, $lng, $rbacsystem;
$room = ilChatroom::byObjectId( $this->gui->object->getId() );
$chat_user = new ilChatroomUser( $ilUser, $room );
$result = new stdClass();
$result->users = $room->getConnectedUsers();
$result->private_rooms = $room->getActivePrivateRooms($ilUser->getId());
$result->userinfo = array(
'moderator' => $rbacsystem->checkAccess('moderate', (int)$_GET['ref_id']),
'userid' => $chat_user->getUserId()
);
$smileys = array();
include_once('Modules/Chatroom/classes/class.ilChatroomSmilies.php');
$smileys_array = ilChatroomSmilies::_getSmilies();
foreach( $smileys_array as $smiley_array )
{
foreach( $smiley_array as $key => $value )
{
if( $key == 'smiley_keywords' )
{
$new_keys = explode("\n", $value);
}
if( $key == 'smiley_fullpath' )
{
$new_val = $value;
}
}
foreach( $new_keys as $new_key )
{
$smileys[$new_key] = $new_val;
}
}
$result->smileys = $smileys;
echo json_encode($result);
}

+ Here is the call graph for this function:

Field Documentation

ilChatroomInitialTask::$gui
private

Definition at line 15 of file class.ilChatroomInitialTask.php.

Referenced by __construct().


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