forked from getsmarter/moodle-mod_groupselect
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.php
More file actions
106 lines (88 loc) · 5.24 KB
/
settings.php
File metadata and controls
106 lines (88 loc) · 5.24 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
<?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/>.
/**
* Group self selection module admin settings and defaults
*
* @package mod_groupselect
* @copyright 2018 HTW Chur Roger Barras
* @copyright 2008-2011 Petr Skoda (http://skodak.org)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die;
if ($ADMIN->fulltree) {
// -------------------------------------------------------
// Modedit defaults.
// -------------------------------------------------------
$settings->add(new admin_setting_heading('groupselectmodeditdefaults',
get_string('modeditdefaults', 'admin'),
get_string('condifmodeditdefaults', 'admin')));
$configroles = role_get_names(context_system::instance(), ROLENAME_ALIAS, true);
$neteacher = $DB->get_record( 'role', array('shortname' => "teacher"), '*');
$setid = ($neteacher) ? $neteacher->id : 4;
$settings->add(new admin_setting_configtext('groupselect/minmembers',
get_string('minmembers', 'mod_groupselect'),
get_string('minmembers_help', 'mod_groupselect'), 0, PARAM_INT));
$settings->add(new admin_setting_configtext('groupselect/maxmembers',
get_string('maxmembers', 'mod_groupselect'),
get_string('maxmembers_help', 'mod_groupselect'), 0, PARAM_INT));
$settings->add(new admin_setting_configtext('groupselect/maxgroupmembership',
get_string('maxgroupmembership', 'mod_groupselect'),
get_string('maxgroupmembership_help', 'mod_groupselect'), 1, PARAM_INT));
// -------------------------------------------------------
// Enable Permissions.
// -------------------------------------------------------
$settings->add(new admin_setting_heading('permissions', get_string('enablepermissions', 'mod_groupselect'), ''));
$settings->add(new admin_setting_configcheckbox('groupselect/studentcanjoin',
get_string('studentcanjoin', 'mod_groupselect'),
get_string('studentcanjoin_help', 'mod_groupselect'), 1));
$settings->add(new admin_setting_configcheckbox('groupselect/studentcanleave',
get_string('studentcanleave', 'mod_groupselect'),
get_string('studentcanleave_help', 'mod_groupselect'), 1));
$settings->add(new admin_setting_configcheckbox('groupselect/studentcancreate',
get_string('studentcancreate', 'mod_groupselect'),
get_string('studentcancreate_help', 'mod_groupselect'), 1));
$settings->add(new admin_setting_configcheckbox('groupselect/studentcansetgroupname',
get_string('studentcansetgroupname', 'mod_groupselect'),
get_string('studentcansetgroupname_help', 'mod_groupselect'), 1));
$settings->add(new admin_setting_configcheckbox('groupselect/studentcansetdesc',
get_string('studentcansetdesc', 'mod_groupselect'),
get_string('studentcansetdesc_help', 'mod_groupselect'), 1));
$settings->add(new admin_setting_configcheckbox('groupselect/studentcansetenrolmentkey',
get_string('studentcansetenrolmentkey', 'mod_groupselect'),
get_string('studentcansetenrolmentkey_help', 'mod_groupselect'), 0));
// -------------------------------------------------------
// Miscellaneous.
// -------------------------------------------------------
$settings->add(new admin_setting_heading('miscellaneous', get_string('miscellaneoussettings', 'mod_groupselect'), ''));
$settings->add(new admin_setting_configcheckbox('groupselect/assignteachers',
get_string('assigngroup', 'mod_groupselect'),
get_string('assigngroup_help', 'mod_groupselect'), 0));
$settings->add(new admin_setting_configselect('groupselect/supervisionrole',
get_string('supervisionrole', 'mod_groupselect'),
get_string('supervisionrole_help', 'mod_groupselect'), $setid, $configroles));
$settings->add(new admin_setting_configcheckbox('groupselect/showassignedteacher',
get_string('showassignedteacher', 'mod_groupselect'),
get_string('showassignedteacher_help', 'mod_groupselect'), 0));
$settings->add(new admin_setting_configcheckbox('groupselect/hidefullgroups',
get_string('hidefullgroups', 'mod_groupselect'),
get_string('hidefullgroups_help', 'mod_groupselect'), 0));
$settings->add(new admin_setting_configcheckbox('groupselect/notifyexpiredselection',
get_string('notifyexpiredselection', 'mod_groupselect'),
get_string('notifyexpiredselection_help', 'mod_groupselect'), 1));
$settings->add(new admin_setting_configcheckbox('groupselect/deleteemptygroups',
get_string('deleteemptygroups', 'mod_groupselect'),
get_string('deleteemptygroups_help', 'mod_groupselect'), 1));
}