ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilChatroomViewGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once 'Modules/Chatroom/classes/class.ilChatroom.php';
5 require_once 'Modules/Chatroom/classes/class.ilChatroomUser.php';
6 
14 {
21  public function joinWithCustomName()
22  {
23  $this->redirectIfNoPermission('read');
24 
25  $this->gui->switchToVisibleMode();
26  $this->setupTemplate();
27  $room = ilChatroom::byObjectId($this->gui->object->getId());
28  $chat_user = new ilChatroomUser($this->ilUser, $room);
29  $failure = false;
30  $username = '';
31 
32  if ($_REQUEST['custom_username_radio'] == 'custom_username') {
33  $username = $_REQUEST['custom_username_text'];
34  } elseif (method_exists($chat_user, 'build' . $_REQUEST['custom_username_radio'])) {
35  $username = $chat_user->{'build' . $_REQUEST['custom_username_radio']}();
36  } else {
37  $failure = true;
38  }
39 
40  if (!$failure && trim($username) != '') {
41  if (!$room->isSubscribed($chat_user->getUserId())) {
42  $chat_user->setUsername($chat_user->buildUniqueUsername($username));
43  }
44 
45  $this->showRoom($room, $chat_user);
46  } else {
47  ilUtil::sendFailure($this->ilLng->txt('no_username_given'));
48  $this->showNameSelection($chat_user);
49  }
50  }
51 
55  private function setupTemplate()
56  {
57  $this->mainTpl->addJavaScript('Modules/Chatroom/js/chat.js');
58  $this->mainTpl->addJavaScript('Modules/Chatroom/js/iliaschat.jquery.js');
59  $this->mainTpl->addJavaScript('libs/bower/bower_components/jquery-outside-events/jquery.ba-outside-events.min.js');
60 
61  $this->mainTpl->addJavaScript('./Services/UIComponent/AdvancedSelectionList/js/AdvancedSelectionList.js');
62 
63  $this->mainTpl->addCSS('Modules/Chatroom/templates/default/style.css');
64  }
65 
71  private function showRoom(ilChatroom $room, ilChatroomUser $chat_user)
72  {
73  $this->redirectIfNoPermission('read');
74 
75  $user_id = $chat_user->getUserId($this->ilUser);
76 
77  $this->navigationHistory->addItem($_GET['ref_id'], $this->ilCtrl->getLinkTargetByClass('ilrepositorygui', 'view'), 'chtr');
78 
79  if ($room->isUserBanned($user_id)) {
80  $this->cancelJoin($this->ilLng->txt('banned'));
81  return;
82  }
83 
84  $scope = $room->getRoomId();
85  $connector = $this->gui->getConnector();
86  $response = @$connector->connect($scope, $user_id);
87 
88  if (!$response) {
89  ilUtil::sendFailure($this->ilLng->txt('unable_to_connect'), true);
90  $this->ilCtrl->redirectByClass('ilinfoscreengui', 'info');
91  }
92 
93  if (!$room->isSubscribed($chat_user->getUserId())) {
94  $room->connectUser($chat_user);
95  }
96 
97  $subScope = 0;
98  $response = $connector->sendEnterPrivateRoom($scope, $subScope, $user_id);
99  if (!$response) {
100  ilUtil::sendFailure($this->ilLng->txt('unable_to_connect'), true);
101  $this->ilCtrl->redirectByClass('ilinfoscreengui', 'info');
102  }
103 
104  $connection_info = json_decode($response);
105  $settings = $connector->getSettings();
106  $known_private_room = $room->getActivePrivateRooms($this->ilUser->getId());
107 
108  $initial = new stdClass();
109  $initial->users = $room->getConnectedUsers();
110  $initial->private_rooms = array_values($known_private_room);
111  $initial->redirect_url = $this->ilCtrl->getLinkTarget($this->gui, 'view-lostConnection', '', false, false);
112  $initial->profile_image_url = $this->ilCtrl->getLinkTarget($this->gui, 'view-getUserProfileImages', '', true, false);
113  $initial->no_profile_image_url = ilUtil::getImagePath('no_photo_xxsmall.jpg');
114  $initial->private_rooms_enabled = (boolean) $room->getSetting('private_rooms_enabled');
115  $initial->subdirectory = $settings->getSubDirectory();
116 
117  $initial->userinfo = array(
118  'moderator' => ilChatroom::checkUserPermissions('moderate', (int) $_GET['ref_id'], false),
119  'id' => $chat_user->getUserId(),
120  'login' => $chat_user->getUsername()
121  );
122 
123  $smileys = array();
124 
125  include_once('Modules/Chatroom/classes/class.ilChatroomSmilies.php');
126 
127  if ($settings->getSmiliesEnabled()) {
128  $smileys_array = ilChatroomSmilies::_getSmilies();
129  foreach ($smileys_array as $smiley_array) {
130  $new_keys = array();
131  $new_val = '';
132  foreach ($smiley_array as $key => $value) {
133  if ($key == 'smiley_keywords') {
134  $new_keys = explode("\n", $value);
135  }
136 
137  if ($key == 'smiley_fullpath') {
138  $new_val = $value;
139  }
140  }
141 
142  if (!$new_keys || !$new_val) {
143  continue;
144  }
145 
146  foreach ($new_keys as $new_key) {
147  $smileys[$new_key] = $new_val;
148  }
149  }
150 
151  $initial->smileys = $smileys;
152  } else {
153  $initial->smileys = '{}';
154  }
155 
156  $initial->messages = array();
157 
158  if (isset($_REQUEST['sub'])) {
159  if ($known_private_room[$_REQUEST['sub']]) {
160  if (!$room->isAllowedToEnterPrivateRoom($chat_user->getUserId(), $_REQUEST['sub'])) {
161  $initial->messages[] = array(
162  'type' => 'error',
163  'message' => $this->ilLng->txt('not_allowed_to_enter'),
164  );
165  } else {
166  $scope = $room->getRoomId();
167  $params = array();
168  $params['user'] = $chat_user->getUserId();
169  $params['sub'] = $_REQUEST['sub'];
170 
171  $params['message'] = json_encode(
172  array(
173  'type' => 'private_room_entered',
174  'user' => $user_id
175  )
176  );
177 
178  $connector = $this->gui->getConnector();
179  $response = $connector->sendEnterPrivateRoom($scope, $_REQUEST['sub'], $chat_user->getUserId());
180 
181  if ($this->isSuccessful($response)) {
182  $room->subscribeUserToPrivateRoom($params['sub'], $params['user']);
183  }
184 
185  $initial->enter_room = $_REQUEST['sub'];
186  }
187  } else {
188  $initial->messages[] = array(
189  'type' => 'error',
190  'message' => $this->ilLng->txt('user_invited'),
191  );
192  }
193  }
194 
195  if ((int) $room->getSetting('display_past_msgs')) {
196  $initial->messages = array_merge($initial->messages, array_reverse($room->getLastMessages($room->getSetting('display_past_msgs'), $chat_user)));
197  }
198 
199  $roomTpl = new ilTemplate('tpl.chatroom.html', true, true, 'Modules/Chatroom');
200  $roomTpl->setVariable('SESSION_ID', $connection_info->{'session-id'});
201  $roomTpl->setVariable('BASEURL', $settings->generateClientUrl());
202  $roomTpl->setVariable('INSTANCE', $settings->getInstance());
203  $roomTpl->setVariable('SCOPE', $scope);
204  $roomTpl->setVariable('MY_ID', $user_id);
205  $roomTpl->setVariable('INITIAL_DATA', json_encode($initial));
206  $roomTpl->setVariable('POSTURL', $this->ilCtrl->getLinkTarget($this->gui, 'postMessage', '', true, true));
207 
208  $roomTpl->setVariable('ACTIONS', $this->ilLng->txt('actions'));
209  $roomTpl->setVariable('LBL_CREATE_PRIVATE_ROOM', $this->ilLng->txt('create_private_room_label'));
210  $roomTpl->setVariable('LBL_USER', $this->ilLng->txt('user'));
211  $roomTpl->setVariable('LBL_USER_TEXT', $this->ilLng->txt('invite_username'));
212  $roomTpl->setVariable('LBL_AUTO_SCROLL', $this->ilLng->txt('auto_scroll'));
213 
214  $roomTpl->setVariable('INITIAL_USERS', json_encode($room->getConnectedUsers()));
215 
216  $this->renderFileUploadForm($roomTpl);
217  $this->renderSendMessageBox($roomTpl);
218  $this->renderLanguageVariables($roomTpl);
219 
220  require_once 'Services/UIComponent/Modal/classes/class.ilModalGUI.php';
222 
223  $roomRightTpl = new ilTemplate('tpl.chatroom_right.html', true, true, 'Modules/Chatroom');
224  $this->renderRightUsersBlock($roomRightTpl);
225 
226  require_once 'Services/UIComponent/Panel/classes/class.ilPanelGUI.php';
227  $right_content_panel = ilPanelGUI::getInstance();
228  $right_content_panel->setHeading($this->ilLng->txt('users'));
229  $right_content_panel->setPanelStyle(ilPanelGUI::PANEL_STYLE_SECONDARY);
230  $right_content_panel->setHeadingStyle(ilPanelGUI::HEADING_STYLE_BLOCK);
231  $right_content_panel->setBody($roomRightTpl->get());
232 
233  $this->mainTpl->setContent($roomTpl->get());
234  $this->mainTpl->setRightContent($right_content_panel->getHTML());
235  }
236 
241  private function cancelJoin($message)
242  {
244  }
245 
250  public function renderFileUploadForm(ilTemplate $roomTpl)
251  {
252  // @todo: Not implemented yet
253  return;
254 
255  require_once 'Modules/Chatroom/classes/class.ilChatroomFormFactory.php';
256  $formFactory = new ilChatroomFormFactory();
257  $file_upload = $formFactory->getFileUploadForm();
258  //$file_upload->setFormAction( $ilCtrl->getFormAction($this->gui, 'UploadFile-uploadFile') );
259  $roomTpl->setVariable('FILE_UPLOAD', $file_upload->getHTML());
260  }
261 
265  protected function renderSendMessageBox(ilTemplate $roomTpl)
266  {
267  $roomTpl->setVariable('LBL_MESSAGE', $this->ilLng->txt('chat_message'));
268  $roomTpl->setVariable('LBL_TOALL', $this->ilLng->txt('chat_message_to_all'));
269  $roomTpl->setVariable('LBL_OPTIONS', $this->ilLng->txt('chat_message_options'));
270  $roomTpl->setVariable('LBL_DISPLAY', $this->ilLng->txt('chat_message_display'));
271  $roomTpl->setVariable('LBL_SEND', $this->ilLng->txt('send'));
272  }
273 
277  protected function renderLanguageVariables(ilTemplate $roomTpl)
278  {
279  $js_translations = array(
280  'LBL_MAINROOM' => 'chat_mainroom',
281  'LBL_LEAVE_PRIVATE_ROOM' => 'leave_private_room',
282  'LBL_LEFT_PRIVATE_ROOM' => 'left_private_room',
283  'LBL_JOIN' => 'chat_join',
284  'LBL_DELETE_PRIVATE_ROOM' => 'delete_private_room',
285  'LBL_DELETE_PRIVATE_ROOM_QUESTION' => 'delete_private_room_question',
286  'LBL_INVITE_TO_PRIVATE_ROOM' => 'invite_to_private_room',
287  'LBL_KICK' => 'chat_kick',
288  'LBL_BAN' => 'chat_ban',
289  'LBL_KICK_QUESTION' => 'kick_question',
290  'LBL_BAN_QUESTION' => 'ban_question',
291  'LBL_ADDRESS' => 'chat_address',
292  'LBL_WHISPER' => 'chat_whisper',
293  'LBL_CONNECT' => 'chat_connection_established',
294  'LBL_DISCONNECT' => 'chat_connection_disconnected',
295  'LBL_TO_MAINROOM' => 'chat_to_mainroom',
296  'LBL_CREATE_PRIVATE_ROOM_JS' => 'chat_create_private_room_button',
297  'LBL_WELCOME_TO_CHAT' => 'welcome_to_chat',
298  'LBL_USER_INVITED' => 'user_invited',
299  'LBL_USER_KICKED' => 'user_kicked',
300  'LBL_USER_INVITED_SELF' => 'user_invited_self',
301  'LBL_PRIVATE_ROOM_CLOSED' => 'private_room_closed',
302  'LBL_PRIVATE_ROOM_ENTERED' => 'private_room_entered',
303  'LBL_PRIVATE_ROOM_LEFT' => 'private_room_left',
304  'LBL_PRIVATE_ROOM_ENTERED_USER' => 'private_room_entered_user',
305  'LBL_KICKED_FROM_PRIVATE_ROOM' => 'kicked_from_private_room',
306  'LBL_OK' => 'ok',
307  'LBL_INVITE' => 'chat_invite',
308  'LBL_CANCEL' => 'cancel',
309  'LBL_WHISPER_TO' => 'whisper_to',
310  'LBL_SPEAK_TO' => 'speak_to',
311  'LBL_HISTORY_CLEARED' => 'history_cleared',
312  'LBL_CLEAR_ROOM_HISTORY' => 'clear_room_history',
313  'LBL_CLEAR_ROOM_HISTORY_QUESTION' => 'clear_room_history_question',
314  'LBL_END_WHISPER' => 'end_whisper',
315  'LBL_TIMEFORMAT' => 'lang_timeformat_no_sec',
316  'LBL_DATEFORMAT' => 'lang_dateformat'
317  );
318  foreach ($js_translations as $placeholder => $lng_variable) {
319  $roomTpl->setVariable($placeholder, json_encode($this->ilLng->txt($lng_variable)));
320  }
321 
322  $roomTpl->setVariable('LBL_CREATE_PRIVATE_ROOM', $this->ilLng->txt('chat_create_private_room_button'));
323  $roomTpl->setVariable('LBL_CREATE_PRIVATE_ROOM_TEXT', $this->ilLng->txt('create_private_room_text'));
324  $roomTpl->setVariable('LBL_LAYOUT', $this->ilLng->txt('layout'));
325  $roomTpl->setVariable('LBL_SHOW_SETTINGS', $this->ilLng->txt('show_settings'));
326  $roomTpl->setVariable('LBL_USER_IN_ROOM', $this->ilLng->txt('user_in_room'));
327  $roomTpl->setVariable('LBL_USER_IN_ILIAS', $this->ilLng->txt('user_in_ilias'));
328  }
329 
333  protected function renderRightUsersBlock(ilTemplate $roomTpl)
334  {
335  $roomTpl->setVariable('LBL_NO_FURTHER_USERS', $this->ilLng->txt('no_further_users'));
336  }
337 
344  private function showNameSelection(ilChatroomUser $chat_user)
345  {
346  require_once 'Modules/Chatroom/classes/class.ilChatroomFormFactory.php';
347 
348  $name_options = $chat_user->getChatNameSuggestions();
349  $formFactory = new ilChatroomFormFactory();
350  $selectionForm = $formFactory->getUserChatNameSelectionForm($name_options);
351 
352  $this->ilCtrl->saveParameter($this->gui, 'sub');
353 
354  $selectionForm->addCommandButton('view-joinWithCustomName', $this->ilLng->txt('enter'));
355  $selectionForm->setFormAction(
356  $this->ilCtrl->getFormAction($this->gui, 'view-joinWithCustomName')
357  );
358 
359  $this->mainTpl->setVariable('ADM_CONTENT', $selectionForm->getHtml());
360  }
361 
368  public function executeDefault($method)
369  {
370  include_once 'Modules/Chatroom/classes/class.ilChatroom.php';
371 
372  $this->redirectIfNoPermission('read');
373 
374  $this->gui->switchToVisibleMode();
375  $this->setupTemplate();
376 
377  $chatSettings = new ilSetting('chatroom');
378  if (!$chatSettings->get('chat_enabled')) {
379  $this->ilCtrl->redirect($this->gui, 'settings-general');
380  exit;
381  }
382 
383  $room = ilChatroom::byObjectId($this->gui->object->getId());
384 
385  if (!$room->getSetting('allow_anonymous') && $this->ilUser->isAnonymous()) {
386  $this->cancelJoin($this->ilLng->txt('chat_anonymous_not_allowed'));
387  return;
388  }
389 
390  $chat_user = new ilChatroomUser($this->ilUser, $room);
391 
392  if ($room->getSetting('allow_custom_usernames')) {
393  if ($room->isSubscribed($chat_user->getUserId())) {
394  $chat_user->setUsername($chat_user->getUsername());
395  $this->showRoom($room, $chat_user);
396  } else {
397  $this->showNameSelection($chat_user);
398  }
399  } else {
400  $chat_user->setUsername($this->ilUser->getLogin());
401  $this->showRoom($room, $chat_user);
402  }
403  }
404 
408  public function invitePD()
409  {
410  $chatSettings = new ilSetting('chatroom');
411  if (!$chatSettings->get('chat_enabled')) {
412  $this->ilCtrl->redirect($this->gui, 'settings-general');
413  }
414 
415  $room = ilChatroom::byObjectId($this->gui->object->getId());
416  $chat_user = new ilChatroomUser($this->ilUser, $room);
417  $user_id = $_REQUEST['usr_id'];
418  $connector = $this->gui->getConnector();
419  $title = $room->getUniquePrivateRoomTitle($chat_user->buildLogin());
420  $subRoomId = $room->addPrivateRoom($title, $chat_user, array('public' => false));
421 
422  $room->inviteUserToPrivateRoom($user_id, $subRoomId);
423  $connector->sendCreatePrivateRoom($room->getRoomId(), $subRoomId, $chat_user->getUserId(), $title);
424  $connector->sendInviteToPrivateRoom($room->getRoomId(), $subRoomId, $chat_user->getUserId(), $user_id);
425 
426  $room->sendInvitationNotification($this->gui, $chat_user, $user_id, $subRoomId);
427 
428  $_REQUEST['sub'] = $subRoomId;
429 
430  $_SESSION['show_invitation_message'] = $user_id;
431 
432  $this->ilCtrl->setParameter($this->gui, 'sub', $subRoomId);
433  $this->ilCtrl->redirect($this->gui, 'view');
434  }
435 
439  public function logout()
440  {
444  $pid = $this->tree->getParentId($this->gui->getRefId());
445  $this->ilCtrl->setParameterByClass('ilrepositorygui', 'ref_id', $pid);
446  $this->ilCtrl->redirectByClass('ilrepositorygui', '');
447  }
448 
452  public function lostConnection()
453  {
454  if (isset($_GET['msg'])) {
455  switch ($_GET['msg']) {
456  case 'kicked':
457  ilUtil::sendFailure($this->ilLng->txt('kicked'), true);
458  break;
459 
460  case 'banned':
461  ilUtil::sendFailure($this->ilLng->txt('banned'), true);
462  break;
463 
464  default:
465  ilUtil::sendFailure($this->ilLng->txt('lost_connection'), true);
466  break;
467  }
468  } else {
469  ilUtil::sendFailure($this->ilLng->txt('lost_connection'), true);
470  }
471 
472  $this->ilCtrl->redirectByClass('ilinfoscreengui', 'info');
473  }
474 
475  public function getUserProfileImages()
476  {
477  global $DIC;
478 
479  $response = array();
480 
481  if (!$this->ilUser) {
482  echo json_encode($response);
483  exit();
484  }
485 
486  if (!isset($_GET['usr_ids']) || strlen($_GET['usr_ids']) == 0) {
487  echo json_encode($response);
488  exit();
489  }
490 
491  $this->ilLng->loadLanguageModule('user');
492 
494 
495  $user_ids = array_filter(array_map('intval', array_map('trim', explode(',', $_GET['usr_ids']))));
496 
497  $room = ilChatroom::byObjectId($this->gui->object->getId());
498  $chatRoomUserDetails = ilChatroomUser::getUserInformation($user_ids, $room->getRoomId());
499  $chatRoomUserDetailsByUsrId = array_combine(
500  array_map(
501  function (stdClass $userData) {
502  return $userData->id;
503  },
504  $chatRoomUserDetails
505  ),
506  $chatRoomUserDetails
507  );
508 
509  $public_data = ilUserUtil::getNamePresentation($user_ids, true, false, '', false, true, false, true);
510  $public_names = ilUserUtil::getNamePresentation($user_ids, false, false, '', false, true, false, false);
511 
512  foreach ($user_ids as $usr_id) {
513  if (!array_key_exists($usr_id, $chatRoomUserDetailsByUsrId)) {
514  continue;
515  }
516 
517  if ($room->getSetting('allow_custom_usernames')) {
519  $avatar = $DIC["user.avatar.factory"]->avatar('xsmall');
520  $avatar->setUsrId(ANONYMOUS_USER_ID);
521  $avatar->setName(ilStr::subStr($chatRoomUserDetailsByUsrId[$usr_id]->login, 0, 2));
522 
523  $public_name = $chatRoomUserDetailsByUsrId[$usr_id]->login;
524  $public_image = $avatar->getUrl();
525  } else {
526  $public_image = isset($public_data[$usr_id]) && isset($public_data[$usr_id]['img']) ? $public_data[$usr_id]['img'] : '';
527  $public_name = '';
528  if (isset($public_names[$usr_id])) {
529  $public_name = $public_names[$usr_id];
530  if ('unknown' == $public_name && isset($public_data[$usr_id]) && isset($public_data[$usr_id]['login'])) {
531  $public_name = $public_data[$usr_id]['login'];
532  }
533  }
534  }
535 
536  $response[$usr_id] = [
537  'public_name' => $public_name,
538  'profile_image' => $public_image,
539  ];
540  }
541 
542  echo json_encode($response);
543  exit();
544  }
545 }
getLinkTargetByClass( $a_class, $a_cmd="", $a_anchor="", $a_asynch=false, $xml_style=false)
Get link target for command using gui class name.
setParameter($a_obj, $a_parameter, $a_value)
Set parameters that should be passed a form and link of a gui class.
$failure
getUserId()
Returns Ilias User ID.
This class provides processing control methods.
getActivePrivateRooms($userid)
exit
Definition: login.php:29
getRoomId()
Returns roomID from $this->roomId.
$_SESSION["AccountId"]
renderLanguageVariables(ilTemplate $roomTpl)
$_GET["client_id"]
isUserBanned($user_id)
Returns true if there&#39;s an entry in banTable matching roomId and given $user_id.
redirectIfNoPermission($permission)
Checks for requested permissions and redirects if the permission check failed.
getLastMessages($number, $chatuser=null)
Class ilChatroomViewGUI.
getSetting($name)
Returns setting from $this->settings array by given name.
static initJS(ilGlobalTemplateInterface $a_main_tpl=null)
Init javascript.
isSubscribed($chat_userid)
Returns true if entry exists in userTable matching given $chat_userid and $this->roomId.
renderSendMessageBox(ilTemplate $roomTpl)
login()
Definition: login.php:2
executeDefault($method)
Chatroom and Chatuser get prepared before $this->showRoom method is called.
static subStr($a_str, $a_start, $a_length=null)
Definition: class.ilStr.php:15
Class ilChatroomFormFactory.
getFormAction( $a_gui_obj, $a_fallback_cmd="", $a_anchor="", $a_asynch=false, $xml_style=false)
Get form action url for gui class object.
static checkUserPermissions($permissions, $ref_id, $send_info=true)
Checks user permissions by given array and ref_id.
static getUserInformation(array $usrIds, int $roomId=null)
redirectByClass($a_class, $a_cmd="", $a_anchor="", $a_asynch=false)
Redirect to other gui class using class name.
Class ilChatroomGUIHandler.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
setupTemplate()
Adds CSS and JavaScript files that should be included in the header.
joinWithCustomName()
Joins user to chatroom with custom username, fetched from $_REQUEST[&#39;custom_username_text&#39;] or by cal...
logout()
Performs logout.
subscribeUserToPrivateRoom($room_id, $user_id)
showRoom(ilChatroom $room, ilChatroomUser $chat_user)
Prepares and displays chatroom and connects user to it.
setVariable($variable, $value='')
isSuccessful($response)
Checks for success param in an json decoded response.
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
connectUser(ilChatroomUser $user)
Connects user by inserting userdata into userTable.
saveParameter($a_obj, $a_parameter)
Set parameters that should be passed in every form and link of a gui class.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Class ilChatroom.
renderFileUploadForm(ilTemplate $roomTpl)
Prepares Fileupload form and displays it.
getChatNameSuggestions()
Returns an array of chat-name suggestions.
static getInstance()
Get instance.
setParameterByClass($a_class, $a_parameter, $a_value)
Same as setParameterByClass, except that a class name is passed.
cancelJoin($message)
Calls ilUtil::sendFailure method using given $message as parameter.
Class ilChatroomUser.
showNameSelection(ilChatroomUser $chat_user)
Prepares and displays name selection.
$DIC
Definition: xapitoken.php:46
getLinkTarget( $a_gui_obj, $a_cmd="", $a_anchor="", $a_asynch=false, $xml_style=false)
Get link target for command using gui object.
const PANEL_STYLE_SECONDARY
$message
Definition: xapiexit.php:14
static byObjectId($object_id)
Returns ilChatroom object by given $object_id.
getUsername()
Returns username from Object or SESSION.
static setTokenMaxLifetimeInSeconds($token_max_lifetime_in_seconds)
const HEADING_STYLE_BLOCK
$response
renderRightUsersBlock(ilTemplate $roomTpl)
getConnectedUsers($only_data=true)
Returns an array of connected users.
isAllowedToEnterPrivateRoom($chat_userid, $proom_id)
redirect($a_gui_obj, $a_cmd="", $a_anchor="", $a_asynch=false)
Redirect to another command.