ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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)

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

References general().

129  : void
130  {
131  $this->general();
132  }
general(ilPropertyFormGUI $settingsForm=null)
+ Here is the call graph for this function:

◆ general()

ilChatroomSettingsGUI::general ( ilPropertyFormGUI  $settingsForm = null)

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

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

Referenced by executeDefault().

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  }
static checkUserPermissions($permissions, int $ref_id, bool $send_info=true)
Checks user permissions by given array and ref_id.
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200
const IL_CAL_DATETIME
const ROOT_FOLDER_ID
Definition: constants.php:32
const IL_CAL_UNIX
Class ilChatroomFormFactory.
setFormAction(string $a_formaction)
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
static byObjectId(int $object_id)
static applyValues(ilPropertyFormGUI $form, array $values)
Applies given values to field in given form.
+ 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: