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

Class ilChatroomViewGUI. More...

+ Inheritance diagram for ilChatroomViewGUI:
+ Collaboration diagram for ilChatroomViewGUI:

Public Member Functions

 renderFileUploadForm (ilTemplate $roomTpl)
 Prepares Fileupload form and displays it. More...
 
 getUserProfileImages ()
 
- 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...
 

Private Member Functions

 cancelJoin ($message)
 Calls ilUtil::sendFailure method using given $message as parameter. 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 ilChatroomViewGUI.

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

Definition at line 13 of file class.ilChatroomViewGUI.php.

Member Function Documentation

◆ cancelJoin()

ilChatroomViewGUI::cancelJoin (   $message)
private

Calls ilUtil::sendFailure method using given $message as parameter.

Parameters
string$message

Definition at line 261 of file class.ilChatroomViewGUI.php.

References $message, and ilUtil\sendFailure().

Referenced by renderFileUploadForm().

262  {
264  }
catch(Exception $e) $message
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getUserProfileImages()

ilChatroomViewGUI::getUserProfileImages ( )

Definition at line 542 of file class.ilChatroomViewGUI.php.

References $_GET, $DIC, $response, array, exit, ilUserUtil\getNamePresentation(), and ilWACSignedPath\setTokenMaxLifetimeInSeconds().

543  {
544  global $DIC;
545 
546  $response = array();
547 
548  if (!$DIC->user()) {
549  echo json_encode($response);
550  exit();
551  }
552 
553  if (!isset($_GET['usr_ids']) || strlen($_GET['usr_ids']) == 0) {
554  echo json_encode($response);
555  exit();
556  }
557 
558  $DIC['lng']->loadLanguageModule('user');
559 
560  require_once 'Services/WebAccessChecker/classes/class.ilWACSignedPath.php';
562 
563  $user_ids = array_filter(array_map('intval', array_map('trim', explode(',', $_GET['usr_ids']))));
564  require_once 'Services/User/classes/class.ilUserUtil.php';
565  $public_data = ilUserUtil::getNamePresentation($user_ids, true, false, '', false, true, false, true);
566  $public_names = ilUserUtil::getNamePresentation($user_ids, false, false, '', false, true, false, false);
567 
568  foreach ($user_ids as $usr_id) {
569  $public_image = isset($public_data[$usr_id]) && isset($public_data[$usr_id]['img']) ? $public_data[$usr_id]['img'] : '';
570 
571  $public_name = '';
572  if (isset($public_names[$usr_id])) {
573  $public_name = $public_names[$usr_id];
574  if ('unknown' == $public_name && isset($public_data[$usr_id]) && isset($public_data[$usr_id]['login'])) {
575  $public_name = $public_data[$usr_id]['login'];
576  }
577  }
578 
579  $response[$usr_id] = array(
580  'public_name' => $public_name,
581  'profile_image' => $public_image
582  );
583  }
584 
585  echo json_encode($response);
586  exit();
587  }
global $DIC
Definition: saml.php:7
$_GET["client_id"]
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:
Create styles array
The data for the language used.
static setTokenMaxLifetimeInSeconds($token_max_lifetime_in_seconds)
$response
+ Here is the call graph for this function:

◆ renderFileUploadForm()

ilChatroomViewGUI::renderFileUploadForm ( ilTemplate  $roomTpl)

Prepares Fileupload form and displays it.

Parameters
ilTemplate$roomTpl

Definition at line 270 of file class.ilChatroomViewGUI.php.

References $_GET, $_SESSION, ilChatroomGUIHandler\$ilCtrl, ilChatroomGUIHandler\$ilUser, $lng, $title, $tpl, ilChatroom\addPrivateRoom(), array, ilChatroom\byObjectId(), cancelJoin(), ilChatroomGUIHandler\executeDefault(), exit, ilChatroomUser\getChatNameSuggestions(), ilChatroom\getRoomId(), ilChatroom\getSetting(), ilChatroom\getUniquePrivateRoomTitle(), ilChatroomUser\getUserId(), ilChatroomUser\getUsername(), ilChatroom\inviteUserToPrivateRoom(), ilChatroom\isSubscribed(), ilChatroomGUIHandler\redirectIfNoPermission(), ilUtil\sendFailure(), ilChatroomUser\setUsername(), and HTML_Template_IT\setVariable().

271  {
272  // @todo: Not implemented yet
273  return;
274 
275  require_once 'Modules/Chatroom/classes/class.ilChatroomFormFactory.php';
276  $formFactory = new ilChatroomFormFactory();
277  $file_upload = $formFactory->getFileUploadForm();
278  //$file_upload->setFormAction( $ilCtrl->getFormAction($this->gui, 'UploadFile-uploadFile') );
279  $roomTpl->setVariable('FILE_UPLOAD', $file_upload->getHTML());
280  }
Class ilChatroomFormFactory.
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
+ Here is the call graph for this function:

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