4 require_once
'Modules/Chatroom/classes/class.ilChatroom.php';
5 require_once
'Modules/Chatroom/classes/class.ilChatroomFormFactory.php';
6 require_once
'Modules/Chatroom/classes/class.ilChatroomAdmin.php';
7 require_once
'Modules/Chatroom/classes/class.ilChatroomConfigFileHandler.php';
39 parent::__construct($gui);
40 $this->commonSettings =
new ilSetting(
'common');
58 $form = $factory->getGeneralSettingsForm();
60 if(!$form->checkInput())
62 $form->setValuesByPost();
68 'protocol' => $form->getInput(
'protocol'),
69 'port' => $form->getInput(
'port'),
70 'address' => $form->getInput(
'address'),
71 'cert' => $form->getInput(
'cert'),
72 'key' => $form->getInput(
'key'),
73 'dhparam' => $form->getInput(
'dhparam'),
74 'log' => $form->getInput(
'log'),
75 'error_log' => $form->getInput(
'error_log'),
76 'ilias_proxy' => $form->getInput(
'ilias_proxy'),
77 'ilias_url' => $form->getInput(
'ilias_url'),
78 'client_proxy' => $form->getInput(
'client_proxy'),
79 'client_url' => $form->getInput(
'client_url'),
80 'sub_directory'=> $form->getInput(
'sub_directory'),
81 'deletion_mode'=> $form->getInput(
'deletion_mode'),
82 'deletion_unit'=> $form->getInput(
'deletion_unit'),
83 'deletion_value'=> $form->getInput(
'deletion_value'),
84 'deletion_time' => $form->getInput(
'deletion_time'),
88 $adminSettings->saveGeneralSettings((
object)$settings);
91 $fileHandler->createServerConfigFile($settings);
106 $this->gui->switchToVisibleMode();
109 $serverSettings = $adminSettings->loadGeneralSettings();
114 $form = $factory->getGeneralSettingsForm();
115 $form->setValuesByArray($serverSettings);
120 $form->setTitle($this->ilLng->txt(
'chatserver_settings_title'));
121 $form->addCommandButton(
'view-saveSettings', $this->ilLng->txt(
'save'));
125 $this->ilTpl->setVariable(
'ADM_CONTENT', $settingsTpl->get());
133 $chatSettings =
new ilSetting(
'chatroom');
134 if($chatSettings->get(
'chat_enabled',
false))
172 require_once
'Modules/Chatroom/classes/class.ilChatroomInstaller.php';
173 ilChatroomInstaller::ensureCorrectPublicChatroomTreeLocation(
$ref_id);
181 require_once
'Modules/Chatroom/classes/class.ilChatroomInstaller.php';
182 ilChatroomInstaller::createDefaultPublicRoom(
true);
192 require_once
'Modules/Chatroom/classes/class.ilChatroomServerConnector.php';
195 $serverSettings[
'port'] &&
196 $serverSettings[
'address'] &&
210 $furtherInformation = sprintf($this->ilLng->txt(
'server_further_information'), $this->
getReadmePath());
211 $serverTpl =
new ilTemplate(
'tpl.chatroom_serversettings.html',
true,
true,
'Modules/Chatroom');
212 $serverTpl->setVariable(
'VAL_SERVERSETTINGS_FORM', $form->
getHTML());
213 $serverTpl->setVariable(
'LBL_SERVERSETTINGS_FURTHER_INFORMATION', $furtherInformation);
233 $form = $factory->getClientSettingsForm();
235 if(!$form->checkInput())
237 $form->setValuesByPost();
243 'name' => (
string)$form->getInput(
'client_name'),
244 'enable_osd' => (boolean)$form->getInput(
'enable_osd'),
245 'enable_osc' => (boolean)$form->getInput(
'enable_osc'),
246 'osd_intervall' => (int)$form->getInput(
'osd_intervall'),
247 'chat_enabled' => ((boolean)$form->getInput(
'chat_enabled')),
248 'enable_smilies' => (
boolean)$form->getInput(
'enable_smilies'),
249 'play_invitation_sound' => (boolean)$form->getInput(
'play_invitation_sound'),
250 'auth' => $form->getInput(
'auth')
253 if (!$settings[
'chat_enabled']) {
254 $settings[
'enable_osc'] =
false;
257 $notificationSettings =
new ilSetting(
'notifications');
258 $notificationSettings->set(
'osd_polling_intervall', (
int)$form->getInput(
'osd_intervall'));
259 $notificationSettings->set(
'enable_osd', (
boolean)$form->getInput(
'enable_osd'));
261 $chatSettings =
new ilSetting(
'chatroom');
262 $chatSettings->set(
'chat_enabled', $settings[
'chat_enabled']);
263 $chatSettings->set(
'enable_osc', $settings[
'enable_osc']);
264 $chatSettings->set(
'play_invitation_sound', (
boolean)$form->getInput(
'play_invitation_sound'));
267 $adminSettings->saveClientSettings((
object)$settings);
270 $fileHandler->createClientConfigFile($settings);
284 $this->gui->switchToVisibleMode();
287 $serverSettings = $adminSettings->loadGeneralSettings();
291 $clientSettings = $adminSettings->loadClientSettings();
293 $form = $factory->getClientSettingsForm();
294 $form->setValuesByArray($clientSettings);
299 $form->setTitle($this->ilLng->txt(
'general_settings_title'));
300 $form->addCommandButton(
'view-saveClientSettings', $this->ilLng->txt(
'save'));
304 $this->ilTpl->setVariable(
'ADM_CONTENT', $settingsTpl->get());
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Class ilChatroomAdminViewGUI.
This class provides processing control methods.
static _hasUntrashedReference($a_obj_id)
checks wether an object has at least one reference that is not in trash
createPublicRoom()
Creates a public chatroom.
saveClientSettings()
Saves client settings fetched from $_POST.
checkServerConnection(array $serverSettings)
Checks for server connection.
executeDefault($method)
{}
clientsettings(ilPropertyFormGUI $form=null)
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.
static checkServerConnection($use_cache=true)
static _lookupObjId($a_id)
getFormAction($a_gui_obj, $a_fallback_cmd="", $a_anchor="", $a_asynch=false, $xml_style=true)
Get form action url for gui class object.
special template class to simplify handling of ITX/PEAR
getReadmePath()
Get the path to the README.txt file.
const CHATROOM_README_PATH
Create styles array
The data for the language used.
serversettings(ilPropertyFormGUI $form=null)
Prepares view form and displays it.
__construct(ilChatroomObjectGUI $gui)
Constructor.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
saveSettings()
Saves settings fetched from $_POST.
createSettingTemplate(ilPropertyFormGUI $form)
redirect($a_gui_obj, $a_cmd="", $a_anchor="", $a_asynch=false)
Redirect to another command.