ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilChatroomInitialGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
11{
12
20 {
21 parent::__construct($gui);
22 require_once 'Modules/Chatroom/classes/class.ilChatroom.php';
23 require_once 'Modules/Chatroom/classes/class.ilChatroomUser.php';
24 }
25
26 public function executeDefault($method)
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 }
74
75}
76
77?>
$result
global $tpl
Definition: ilias.php:8
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
Class ilChatroomGUIHandler.
Class ilChatroomInitialGUI.
__construct(ilChatroomObjectGUI $gui)
Constructor Requires ilChatroom and ilChatroomUser.
Class ilChatroomUser.
static byObjectId($object_id)
Returns ilChatroom object by given $object_id.
global $lng
Definition: privfeed.php:17