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';
34 $settingsForm = $formFactory->getSettingsForm();
36 if (!$settingsForm->checkInput()) {
37 $settingsForm->setValuesByPost();
40 $this->gui->object->setTitle($settingsForm->getInput(
'title'));
41 $this->gui->object->setDescription($settingsForm->getInput(
'desc'));
43 require_once
'Services/Object/classes/class.ilObjectActivation.php';
45 $period = $settingsForm->getItemByPostVar(
'access_period');
46 if ($period->getStart() && $period->getEnd()) {
48 $this->gui->object->setAccessBegin($period->getStart()->get(
IL_CAL_UNIX));
49 $this->gui->object->setAccessEnd($period->getEnd()->get(
IL_CAL_UNIX));
50 $this->gui->object->setAccessVisibility((
int) $settingsForm->getInput(
'access_visibility'));
55 $this->gui->object->update();
58 $room = ilChatRoom::byObjectId($this->gui->object->getId());
61 $room =
new ilChatRoom();
62 $settings[
'object_id'] = $this->gui->object->getId();
64 $room->saveSettings($settings);
66 ilUtil::sendSuccess($this->ilLng->txt(
'saved_successfully'),
true);
80 ), $this->gui->ref_id)
86 $chatSettings =
new ilSetting(
'chatroom');
87 if (!$chatSettings->get(
'chat_enabled')) {
91 $this->gui->switchToVisibleMode();
95 $room = ilChatRoom::byObjectId($this->gui->object->getId());
98 $settingsForm = $formFactory->getSettingsForm();
100 require_once
'Services/Object/classes/class.ilObjectActivation.php';
102 'title' => $this->gui->object->getTitle(),
103 'desc' => $this->gui->object->getDescription(),
104 'access_period' => array(
105 'start' => $this->gui->object->getAccessBegin() ?
new ilDateTime($this->gui->object->getAccessBegin(),
IL_CAL_UNIX) : null,
106 'end' => $this->gui->object->getAccessEnd() ?
new ilDateTime($this->gui->object->getAccessEnd(),
IL_CAL_UNIX) : null
108 'access_visibility' => $this->gui->object->getAccessVisibility()
114 array_merge($settings, $room->getSettings())
121 $settingsForm->setTitle($this->ilLng->txt(
'settings_title'));
122 $settingsForm->addCommandButton(
'settings-saveGeneral', $this->ilLng->txt(
'save'));
123 $settingsForm->setFormAction($this->
ilCtrl->
getFormAction($this->gui,
'settings-saveGeneral'));
125 $this->mainTpl->setVariable(
'ADM_CONTENT', $settingsForm->getHtml());
This class provides processing control methods.
Class ilChatroomSettingsGUI.
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.
redirectByClass($a_class, $a_cmd="", $a_anchor="", $a_asynch=false)
Redirect to other gui class using class name.
Class ilChatroomGUIHandler.
general(ilPropertyFormGUI $settingsForm=null)
Prepares and displays settings form.
setParameterByClass($a_class, $a_parameter, $a_value)
Same as setParameterByClass, except that a class name is passed.
saveGeneral()
Saves settings fetched from $_POST.
redirect($a_gui_obj, $a_cmd="", $a_anchor="", $a_asynch=false)
Redirect to another command.
getFormAction( $a_gui_obj, $a_fallback_cmd="", $a_anchor="", $a_asynch=false, $xml_style=true)
Get form action url for gui class object.