ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilChatroomInitialGUI Class Reference

Class ilChatroomInitialGUI. More...

+ Inheritance diagram for ilChatroomInitialGUI:
+ Collaboration diagram for ilChatroomInitialGUI:

Public Member Functions

 __construct (ilChatroomObjectGUI $gui)
 Constructor Requires ilChatroom and ilChatroomUser. More...
 
 executeDefault ($method)
 
- Public Member Functions inherited from ilChatroomGUIHandler
 __construct (ilChatroomObjectGUI $gui)
 
 sendResponse ($response)
 Sends a json encoded response and exits the php process. More...
 
 hasPermission ($permission)
 Checks for access with ilRbacSystem. More...
 
 execute ($method)
 Executes given $method if existing, otherwise executes executeDefault() method. More...
 
 executeDefault ($requestedMethod)
 
 redirectIfNoPermission ($permission)
 Checks for requested permissions and redirects if the permission check failed. More...
 
 isSuccessful ($response)
 Checks for success param in an json decoded response. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ilChatroomGUIHandler
 getRoomByObjectId ($objectId)
 
 exitIfNoRoomExists ($room)
 Checks if a ilChatroom exists. More...
 
 exitIfNoRoomPermission ($room, $subRoom, $chat_user)
 Check if user can moderate a chatroom. More...
 
 canModerate ($room, $subRoom, $user_id)
 Checks if the user has permission to moderate a ilChatroom. More...
 
 isMainRoom ($subRoomId)
 
- Protected Attributes inherited from ilChatroomGUIHandler
 $gui
 
 $ilUser
 
 $ilCtrl
 
 $ilLng
 
 $webDirectory
 
 $upload
 

Detailed Description

Class ilChatroomInitialGUI.

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

Definition at line 10 of file class.ilChatroomInitialGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilChatroomInitialGUI::__construct ( ilChatroomObjectGUI  $gui)

Constructor Requires ilChatroom and ilChatroomUser.

Sets $this->gui using given $gui.

Parameters
ilChatroomObjectGUI$gui

Reimplemented from ilChatroomGUIHandler.

Definition at line 19 of file class.ilChatroomInitialGUI.php.

20 {
21 parent::__construct($gui);
22 require_once 'Modules/Chatroom/classes/class.ilChatroom.php';
23 require_once 'Modules/Chatroom/classes/class.ilChatroomUser.php';
24 }

References ilChatroomGUIHandler\$gui.

Member Function Documentation

◆ executeDefault()

ilChatroomInitialGUI::executeDefault (   $requestedMethod)
Parameters
string$requestedMethod
Returns
mixed

Reimplemented from ilChatroomGUIHandler.

Definition at line 26 of file class.ilChatroomInitialGUI.php.

27 {
28 throw new Exception('METHOD_NOT_IN_USE', 1456435027);
29 global $tpl, $ilUser, $ilCtrl, $lng, $rbacsystem;
30
31 $room = ilChatroom::byObjectId($this->gui->object->getId());
32 $chat_user = new ilChatroomUser($ilUser, $room);
33
34 $result = new stdClass();
35 $result->users = $room->getConnectedUsers();
36 $result->private_rooms = $room->getActivePrivateRooms($ilUser->getId());
37 $result->userinfo = array(
38 'moderator' => ilChatroom::checkUserPermissions('moderate', (int) $_GET['ref_id'], false),
39 'userid' => $chat_user->getUserId()
40 );
41
42 $smileys = array();
43
44 include_once('Modules/Chatroom/classes/class.ilChatroomSmilies.php');
45
46 $smileys_array = ilChatroomSmilies::_getSmilies();
47
48 foreach ($smileys_array as $smiley_array) {
49 foreach ($smiley_array as $key => $value) {
50 if ($key == 'smiley_keywords') {
51 $new_keys = explode("\n", $value);
52 }
53
54 if ($key == 'smiley_fullpath') {
55 $new_val = $value;
56 }
57 }
58
59 foreach ($new_keys as $new_key) {
60 $smileys[$new_key] = $new_val;
61 }
62 }
63
64 $result->smileys = $smileys;
65
66 echo json_encode($result);
67 exit;
68 }
$result
$tpl
Definition: ilias.php:10
$_GET["client_id"]
Class ilChatroomUser.
static byObjectId($object_id)
Returns ilChatroom object by given $object_id.
static checkUserPermissions($permissions, $ref_id, $send_info=true)
Checks user permissions by given array and ref_id.
$key
Definition: croninfo.php:18
global $lng
Definition: privfeed.php:17

References $_GET, ilChatroomGUIHandler\$ilCtrl, ilChatroomGUIHandler\$ilUser, $key, $lng, $result, $tpl, ilChatroom\byObjectId(), ilChatroom\checkUserPermissions(), and exit.

+ Here is the call graph for this function:

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