ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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
 
 $rbacsystem
 

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);
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' => $rbacsystem->checkAccess('moderate', (int)$_GET['ref_id']),
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 {
50 foreach($smiley_array as $key => $value)
51 {
52 if($key == 'smiley_keywords')
53 {
54 $new_keys = explode("\n", $value);
55 }
56
57 if($key == 'smiley_fullpath')
58 {
59 $new_val = $value;
60 }
61 }
62
63 foreach($new_keys as $new_key)
64 {
65 $smileys[$new_key] = $new_val;
66 }
67 }
68
69 $result->smileys = $smileys;
70
71 echo json_encode($result);
72 exit;
73 }
$result
global $tpl
Definition: ilias.php:8
$_GET["client_id"]
Class ilChatroomUser.
static byObjectId($object_id)
Returns ilChatroom object by given $object_id.
global $lng
Definition: privfeed.php:17

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

+ Here is the call graph for this function:

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