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';
39 $settingsForm = $formFactory->getSettingsForm();
40 $this->obj_service->commonSettings()->legacyForm($settingsForm, $this->gui->object)->addTileImage();
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();
62 $this->obj_service->commonSettings()->legacyForm($settingsForm, $this->gui->object)->saveTileImage();
65 $room = ilChatRoom::byObjectId($this->gui->object->getId());
68 $room =
new ilChatRoom();
69 $settings[
'object_id'] = $this->gui->object->getId();
71 $room->saveSettings($settings);
73 ilUtil::sendSuccess($this->ilLng->txt(
'saved_successfully'),
true);
88 ), $this->gui->ref_id)
94 $chatSettings =
new ilSetting(
'chatroom');
95 if (!$chatSettings->get(
'chat_enabled')) {
99 $this->gui->switchToVisibleMode();
103 $room = ilChatRoom::byObjectId($this->gui->object->getId());
105 if (!$settingsForm) {
106 $settingsForm = $formFactory->getSettingsForm();
108 require_once
'Services/Object/classes/class.ilObjectActivation.php';
110 'title' => $this->gui->object->getTitle(),
111 'desc' => $this->gui->object->getDescription(),
112 'access_period' => array(
113 'start' => $this->gui->object->getAccessBegin() ?
new ilDateTime(
114 $this->gui->object->getAccessBegin(),
117 'end' => $this->gui->object->getAccessEnd() ?
new ilDateTime(
118 $this->gui->object->getAccessEnd(),
122 'access_visibility' => $this->gui->object->getAccessVisibility()
126 $presentationHeader->setTitle($this->ilLng->txt(
'settings_presentation_header'));
127 $settingsForm->addItem($presentationHeader);
128 $this->obj_service->commonSettings()->legacyForm($settingsForm, $this->gui->object)->addTileImage();
133 array_merge($settings, $room->getSettings())
140 $settingsForm->setTitle($this->ilLng->txt(
'settings_title'));
141 $settingsForm->addCommandButton(
'settings-saveGeneral', $this->ilLng->txt(
'save'));
142 $settingsForm->setFormAction($this->
ilCtrl->
getFormAction($this->gui,
'settings-saveGeneral'));
144 $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.
getFormAction( $a_gui_obj, $a_fallback_cmd="", $a_anchor="", $a_asynch=false, $xml_style=false)
Get form action url for gui class object.
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.
__construct(Container $dic, ilPlugin $plugin)
saveGeneral()
Saves settings fetched from $_POST.
redirect($a_gui_obj, $a_cmd="", $a_anchor="", $a_asynch=false)
Redirect to another command.