-
Notifications
You must be signed in to change notification settings - Fork 3
/
settings.php
143 lines (121 loc) · 5.23 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
139
140
141
142
143
<?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/>.
/**
* Admin Settings
*
* @package block_enrolmenttimer
* @copyright LearningWorks Ltd 2016
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die;
if ($ADMIN->fulltree) {
require_once($CFG->dirroot . '/blocks/enrolmenttimer/locallib.php');
// General Settings.
$settings->add(new admin_setting_heading('notificationsheadinggeneral',
get_string('settings_general', 'block_enrolmenttimer'), ''));
$settings->add(new admin_setting_configcheckbox(
'enrolmenttimer/displayNothingNoDateSet',
get_string('displayNothingNoDateSet', 'block_enrolmenttimer'),
get_string('displayNothingNoDateSet_help', 'block_enrolmenttimer'),
1
));
$settings->add(new admin_setting_configcheckbox(
'enrolmenttimer/displayUnitLabels',
get_string('displayUnitLabels', 'block_enrolmenttimer'),
get_string('displayUnitLabels_help', 'block_enrolmenttimer'),
0
));
$settings->add(new admin_setting_configcheckbox(
'enrolmenttimer/forceTwoDigits',
get_string('forceTwoDigits', 'block_enrolmenttimer'),
get_string('forceTwoDigits_help', 'block_enrolmenttimer'),
1
));
$settings->add(new admin_setting_configcheckbox(
'enrolmenttimer/displayTextCounter',
get_string('displayTextCounter', 'block_enrolmenttimer'),
get_string('displayTextCounter_help', 'block_enrolmenttimer'),
1
));
$settings->add(new admin_setting_configcheckbox(
'enrolmenttimer/activecountdown',
get_string('activecountdown', 'block_enrolmenttimer'),
get_string('activecountdown_help', 'block_enrolmenttimer'),
1
));
$options = array_keys(block_enrolmenttimer_get_units());
$settings->add(new admin_setting_configmultiselect(
'enrolmenttimer/viewoptions',
get_string('viewoptions', 'block_enrolmenttimer'),
get_string('viewoptions_desc', 'block_enrolmenttimer'),
array_keys($options),
array_values($options)
));
// Enrolment Ending Alert Settings.
$settings->add(new admin_setting_heading('notificationsheadingalert',
get_string('settings_notifications_alert', 'block_enrolmenttimer'), ''));
$settings->add(new admin_setting_configcheckbox(
'enrolmenttimer/timeleftmessagechk',
get_string('timeleftmessagechk', 'block_enrolmenttimer'),
get_string('timeleftmessagechk_help', 'block_enrolmenttimer'),
0
));
$settings->add(new admin_setting_configtext(
'enrolmenttimer/daystoalertenrolmentend',
get_string('daystoalertenrolmentend', 'block_enrolmenttimer'),
get_string('daystoalertenrolmentend_help', 'block_enrolmenttimer'),
'10'
));
$settings->add(new admin_setting_configtext(
'enrolmenttimer/enrolmentemailsubject',
get_string('emailsubject', 'block_enrolmenttimer'),
get_string('emailsubject_help', 'block_enrolmenttimer'),
get_string('emailsubject_expiring_default', 'block_enrolmenttimer')
));
$settings->add(new admin_setting_confightmleditor(
'enrolmenttimer/timeleftmessage',
get_string('timeleftmessage', 'block_enrolmenttimer'),
get_string('timeleftmessage_help', 'block_enrolmenttimer'),
''
));
// Course Completed Message Settings.
$settings->add(new admin_setting_heading('notificationsheadingcompletion',
get_string('settings_notifications_completion', 'block_enrolmenttimer'), ''));
$settings->add(new admin_setting_configcheckbox(
'enrolmenttimer/completionsmessagechk',
get_string('completionsmessagechk', 'block_enrolmenttimer'),
get_string('completionsmessagechk_help', 'block_enrolmenttimer'),
0
));
$settings->add(new admin_setting_configtext(
'enrolmenttimer/completionpercentage',
get_string('completionpercentage', 'block_enrolmenttimer'),
get_string('completionpercentage_help', 'block_enrolmenttimer'),
'100'
));
$settings->add(new admin_setting_configtext(
'enrolmenttimer/completionemailsubject',
get_string('emailsubject', 'block_enrolmenttimer'),
get_string('emailsubject_help', 'block_enrolmenttimer'),
get_string('emailsubject_completion_default', 'block_enrolmenttimer')
));
$settings->add(new admin_setting_confightmleditor(
'enrolmenttimer/completionsmessage',
get_string('completionsmessage', 'block_enrolmenttimer'),
get_string('completionsmessage_help', 'block_enrolmenttimer'),
''
));
}