ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilChatroomInviteUsersToPrivateRoomGUI Class Reference

Class ilChatroomInviteUsersToPrivateRoomGUI. More...

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

Public Member Functions

 executeDefault (string $requestedMethod)
 
 byLogin ()
 
 byId ()
 
 getUserList ()
 
- Public Member Functions inherited from ilChatroomGUIHandler
 execute (string $method)
 
 executeDefault (string $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...
 
 sendResponse ($response, bool $isJson=false)
 Sends a json encoded response and exits the php process. More...
 
 hasPermission (string $permission)
 

Private Member Functions

 inviteById (int $invited_id)
 

Additional Inherited Members

- Protected Member Functions inherited from ilChatroomGUIHandler
 getRequestValue (string $key, Transformation $trafo, $default=null)
 
 hasRequestValue (string $key)
 
 getRoomByObjectId (int $objectId)
 
 exitIfNoRoomExists (?ilChatroom $room)
 Checks if a ilChatroom exists. More...
 
 exitIfNoRoomModeratePermission (ilChatroom $room, int $subRoom, ilChatroomUser $chatUser)
 Check if user can moderate a chatroom. More...
 
 canModerate (ilChatroom $room, int $subRoom, int $usrId)
 
 isMainRoom (int $subRoomId)
 
- Protected Attributes inherited from ilChatroomGUIHandler
ilChatroomObjectGUI $gui
 
ilObjUser $ilUser
 
ilCtrlInterface $ilCtrl
 
ilLanguage $ilLng
 
Filesystem $webDirectory
 
ilObjectService $obj_service
 
FileUpload $upload
 
ilRbacSystem $rbacsystem
 
ilGlobalTemplateInterface $mainTpl
 
ILIAS $ilias
 
ilNavigationHistory $navigationHistory
 
ilTree $tree
 
ilTabsGUI $tabs
 
UIFactory $uiFactory
 
UIRenderer $uiRenderer
 
GlobalHttpState $http
 
Refinery $refinery
 

Detailed Description

Member Function Documentation

◆ byId()

ilChatroomInviteUsersToPrivateRoomGUI::byId ( )

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

References ilChatroomGUIHandler\getRequestValue(), inviteById(), and ILIAS\Repository\refinery().

68  : void
69  {
70  $this->inviteById($this->getRequestValue('user', $this->refinery->kindlyTo()->int()));
71  }
getRequestValue(string $key, Transformation $trafo, $default=null)
+ Here is the call graph for this function:

◆ byLogin()

ilChatroomInviteUsersToPrivateRoomGUI::byLogin ( )

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

References ilObjUser\_lookupId(), ilChatroomGUIHandler\getRequestValue(), inviteById(), and ILIAS\Repository\refinery().

Referenced by executeDefault().

34  : void
35  {
36  $user = $this->getRequestValue('user', $this->refinery->kindlyTo()->string());
37  $this->inviteById((int) ilObjUser::_lookupId($user));
38  }
getRequestValue(string $key, Transformation $trafo, $default=null)
static _lookupId($a_user_str)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeDefault()

ilChatroomInviteUsersToPrivateRoomGUI::executeDefault ( string  $requestedMethod)

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

References byLogin().

+ Here is the call graph for this function:

◆ getUserList()

ilChatroomInviteUsersToPrivateRoomGUI::getUserList ( )

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

References $query, ilChatroomGUIHandler\getRequestValue(), ILIAS\FileDelivery\http(), ilUserAutoComplete\MAX_ENTRIES, ilUserAutoComplete\PRIVACY_MODE_RESPECT_USER_SETTING, ILIAS\Repository\refinery(), ilUserAutoComplete\SEARCH_TYPE_EQUALS, ilChatroomGUIHandler\sendResponse(), and ilUtil\stripSlashes().

73  : void
74  {
75  $auto = new ilUserAutoComplete();
76  $auto->setUser($this->ilUser);
78  if ($this->ilUser->isAnonymous()) {
79  $auto->setSearchType(ilUserAutoComplete::SEARCH_TYPE_EQUALS);
80  }
81 
83  $this->getRequestValue('q', $this->refinery->kindlyTo()->string(), '')
84  );
85 
86  if ($this->http->wrapper()->query()->has('fetchall')) {
87  $auto->setLimit(ilUserAutoComplete::MAX_ENTRIES);
88  }
89  $auto->setMoreLinkAvailable(true);
90  $auto->setSearchFields(['firstname', 'lastname']);
91  $auto->setResultField('login');
92  $auto->enableFieldSearchableCheck(true);
93 
94  $this->sendResponse($auto->getList($query), true);
95  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
getRequestValue(string $key, Transformation $trafo, $default=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static http()
Fetches the global http state from ILIAS.
$query
sendResponse($response, bool $isJson=false)
Sends a json encoded response and exits the php process.
+ Here is the call graph for this function:

◆ inviteById()

ilChatroomInviteUsersToPrivateRoomGUI::inviteById ( int  $invited_id)
private

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

References $response, ilChatroom\byObjectId(), ilChatroomGUIHandler\exitIfNoRoomExists(), ilChatroomGUIHandler\exitIfNoRoomModeratePermission(), ilChatroomGUIHandler\getRequestValue(), ilChatroomGUIHandler\isMainRoom(), ilChatroomGUIHandler\redirectIfNoPermission(), ILIAS\Repository\refinery(), and ilChatroomGUIHandler\sendResponse().

Referenced by byId(), and byLogin().

40  : void
41  {
42  $this->redirectIfNoPermission('read');
43 
44  $room = ilChatroom::byObjectId($this->gui->getObject()->getId());
45  $this->exitIfNoRoomExists($room);
46 
47  $chat_user = new ilChatroomUser($this->ilUser, $room);
48  $subRoomId = $this->getRequestValue('sub', $this->refinery->kindlyTo()->int());
49  $this->exitIfNoRoomModeratePermission($room, $subRoomId, $chat_user);
50 
51  if (!$this->isMainRoom($subRoomId)) {
52  $room->inviteUserToPrivateRoom($invited_id, $subRoomId);
53  }
54 
55  $connector = $this->gui->getConnector();
56  $response = $connector->sendInviteToPrivateRoom(
57  $room->getRoomId(),
58  $subRoomId,
59  $chat_user->getUserId(),
60  $invited_id
61  );
62 
63  $room->sendInvitationNotification($this->gui, $chat_user, $invited_id, $subRoomId);
64 
65  $this->sendResponse($response);
66  }
redirectIfNoPermission($permission)
Checks for requested permissions and redirects if the permission check failed.
getRequestValue(string $key, Transformation $trafo, $default=null)
exitIfNoRoomExists(?ilChatroom $room)
Checks if a ilChatroom exists.
sendResponse($response, bool $isJson=false)
Sends a json encoded response and exits the php process.
exitIfNoRoomModeratePermission(ilChatroom $room, int $subRoom, ilChatroomUser $chatUser)
Check if user can moderate a chatroom.
Class ilChatroomUser.
static byObjectId(int $object_id)
$response
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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