forked from lsuits/lsu-block_quickmail
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.php
63 lines (52 loc) · 2.06 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
<?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/>.
// Written at Louisiana State University.
defined('MOODLE_INTERNAL') || die;
if ($ADMIN->fulltree) {
require_once($CFG->dirroot . '/blocks/quickmail/lib.php');
$select = array(0 => get_string('no'), 1 => get_string('yes'));
$roles = $DB->get_records('role', null, 'sortorder ASC');
$default_sns = array('editingteacher', 'teacher', 'student');
$defaults = array_filter($roles, function ($role) use ($default_sns) {
return in_array($role->shortname, $default_sns);
});
$only_names = function ($role) { return $role->shortname; };
$select_roles = quickmail::_s('select_roles');
$settings->add(
new admin_setting_configmultiselect('block_quickmail_roleselection',
$select_roles, $select_roles,
array_keys($defaults),
array_map($only_names, $roles)
)
);
$settings->add(
new admin_setting_configselect('block_quickmail_receipt',
quickmail::_s('receipt'), quickmail::_s('receipt_help'),
0, $select
)
);
$options = array(
0 => get_string('none'),
'idnumber' => get_string('idnumber'),
'shortname' => get_string('shortname')
);
$settings->add(
new admin_setting_configselect('block_quickmail_prepend_class',
quickmail::_s('prepend_class'), quickmail::_s('prepend_class_desc'),
0, $options
)
);
}