1 |
efrain |
1 |
<?php
|
|
|
2 |
// This file is part of Moodle - http://moodle.org/
|
|
|
3 |
//
|
|
|
4 |
// Moodle is free software: you can redistribute it and/or modify
|
|
|
5 |
// it under the terms of the GNU General Public License as published by
|
|
|
6 |
// the Free Software Foundation, either version 3 of the License, or
|
|
|
7 |
// (at your option) any later version.
|
|
|
8 |
//
|
|
|
9 |
// Moodle is distributed in the hope that it will be useful,
|
|
|
10 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
11 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
12 |
// GNU General Public License for more details.
|
|
|
13 |
//
|
|
|
14 |
// You should have received a copy of the GNU General Public License
|
|
|
15 |
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
16 |
|
|
|
17 |
defined('MOODLE_INTERNAL') || die;
|
|
|
18 |
|
|
|
19 |
if ($ADMIN->fulltree) {
|
|
|
20 |
$settings->add(new admin_setting_heading('chat_method_heading', get_string('generalconfig', 'chat'),
|
|
|
21 |
get_string('explaingeneralconfig', 'chat')));
|
|
|
22 |
|
|
|
23 |
$options = array();
|
|
|
24 |
$options['ajax'] = get_string('methodajax', 'chat');
|
|
|
25 |
$options['header_js'] = get_string('methodnormal', 'chat');
|
|
|
26 |
$options['sockets'] = get_string('methoddaemon', 'chat');
|
|
|
27 |
$settings->add(new admin_setting_configselect('chat_method', get_string('method', 'chat'),
|
|
|
28 |
get_string('configmethod', 'chat'), 'ajax', $options));
|
|
|
29 |
|
|
|
30 |
$settings->add(new admin_setting_configtext('chat_refresh_userlist', get_string('refreshuserlist', 'chat'),
|
|
|
31 |
get_string('configrefreshuserlist', 'chat'), 10, PARAM_INT));
|
|
|
32 |
|
|
|
33 |
$settings->add(new admin_setting_configtext('chat_old_ping', get_string('oldping', 'chat'),
|
|
|
34 |
get_string('configoldping', 'chat'), 35, PARAM_INT));
|
|
|
35 |
|
|
|
36 |
$settings->add(new admin_setting_heading('chat_normal_heading', get_string('methodnormal', 'chat'),
|
|
|
37 |
get_string('explainmethodnormal', 'chat')));
|
|
|
38 |
|
|
|
39 |
$settings->add(new admin_setting_configtext('chat_refresh_room', get_string('refreshroom', 'chat'),
|
|
|
40 |
get_string('configrefreshroom', 'chat'), 5, PARAM_INT));
|
|
|
41 |
|
|
|
42 |
$options = array();
|
|
|
43 |
$options['jsupdate'] = get_string('normalkeepalive', 'chat');
|
|
|
44 |
$options['jsupdated'] = get_string('normalstream', 'chat');
|
|
|
45 |
$settings->add(new admin_setting_configselect('chat_normal_updatemode', get_string('updatemethod', 'chat'),
|
|
|
46 |
get_string('confignormalupdatemode', 'chat'), 'jsupdate', $options));
|
|
|
47 |
|
|
|
48 |
$settings->add(new admin_setting_heading('chat_daemon_heading', get_string('methoddaemon', 'chat'),
|
|
|
49 |
get_string('explainmethoddaemon', 'chat')));
|
|
|
50 |
|
|
|
51 |
$settings->add(new admin_setting_configtext('chat_serverhost', get_string('serverhost', 'chat'),
|
|
|
52 |
get_string('configserverhost', 'chat'), get_host_from_url($CFG->wwwroot)));
|
|
|
53 |
|
|
|
54 |
$settings->add(new admin_setting_configtext('chat_serverip', get_string('serverip', 'chat'),
|
|
|
55 |
get_string('configserverip', 'chat'), '127.0.0.1'));
|
|
|
56 |
|
|
|
57 |
$settings->add(new admin_setting_configtext('chat_serverport', get_string('serverport', 'chat'),
|
|
|
58 |
get_string('configserverport', 'chat'), 9111, PARAM_INT));
|
|
|
59 |
|
|
|
60 |
$settings->add(new admin_setting_configtext('chat_servermax', get_string('servermax', 'chat'),
|
|
|
61 |
get_string('configservermax', 'chat'), 100, PARAM_INT));
|
|
|
62 |
}
|