-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsettings.php
More file actions
115 lines (100 loc) · 3.67 KB
/
settings.php
File metadata and controls
115 lines (100 loc) · 3.67 KB
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
<?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/>.
/**
* Settings for BbCo mailing.
*
* @package local_bbcomailing
* @copyright 2026 David Herney @ BambuCo
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
use core\url as moodle_url;
defined('MOODLE_INTERNAL') || die();
if ($hassiteconfig) {
// Category to group settings and management pages.
$ADMIN->add(
'localplugins',
new admin_category('local_bbcomailing_cat', get_string('pluginname', 'local_bbcomailing'))
);
// Settings page.
$generalsettings = new admin_settingpage(
'local_bbcomailing_settings',
get_string('settings'),
'local/bbcomailing:manage'
);
$generalsettings->add(new admin_setting_configtext(
'local_bbcomailing/batchsize',
get_string('batchsize', 'local_bbcomailing'),
get_string('batchsize_desc', 'local_bbcomailing'),
50,
PARAM_INT
));
$generalsettings->add(new admin_setting_configtext(
'local_bbcomailing/senddelay',
get_string('senddelay', 'local_bbcomailing'),
get_string('senddelay_desc', 'local_bbcomailing'),
30,
PARAM_INT
));
$generalsettings->add(new admin_setting_configtext(
'local_bbcomailing/emailthrottle',
get_string('emailthrottle', 'local_bbcomailing'),
get_string('emailthrottle_desc', 'local_bbcomailing'),
1,
PARAM_INT
));
$generalsettings->add(new admin_setting_configtext(
'local_bbcomailing/maxrecipients',
get_string('maxrecipients', 'local_bbcomailing'),
get_string('maxrecipients_desc', 'local_bbcomailing'),
100,
PARAM_INT
));
$generalsettings->add(new admin_setting_configtext(
'local_bbcomailing/bouncethreshold',
get_string('bouncethreshold', 'local_bbcomailing'),
get_string('bouncethreshold_desc', 'local_bbcomailing'),
3,
PARAM_INT
));
$generalsettings->add(new admin_setting_configtext(
'local_bbcomailing/sendername',
get_string('sendername', 'local_bbcomailing'),
get_string('sendername_desc', 'local_bbcomailing'),
'',
PARAM_TEXT
));
$generalsettings->add(new admin_setting_configcheckbox(
'local_bbcomailing/allowrawhtml',
get_string('allowrawhtml', 'local_bbcomailing'),
get_string('allowrawhtml_desc', 'local_bbcomailing'),
0
));
$ADMIN->add('local_bbcomailing_cat', $generalsettings);
// Management page (templates + batches).
$ADMIN->add('local_bbcomailing_cat', new admin_externalpage(
'local_bbcomailing_manage',
get_string('manage', 'local_bbcomailing'),
new moodle_url('/local/bbcomailing/index.php'),
'local/bbcomailing:manage'
));
// Send emails page.
$ADMIN->add('local_bbcomailing_cat', new admin_externalpage(
'local_bbcomailing_send',
get_string('sendmails', 'local_bbcomailing'),
new moodle_url('/local/bbcomailing/send.php'),
'local/bbcomailing:manage'
));
}