19 declare(strict_types=1);
33 $this->
ilCtrl->redirectByClass(ilRepositoryGUI::class);
38 $settingsForm = $formFactory->getSettingsForm(
45 $result = (new \ILIAS\Data\Factory())->error($this->ilLng->txt(
'form_input_not_valid'));
46 if ($this->
http->request()->getMethod() ===
'POST') {
47 $settingsForm = $settingsForm->withRequest($this->
http->request());
48 $result = $settingsForm->getInputGroup()->getContent();
51 if (!$result->isOK()) {
52 $this->mainTpl->setOnScreenMessage(
'failure', $result->error());
57 $values = $result->value();
59 $this->gui->getObject()->getObjectProperties()->storePropertyTitleAndDescription(
62 $this->gui->getObject()->getObjectProperties()->storePropertyIsOnline(
65 $this->gui->getObject()->getObjectProperties()->storePropertyTileImage(
70 $mutated_settings = $room->getSettings();
73 $mutated_settings[
'object_id'] = $this->gui->getObject()->getId();
76 foreach ($mutated_settings as $setting => &$value) {
78 $value = is_array($values[$setting] ??
null);
81 } elseif (array_key_exists($setting, $values)) {
82 $value = $values[$setting];
87 $room->saveSettings($mutated_settings);
89 $this->mainTpl->setOnScreenMessage(
'success', $this->ilLng->txt(
'saved_successfully'),
true);
90 $this->
ilCtrl->redirect($this->gui,
'settings-general');
97 $this->
ilCtrl->redirectByClass(ilRepositoryGUI::class);
100 $chatSettings =
new ilSetting(
'chatroom');
101 if (!$chatSettings->get(
'chat_enabled',
'0')) {
102 $this->mainTpl->setOnScreenMessage(
'info', $this->ilLng->txt(
'server_disabled'),
true);
105 $this->gui->switchToVisibleMode();
111 if ($settingsForm ===
null) {
113 'title' => $this->gui->getObject()->getTitle(),
114 'desc' => $this->gui->getObject()->getDescription(),
117 $settings = array_merge($settings, $room->getSettings());
120 $settingsForm = $formFactory->getSettingsForm(
128 $this->mainTpl->setVariable(
'ADM_CONTENT', $this->uiRenderer->render($settingsForm));
static checkUserPermissions($permissions, int $ref_id, bool $send_info=true)
Checks user permissions by given array and ref_id.
Class ilChatroomSettingsGUI.
Interface Observer Contains several chained tasks and infos about them.
executeDefault(string $requestedMethod)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static http()
Fetches the global http state from ILIAS.
Class ilChatroomGUIHandler.
general(?\ILIAS\UI\Component\Input\Container\Form\Form $settingsForm=null)
static byObjectId(int $object_id)