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();
68 $settingsForm = $formFactory->getSettingsForm();
71 $room = ilChatRoom::byObjectId($this->gui->object->getId());
74 'title' => $this->gui->object->getTitle(),
75 'desc' => $this->gui->object->getDescription(),
81 $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())
116 $this->gui->object->setTitle($settingsForm->getInput(
'title'));
117 $this->gui->object->setDescription($settingsForm->getInput(
'desc'));
118 $this->gui->object->update();
121 $room = ilChatRoom::byObjectId($this->gui->object->getId());
125 $room =
new ilChatRoom();
126 $settings[
'object_id'] = $this->gui->object->getId();
128 $room->saveSettings($settings);
131 $ilCtrl->redirect($this->gui,
'settings-general');