ILIAS  release_8 Revision v8.24
ilChatroomSettingsGUI Class Reference

Class ilChatroomSettingsGUI. More...

+ Inheritance diagram for ilChatroomSettingsGUI:
+ Collaboration diagram for ilChatroomSettingsGUI:

Public Member Functions

 general (ilPropertyFormGUI $settingsForm=null)
 
 executeDefault (string $requestedMethod)
 
- 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)
 

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

◆ executeDefault()

ilChatroomSettingsGUI::executeDefault ( string  $requestedMethod)

Reimplemented from ilChatroomGUIHandler.

Definition at line 129 of file class.ilChatroomSettingsGUI.php.

129 : void
130 {
131 $this->general();
132 }
general(ilPropertyFormGUI $settingsForm=null)

References general().

+ Here is the call graph for this function:

◆ general()

ilChatroomSettingsGUI::general ( ilPropertyFormGUI  $settingsForm = null)

Definition at line 75 of file class.ilChatroomSettingsGUI.php.

75 : void
76 {
77 if (!ilChatroom::checkUserPermissions(['visible', 'read'], $this->gui->getRefId())) {
78 $this->ilCtrl->setParameterByClass(ilRepositoryGUI::class, 'ref_id', ROOT_FOLDER_ID);
79 $this->ilCtrl->redirectByClass(ilRepositoryGUI::class);
80 }
81
82 $chatSettings = new ilSetting('chatroom');
83 if (!$chatSettings->get('chat_enabled', '0')) {
84 $this->mainTpl->setOnScreenMessage('info', $this->ilLng->txt('server_disabled'), true);
85 }
86
87 $this->gui->switchToVisibleMode();
88
89 $formFactory = new ilChatroomFormFactory();
90
91 $room = ilChatroom::byObjectId($this->gui->getObject()->getId());
92
93 if (!$settingsForm) {
94 $settingsForm = $formFactory->getSettingsForm($this->obj_service, $this->gui->getObject());
95
96 $settings = [
97 'title' => $this->gui->getObject()->getTitle(),
98 'desc' => $this->gui->getObject()->getDescription(),
99 'access_period' => [
100 'start' => $this->gui->getObject()->getAccessBegin() ? (new ilDateTime(
101 $this->gui->getObject()->getAccessBegin(),
103 ))->get(IL_CAL_DATETIME) : '',
104 'end' => $this->gui->getObject()->getAccessEnd() ? (new ilDateTime(
105 $this->gui->getObject()->getAccessEnd(),
107 ))->get(IL_CAL_DATETIME) : ''
108 ],
109 'access_visibility' => (bool) $this->gui->getObject()->getAccessVisibility()
110 ];
111
112 if ($room) {
114 $settingsForm,
115 array_merge($settings, $room->getSettings())
116 );
117 } else {
119 }
120 }
121
122 $settingsForm->setTitle($this->ilLng->txt('settings_title'));
123 $settingsForm->addCommandButton('settings-saveGeneral', $this->ilLng->txt('save'));
124 $settingsForm->setFormAction($this->ilCtrl->getFormAction($this->gui, 'settings-saveGeneral'));
125
126 $this->mainTpl->setVariable('ADM_CONTENT', $settingsForm->getHTML());
127 }
const IL_CAL_UNIX
const IL_CAL_DATETIME
Class ilChatroomFormFactory.
static applyValues(ilPropertyFormGUI $form, array $values)
Applies given values to field in given form.
static checkUserPermissions($permissions, int $ref_id, bool $send_info=true)
Checks user permissions by given array and ref_id.
static byObjectId(int $object_id)
Class ilCtrl provides processing control methods.
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
@inheritDoc
getFormAction(object $a_gui_obj, string $a_fallback_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
setParameterByClass(string $a_class, string $a_parameter, $a_value)
@inheritDoc
@classDescription Date and time handling
setFormAction(string $a_formaction)
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const ROOT_FOLDER_ID
Definition: constants.php:32
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200

References ILIAS\LTI\ToolProvider\$settings, ilChatroomFormFactory\applyValues(), ilChatroom\byObjectId(), ilChatroom\checkUserPermissions(), ilCtrl\getFormAction(), IL_CAL_DATETIME, IL_CAL_UNIX, ilCtrl\redirectByClass(), ROOT_FOLDER_ID, and ilCtrl\setParameterByClass().

Referenced by executeDefault().

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