ILIAS  release_8 Revision v8.24
ilChatroomAdminViewGUI Class Reference

Class ilChatroomAdminViewGUI. More...

+ Inheritance diagram for ilChatroomAdminViewGUI:
+ Collaboration diagram for ilChatroomAdminViewGUI:

Public Member Functions

 __construct (ilChatroomObjectGUI $gui)
 
 executeDefault (string $requestedMethod)
 
 forcePublicRoom ()
 
 createPublicRoom ()
 
 saveClientSettings ()
 
- 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)
 

Protected Member Functions

 checkServerConnection (array $serverSettings)
 
 createSettingTemplate (ilPropertyFormGUI $form)
 
 getReadmePath ()
 
- 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

ilSetting $commonSettings
 
- 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
 

Private Member Functions

 defaultActions ()
 

Private Attributes

const CHATROOM_README_PATH = '/Modules/Chatroom/README.md'
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilChatroomAdminViewGUI::__construct ( ilChatroomObjectGUI  $gui)

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

35 {
36 global $DIC;
37
39 $this->commonSettings = new ilSetting('common');
40 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, ilChatroomGUIHandler\$gui, and ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ checkServerConnection()

ilChatroomAdminViewGUI::checkServerConnection ( array  $serverSettings)
protected

Definition at line 89 of file class.ilChatroomAdminViewGUI.php.

89 : void
90 {
91 if (
92 isset($serverSettings['port'], $serverSettings['address']) &&
94 ) {
95 $this->mainTpl->setOnScreenMessage('info', $this->ilLng->txt('chat_cannot_connect_to_server'));
96 }
97 }
static checkServerConnection(bool $use_cache=true)

References ilChatroomServerConnector\checkServerConnection().

+ Here is the call graph for this function:

◆ createPublicRoom()

ilChatroomAdminViewGUI::createPublicRoom ( )

Definition at line 83 of file class.ilChatroomAdminViewGUI.php.

83 : void
84 {
85 ilChatroomInstaller::createDefaultPublicRoom(true);
86 $this->mainTpl->setOnScreenMessage('success', $this->ilLng->txt('public_chat_created'), true);
87 }

Referenced by forcePublicRoom().

+ Here is the caller graph for this function:

◆ createSettingTemplate()

ilChatroomAdminViewGUI::createSettingTemplate ( ilPropertyFormGUI  $form)
protected

Definition at line 99 of file class.ilChatroomAdminViewGUI.php.

100 {
101 $furtherInformation = sprintf($this->ilLng->txt('server_further_information'), $this->getReadmePath());
102 $serverTpl = new ilTemplate('tpl.chatroom_serversettings.html', true, true, 'Modules/Chatroom');
103 $serverTpl->setVariable('VAL_SERVERSETTINGS_FORM', $form->getHTML());
104 $serverTpl->setVariable('LBL_SERVERSETTINGS_FURTHER_INFORMATION', $furtherInformation);
105
106 return $serverTpl;
107 }
special template class to simplify handling of ITX/PEAR

References ilPropertyFormGUI\getHTML().

+ Here is the call graph for this function:

◆ defaultActions()

ilChatroomAdminViewGUI::defaultActions ( )
private

Definition at line 47 of file class.ilChatroomAdminViewGUI.php.

47 : void
48 {
49 $chatSettings = new ilSetting('chatroom');
50 if ($chatSettings->get('chat_enabled', '0')) {
51 $this->forcePublicRoom();
52 }
53 }

References forcePublicRoom().

+ Here is the call graph for this function:

◆ executeDefault()

ilChatroomAdminViewGUI::executeDefault ( string  $requestedMethod)

Reimplemented from ilChatroomGUIHandler.

Definition at line 42 of file class.ilChatroomAdminViewGUI.php.

42 : void
43 {
44 $this->ilCtrl->redirect($this->gui, 'view-clientsettings');
45 }
Class ilCtrl provides processing control methods.
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
@inheritDoc

References ilCtrl\redirect().

+ Here is the call graph for this function:

◆ forcePublicRoom()

ilChatroomAdminViewGUI::forcePublicRoom ( )

Definition at line 55 of file class.ilChatroomAdminViewGUI.php.

55 : void
56 {
58 if (!$ref_id) {
59 $this->createPublicRoom();
60 return;
61 }
62
64 if (!($instance instanceof ilObjChatroom)) {
65 $this->createPublicRoom();
66 return;
67 }
68
70 if (!$obj_id) {
71 $this->createPublicRoom();
72 return;
73 }
74
76 $this->createPublicRoom();
77 return;
78 }
79
80 ilChatroomInstaller::ensureCorrectPublicChatroomTreeLocation($ref_id);
81 }
Class ilObjChatroom.
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
static _hasUntrashedReference(int $obj_id)
checks whether an object has at least one reference that is not in trash
static _lookupObjId(int $ref_id)
$ref_id
Definition: ltiauth.php:67

References $ref_id, ilObjChatroom\_getPublicRefId(), ilObject\_hasUntrashedReference(), ilObject\_lookupObjId(), createPublicRoom(), and ilObjectFactory\getInstanceByRefId().

Referenced by defaultActions().

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

◆ getReadmePath()

ilChatroomAdminViewGUI::getReadmePath ( )
protected

Definition at line 109 of file class.ilChatroomAdminViewGUI.php.

109 : string
110 {
112 }
static _getHttpPath()

References ilUtil\_getHttpPath(), and CHATROOM_README_PATH.

+ Here is the call graph for this function:

◆ saveClientSettings()

ilChatroomAdminViewGUI::saveClientSettings ( )

Definition at line 114 of file class.ilChatroomAdminViewGUI.php.

114 : void
115 {
116 $this->redirectIfNoPermission('write');
117
119 $form = $factory->getClientSettingsForm();
120
121 if (!$form->checkInput()) {
122 $form->setValuesByPost();
123 $this->clientsettings($form);
124 return;
125 }
126
127 $convIdleStateTime = max(1, (int) $form->getInput('conversation_idle_state_in_minutes'));
128
129 $settings = [
130 'name' => (string) $form->getInput('client_name'),
131 'enable_osc' => (bool) $form->getInput('enable_osc'),
132 'enable_browser_notifications' => (bool) $form->getInput('enable_browser_notifications'),
133 'conversation_idle_state_in_minutes' => $convIdleStateTime,
134 'chat_enabled' => (bool) $form->getInput('chat_enabled'),
135 'enable_smilies' => (bool) $form->getInput('enable_smilies'),
136 'auth' => $form->getInput('auth')
137 ];
138
139 if (!$settings['chat_enabled']) {
140 $settings['enable_osc'] = false;
141 }
142
143 $chatSettings = new ilSetting('chatroom');
144 $chatSettings->set('chat_enabled', (string) $settings['chat_enabled']);
145 $chatSettings->set('enable_browser_notifications', (string) $settings['enable_browser_notifications']);
146 $chatSettings->set('conversation_idle_state_in_minutes', (string) $convIdleStateTime);
147 $chatSettings->set('enable_osc', (string) $settings['enable_osc']);
148
149 $adminSettings = new ilChatroomAdmin($this->gui->getObject()->getId());
150 $adminSettings->saveClientSettings((object) $settings);
151
152 $fileHandler = new ilChatroomConfigFileHandler();
153 $fileHandler->createClientConfigFile($settings);
154
155 $this->mainTpl->setOnScreenMessage('success', $this->ilLng->txt('settings_has_been_saved'), true);
156 $this->ilCtrl->redirect($this->gui, 'view-clientsettings');
157 }
Class ilChatroomAdmin.
Class ilChatroomFormFactory.
redirectIfNoPermission($permission)
Checks for requested permissions and redirects if the permission check failed.
$factory
Definition: metadata.php:75
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200

References $factory, ILIAS\LTI\ToolProvider\$settings, ilCtrl\redirect(), and ilChatroomGUIHandler\redirectIfNoPermission().

+ Here is the call graph for this function:

Field Documentation

◆ $commonSettings

ilSetting ilChatroomAdminViewGUI::$commonSettings
protected

Definition at line 32 of file class.ilChatroomAdminViewGUI.php.

◆ CHATROOM_README_PATH

const ilChatroomAdminViewGUI::CHATROOM_README_PATH = '/Modules/Chatroom/README.md'
private

Definition at line 30 of file class.ilChatroomAdminViewGUI.php.

Referenced by getReadmePath().


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