ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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
 
 $rbacsystem
 

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 81 of file class.ilChatroomInviteUsersToPrivateRoomGUI.php.

References inviteById().

82  {
83  $this->inviteById($_REQUEST['user']);
84  }
+ 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 89 of file class.ilChatroomInviteUsersToPrivateRoomGUI.php.

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

90  {
91  require_once 'Services/User/classes/class.ilUserAutoComplete.php';
92  $auto = new ilUserAutoComplete();
93  $auto->setUser($this->ilUser);
95  if($this->ilUser->isAnonymous())
96  {
97  $auto->setSearchType(ilUserAutoComplete::SEARCH_TYPE_EQUALS);
98  }
99 
100  if(($_REQUEST['fetchall']))
101  {
102  $auto->setLimit(ilUserAutoComplete::MAX_ENTRIES);
103  }
104  $auto->setMoreLinkAvailable(true);
105  $auto->setSearchFields(array('firstname', 'lastname'));
106  $auto->setResultField('login');
107  $auto->enableFieldSearchableCheck(true);
108  echo $auto->getList($_REQUEST['q']);
109  exit;
110  }
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 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  {
67  $room->inviteUserToPrivateRoom($invited_id, $subRoomId);
68  }
69 
70  $connector = $this->gui->getConnector();
71  $response = $connector->sendInviteToPrivateRoom($room->getRoomId(), $subRoomId, $chat_user->getUserId(), $invited_id);
72 
73  $room->sendInvitationNotification($this->gui, $chat_user, $invited_id, $subRoomId);
74 
75  $this->sendResponse($response);
76  }
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.
+ 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: