-
Notifications
You must be signed in to change notification settings - Fork 3
/
settings.php
70 lines (55 loc) · 2.02 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
<?php
// 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'));
$allow = quickmail::_s('allowstudents');
$settings->add(
new admin_setting_configselect('block_quickmail_allowstudents',
$allow, $allow, 0, $select
)
);
$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
)
);
$groupoptions = array(
'strictferpa' => get_string('strictferpa', 'block_quickmail'),
'courseferpa' => get_string('courseferpa', 'block_quickmail'),
'noferpa' => get_string('noferpa', 'block_quickmail')
);
$settings->add(
new admin_setting_configselect('block_quickmail_ferpa',
quickmail::_s('ferpa'), quickmail::_s('ferpa_desc'),
'strictferpa', $groupoptions
)
);
}