ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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...
 
 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...
 
 sendJSONResponse ($response)
 Sends a json encoded response and exits the php process. More...
 
 sendResponse (string $content, string $type)
 Sends a response and exits the php process. More...
 
- Protected Attributes inherited from ilChatroomGUIHandler
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
 
ILIAS FileDelivery Services $file_delivery
 

Detailed Description

Member Function Documentation

◆ byId()

ilChatroomInviteUsersToPrivateRoomGUI::byId ( )

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

64 : void
65 {
66 $this->inviteById($this->getRequestValue('user', $this->refinery->kindlyTo()->int()));
67 }
getRequestValue(string $key, Transformation $trafo, $default=null)

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

+ Here is the call graph for this function:

◆ byLogin()

ilChatroomInviteUsersToPrivateRoomGUI::byLogin ( )

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

34 : void
35 {
36 $user = $this->getRequestValue('user', $this->refinery->kindlyTo()->string());
37 $this->inviteById((int) ilObjUser::_lookupId($user));
38 }
static _lookupId(string|array $a_user_str)

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

Referenced by executeDefault().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeDefault()

ilChatroomInviteUsersToPrivateRoomGUI::executeDefault ( string  $requestedMethod)

Reimplemented from ilChatroomGUIHandler.

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

69 : void
70 {
71 $auto = new ilUserAutoComplete();
72 $auto->setUser($this->ilUser);
74 if ($this->ilUser->isAnonymous()) {
75 $auto->setSearchType(ilUserAutoComplete::SEARCH_TYPE_EQUALS);
76 }
77
78 $query = ilUtil::stripSlashes(
79 $this->getRequestValue('q', $this->refinery->kindlyTo()->string(), '')
80 );
81
82 if ($this->http->wrapper()->query()->has('fetchall')) {
83 $auto->setLimit(ilUserAutoComplete::MAX_ENTRIES);
84 }
85 $auto->setMoreLinkAvailable(true);
86 $auto->setSearchFields(['firstname', 'lastname']);
87 $auto->setResultField('login');
88 $auto->enableFieldSearchableCheck(true);
89
90 $this->sendResponse($auto->getList($query), 'application/json');
91 }
sendResponse(string $content, string $type)
Sends a response and exits the php process.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static http()
Fetches the global http state from ILIAS.

References 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().

+ Here is the call graph for this function:

◆ inviteById()

ilChatroomInviteUsersToPrivateRoomGUI::inviteById ( int  $invited_id)
private

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

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
49 $connector = $this->gui->getConnector();
50 $response = $connector->sendInviteToPrivateRoom(
51 $room->getRoomId(),
52 $chat_user->getUserId(),
53 $invited_id
54 );
55
56 $room->sendInvitationNotification($this->gui, $chat_user, $invited_id);
57
58 if ('asynch' === $this->getRequestValue('cmdMode', $this->refinery->kindlyTo()->string())) {
59 $this->sendResponse($response, 'application/json');
60 }
61 $this->ilCtrl->redirect($this->gui, 'view');
62 }
redirectIfNoPermission($permission)
Checks for requested permissions and redirects if the permission check failed.
exitIfNoRoomExists(?ilChatroom $room)
Checks if a ilChatroom exists.
Class ilChatroomUser.
static byObjectId(int $object_id)
Class ilCtrl provides processing control methods.
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
@inheritDoc
$response
Definition: xapitoken.php:93

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

Referenced by byId(), and byLogin().

+ 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: