ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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);
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  }
69 }
__construct(ilChatroomObjectGUI $gui)
Constructor Requires ilChatroom and ilChatroomUser.
$result
$_GET["client_id"]
$tpl
Definition: ilias.php:10
static checkUserPermissions($permissions, $ref_id, $send_info=true)
Checks user permissions by given array and ref_id.
Class ilChatroomGUIHandler.
Class ilChatroomInitialGUI.
Create styles array
The data for the language used.
Class ilChatroomUser.
global $lng
Definition: privfeed.php:17
static byObjectId($object_id)
Returns ilChatroom object by given $object_id.
$key
Definition: croninfo.php:18