forked from catalyst/moodle-mod_facetoface
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.php
138 lines (117 loc) · 4.99 KB
/
settings.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Copyright (C) 2007-2011 Catalyst IT (http://www.catalyst.net.nz)
* Copyright (C) 2011-2013 Totara LMS (http://www.totaralms.com)
* Copyright (C) 2014 onwards Catalyst IT (http://www.catalyst-eu.net)
*
* @package mod
* @subpackage facetoface
* @copyright 2014 onwards Catalyst IT <http://www.catalyst-eu.net>
* @author Stacey Walker <[email protected]>
* @author Alastair Munro <[email protected]>
* @author Aaron Barnes <[email protected]>
* @author Francois Marier <[email protected]>
*/
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot . '/mod/facetoface/lib.php');
$settings->add(new admin_setting_configtext(
'facetoface_fromaddress',
get_string('setting:fromaddress_caption', 'facetoface'),
get_string('setting:fromaddress', 'facetoface'),
get_string('setting:fromaddressdefault', 'facetoface'),
"/^((?:[\w\.\-])+\@(?:(?:[a-zA-Z\d\-])+\.)+(?:[a-zA-Z\d]{2,4}))$/",
30
));
// Load roles.
$choices = array();
if ($roles = role_fix_names(get_all_roles(), context_system::instance())) {
foreach ($roles as $role) {
$choices[$role->id] = format_string($role->localname);
}
}
$settings->add(new admin_setting_configmultiselect(
'facetoface_session_roles',
get_string('setting:sessionroles_caption', 'facetoface'),
get_string('setting:sessionroles', 'facetoface'),
array(),
$choices
));
$settings->add(new admin_setting_heading(
'facetoface_manageremail_header',
get_string('manageremailheading', 'facetoface'),
''
));
$settings->add(new admin_setting_configcheckbox(
'facetoface_addchangemanageremail',
get_string('setting:addchangemanageremail_caption', 'facetoface'),
get_string('setting:addchangemanageremail', 'facetoface'),
0
));
$settings->add(new admin_setting_configtext(
'facetoface_manageraddressformat',
get_string('setting:manageraddressformat_caption', 'facetoface'),
get_string('setting:manageraddressformat', 'facetoface'),
get_string('setting:manageraddressformatdefault', 'facetoface'),
PARAM_TEXT
));
$settings->add(new admin_setting_configtext(
'facetoface_manageraddressformatreadable',
get_string('setting:manageraddressformatreadable_caption', 'facetoface'),
get_string('setting:manageraddressformatreadable', 'facetoface'),
get_string('setting:manageraddressformatreadabledefault', 'facetoface'),
PARAM_NOTAGS
));
$settings->add(new admin_setting_heading('facetoface_cost_header', get_string('costheading', 'facetoface'), ''));
$settings->add(new admin_setting_configcheckbox(
'facetoface_hidecost',
get_string('setting:hidecost_caption', 'facetoface'),
get_string('setting:hidecost', 'facetoface'),
0
));
$settings->add(new admin_setting_configcheckbox(
'facetoface_hidediscount',
get_string('setting:hidediscount_caption', 'facetoface'),
get_string('setting:hidediscount', 'facetoface'),
0
));
$settings->add(new admin_setting_heading('facetoface_icalendar_header', get_string('icalendarheading', 'facetoface'), ''));
$settings->add(new admin_setting_configcheckbox(
'facetoface_oneemailperday',
get_string('setting:oneemailperday_caption', 'facetoface'),
get_string('setting:oneemailperday', 'facetoface'),
0
));
$settings->add(new admin_setting_configcheckbox(
'facetoface_disableicalcancel',
get_string('setting:disableicalcancel_caption', 'facetoface'),
get_string('setting:disableicalcancel', 'facetoface'),
0
));
// List of existing custom fields.
$html = facetoface_list_of_customfields();
$html .= html_writer::start_tag('p');
$url = new moodle_url('/mod/facetoface/customfield.php', array('id' => 0));
$html .= html_writer::link($url, get_string('addnewfieldlink', 'facetoface'));
$html .= html_writer::end_tag('p');
$settings->add(new admin_setting_heading('facetoface_customfields_header', get_string('customfieldsheading', 'facetoface'), $html));
// List of existing site notices.
$html = facetoface_list_of_sitenotices();
$html .= html_writer::start_tag('p');
$url = new moodle_url('/mod/facetoface/sitenotice.php', array('id' => 0));
$html .= html_writer::link($url, get_string('addnewnoticelink', 'facetoface'));
$html .= html_writer::end_tag('p');
$settings->add(new admin_setting_heading('facetoface_sitenotices_header', get_string('sitenoticesheading', 'facetoface'), $html));