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

Class ilChatroomInviteUsersToPrivateRoomGUI. More...

+ Inheritance diagram for ilChatroomInviteUsersToPrivateRoomGUI:
+ Collaboration diagram for ilChatroomInviteUsersToPrivateRoomGUI:

Public Member Functions

 __construct (ilChatroomObjectGUI $gui)
 ilChatroomInviteUsersToPrivateRoomGUI constructor. More...
 
 executeDefault ($method)
 
 byLogin ()
 
 byId ()
 
 getUserList ()
 
- 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...
 

Protected Attributes

 $ilUser
 
- Protected Attributes inherited from ilChatroomGUIHandler
 $gui
 
 $ilUser
 
 $ilCtrl
 
 $ilLng
 
 $webDirectory
 
 $upload
 

Private Member Functions

 inviteById ($invited_id)
 

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)
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilChatroomInviteUsersToPrivateRoomGUI::__construct ( ilChatroomObjectGUI  $gui)

ilChatroomInviteUsersToPrivateRoomGUI constructor.

Parameters
ilChatroomObjectGUI$gui

Definition at line 25 of file class.ilChatroomInviteUsersToPrivateRoomGUI.php.

References $ilUser.

26  {
27  global $ilUser;
28 
29  $this->ilUser = $ilUser;
30 
31  parent::__construct($gui);
32  }

Member Function Documentation

◆ byId()

ilChatroomInviteUsersToPrivateRoomGUI::byId ( )

Definition at line 80 of file class.ilChatroomInviteUsersToPrivateRoomGUI.php.

References inviteById().

81  {
82  $this->inviteById($_REQUEST['user']);
83  }
+ Here is the call graph for this function:

◆ byLogin()

ilChatroomInviteUsersToPrivateRoomGUI::byLogin ( )

Definition at line 46 of file class.ilChatroomInviteUsersToPrivateRoomGUI.php.

References ilObjUser\_lookupId(), and inviteById().

Referenced by executeDefault().

47  {
48  $this->inviteById(ilObjUser::_lookupId($_REQUEST['user']));
49  }
static _lookupId($a_user_str)
Lookup id by login.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeDefault()

ilChatroomInviteUsersToPrivateRoomGUI::executeDefault (   $method)
Parameters
string$method
Returns
mixed

Definition at line 38 of file class.ilChatroomInviteUsersToPrivateRoomGUI.php.

References byLogin().

+ Here is the call graph for this function:

◆ getUserList()

ilChatroomInviteUsersToPrivateRoomGUI::getUserList ( )

Definition at line 88 of file class.ilChatroomInviteUsersToPrivateRoomGUI.php.

References array, exit, ilUserAutoComplete\MAX_ENTRIES, ilUserAutoComplete\PRIVACY_MODE_RESPECT_USER_SETTING, and ilUserAutoComplete\SEARCH_TYPE_EQUALS.

89  {
90  require_once 'Services/User/classes/class.ilUserAutoComplete.php';
91  $auto = new ilUserAutoComplete();
92  $auto->setUser($this->ilUser);
94  if ($this->ilUser->isAnonymous()) {
95  $auto->setSearchType(ilUserAutoComplete::SEARCH_TYPE_EQUALS);
96  }
97 
98  if (($_REQUEST['fetchall'])) {
99  $auto->setLimit(ilUserAutoComplete::MAX_ENTRIES);
100  }
101  $auto->setMoreLinkAvailable(true);
102  $auto->setSearchFields(array('firstname', 'lastname'));
103  $auto->setResultField('login');
104  $auto->enableFieldSearchableCheck(true);
105  echo $auto->getList($_REQUEST['q']);
106  exit;
107  }
Auto completion class for user lists.
Create styles array
The data for the language used.

◆ inviteById()

ilChatroomInviteUsersToPrivateRoomGUI::inviteById (   $invited_id)
private
Parameters
int$invited_id

Definition at line 54 of file class.ilChatroomInviteUsersToPrivateRoomGUI.php.

References $response, ilChatroom\byObjectId(), ilChatroomGUIHandler\exitIfNoRoomExists(), ilChatroomGUIHandler\exitIfNoRoomPermission(), ilChatroomGUIHandler\isMainRoom(), ilChatroomGUIHandler\redirectIfNoPermission(), and ilChatroomGUIHandler\sendResponse().

Referenced by byId(), and byLogin().

55  {
56  $this->redirectIfNoPermission('read');
57 
58  $room = ilChatroom::byObjectId($this->gui->object->getId());
59  $subRoomId = (int) $_REQUEST['sub'];
60  $chat_user = new ilChatroomUser($this->ilUser, $room);
61 
62  $this->exitIfNoRoomExists($room);
63  $this->exitIfNoRoomPermission($room, $subRoomId, $chat_user);
64 
65  if (!$this->isMainRoom($subRoomId)) {
66  $room->inviteUserToPrivateRoom($invited_id, $subRoomId);
67  }
68 
69  $connector = $this->gui->getConnector();
70  $response = $connector->sendInviteToPrivateRoom($room->getRoomId(), $subRoomId, $chat_user->getUserId(), $invited_id);
71 
72  $room->sendInvitationNotification($this->gui, $chat_user, $invited_id, $subRoomId);
73 
74  $this->sendResponse($response);
75  }
redirectIfNoPermission($permission)
Checks for requested permissions and redirects if the permission check failed.
sendResponse($response)
Sends a json encoded response and exits the php process.
exitIfNoRoomExists($room)
Checks if a ilChatroom exists.
exitIfNoRoomPermission($room, $subRoom, $chat_user)
Check if user can moderate a chatroom.
Class ilChatroomUser.
static byObjectId($object_id)
Returns ilChatroom object by given $object_id.
$response
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ilUser

ilChatroomInviteUsersToPrivateRoomGUI::$ilUser
protected

Definition at line 19 of file class.ilChatroomInviteUsersToPrivateRoomGUI.php.

Referenced by __construct().


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