31 require_once
'Modules/Chatroom/classes/class.ilChatroomFormFactory.php';
32 require_once
'Modules/Chatroom/classes/class.ilChatroom.php';
33 require_once
'Modules/Chatroom/classes/class.ilChatroomInstaller.php';
54 $chatSettings =
new ilSetting(
'chatroom');
55 if( !$chatSettings->get(
'chat_enabled') )
60 $this->gui->switchToVisibleMode();
66 $settingsForm = $formFactory->getSettingsForm();
69 $room = ilChatRoom::byObjectId( $this->gui->object->getId() );
72 'title' => $this->gui->object->getTitle(),
73 '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->addCommandButton(
'settings-general', $lng->txt(
'cancel' ) );
92 $settingsForm->setFormAction(
93 $ilCtrl->getFormAction( $this->gui,
'settings-saveGeneral' )
96 $tpl->setVariable(
'ADM_CONTENT', $settingsForm->getHtml() );
109 $settingsForm = $formFactory->getSettingsForm();
111 if( !$settingsForm->checkInput() )
113 $this->
general( $settingsForm );
117 $this->gui->object->setTitle(
$_POST[
'title'] );
118 $this->gui->object->setDescription(
$_POST[
'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();
130 $room->saveSettings( $settings );
134 $ilCtrl->redirect( $this->gui,
'settings-general' );