21 parent::__construct($gui);
23 require_once
'Modules/Chatroom/classes/class.ilChatroomFormFactory.php';
24 require_once
'Modules/Chatroom/classes/class.ilChatroom.php';
25 require_once
'Modules/Chatroom/classes/class.ilChatroomInstaller.php';
31 public function saveGeneral()
40 $settingsForm = $formFactory->getSettingsForm();
42 if (!$settingsForm->checkInput()) {
43 $settingsForm->setValuesByPost();
46 $this->gui->object->setTitle($settingsForm->getInput(
'title'));
47 $this->gui->object->setDescription($settingsForm->getInput(
'desc'));
49 require_once
'Services/Object/classes/class.ilObjectActivation.php';
51 $period = $settingsForm->getItemByPostVar(
'access_period');
52 if ($period->getStart() && $period->getEnd()) {
54 $this->gui->object->setAccessBegin($period->getStart()->get(
IL_CAL_UNIX));
55 $this->gui->object->setAccessEnd($period->getEnd()->get(
IL_CAL_UNIX));
56 $this->gui->object->setAccessVisibility((
int) $settingsForm->getInput(
'access_visibility'));
61 $this->gui->object->update();
64 $room = ilChatRoom::byObjectId($this->gui->object->getId());
67 $room =
new ilChatRoom();
68 $settings[
'object_id'] = $this->gui->object->getId();
70 $room->saveSettings($settings);
73 $ilCtrl->redirect($this->gui,
'settings-general');
93 ), $this->gui->ref_id)
95 $ilCtrl->setParameterByClass(
'ilrepositorygui',
'ref_id', ROOT_FOLDER_ID);
96 $ilCtrl->redirectByClass(
'ilrepositorygui',
'');
99 $chatSettings =
new ilSetting(
'chatroom');
100 if (!$chatSettings->get(
'chat_enabled')) {
104 $this->gui->switchToVisibleMode();
108 $room = ilChatRoom::byObjectId($this->gui->object->getId());
110 if (!$settingsForm) {
111 $settingsForm = $formFactory->getSettingsForm();
113 require_once
'Services/Object/classes/class.ilObjectActivation.php';
115 'title' => $this->gui->object->getTitle(),
116 'desc' => $this->gui->object->getDescription(),
117 'access_period' =>
array(
118 'start' => $this->gui->object->getAccessBegin() ?
new ilDateTime($this->gui->object->getAccessBegin(),
IL_CAL_UNIX) : null,
119 'end' => $this->gui->object->getAccessEnd() ?
new ilDateTime($this->gui->object->getAccessEnd(),
IL_CAL_UNIX) : null
121 'access_visibility' => $this->gui->object->getAccessVisibility()
127 array_merge($settings, $room->getSettings())
134 $settingsForm->setTitle($lng->txt(
'settings_title'));
135 $settingsForm->addCommandButton(
'settings-saveGeneral', $lng->txt(
'save'));
136 $settingsForm->setFormAction($ilCtrl->getFormAction($this->gui,
'settings-saveGeneral'));
138 $tpl->setVariable(
'ADM_CONTENT', $settingsForm->getHtml());
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Class ilChatroomSettingsGUI.
$errors general
Prepares and displays settings form.
executeDefault($requestedMethod)
__construct(ilChatroomObjectGUI $gui)
Constructor Requires ilChatroomFormFactory, ilChatroom and ilChatroomInstaller, sets $this->gui using...
const TIMINGS_DEACTIVATED
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.
Class ilChatroomGUIHandler.
Create styles array
The data for the language used.