28 require_once
'Modules/Chatroom/classes/class.ilChatroomFormFactory.php';
29 require_once
'Modules/Chatroom/classes/class.ilChatroom.php';
30 require_once
'Modules/Chatroom/classes/class.ilChatroomInstaller.php';
49 ), $this->gui->ref_id)
52 $ilCtrl->setParameterByClass(
'ilrepositorygui',
'ref_id', ROOT_FOLDER_ID);
53 $ilCtrl->redirectByClass(
'ilrepositorygui',
'');
56 $chatSettings =
new ilSetting(
'chatroom');
57 if(!$chatSettings->get(
'chat_enabled'))
62 $this->gui->switchToVisibleMode();
66 $room = ilChatRoom::byObjectId($this->gui->object->getId());
70 $settingsForm = $formFactory->getSettingsForm();
73 'title' => $this->gui->object->getTitle(),
74 'desc' => $this->gui->object->getDescription(),
80 $settingsForm, array_merge($settings, $room->getSettings())
89 $settingsForm->setTitle($lng->txt(
'settings_title'));
90 $settingsForm->addCommandButton(
'settings-saveGeneral', $lng->txt(
'save'));
91 $settingsForm->setFormAction($ilCtrl->getFormAction($this->gui,
'settings-saveGeneral'));
93 $tpl->setVariable(
'ADM_CONTENT', $settingsForm->getHtml());
99 public function saveGeneral()
108 $settingsForm = $formFactory->getSettingsForm();
110 if(!$settingsForm->checkInput())
112 $settingsForm->setValuesByPost();
117 $this->gui->object->setTitle($settingsForm->getInput(
'title'));
118 $this->gui->object->setDescription($settingsForm->getInput(
'desc'));
119 $this->gui->object->update();
122 $room = ilChatRoom::byObjectId($this->gui->object->getId());
126 $room =
new ilChatRoom();
127 $settings[
'object_id'] = $this->gui->object->getId();
129 $room->saveSettings($settings);
132 $ilCtrl->redirect($this->gui,
'settings-general');
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static checkUserPermissions($permissions, $ref_id, $send_info=true)
Checks user permissions by given array and ref_id.
__construct(ilChatroomObjectGUI $gui)
Constructor Requires ilChatroomFormFactory, ilChatroom and ilChatroomInstaller, sets $this->gui using...
Class ilChatroomSettingsTask.
executeDefault($requestedMethod)
$errors general
Prepares and displays settings form.