-
Notifications
You must be signed in to change notification settings - Fork 9
/
settings.php
107 lines (91 loc) · 5.33 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
<?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/>.
/**
* Block "People" - Settings
*
* @package block_people
* @copyright 2017 Kathrin Osswald, Ulm University <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
if ($ADMIN->fulltree) {
global $CFG;
// Locallib for updatedcallback function.
require_once($CFG->dirroot.'/blocks/people/locallib.php');
// Settings title to group role related settings together with a common heading. We don't want a description here.
$name = 'block_people/rolesheading';
$title = get_string('setting_rolesheading', 'block_people', null, true);
$setting = new admin_setting_heading($name, $title, '');
$settings->add($setting);
// Setting to configure the roles to be shown within the block.
$name = 'block_people/roles';
$title = get_string('setting_roles', 'block_people', null, true);
$description = get_string('setting_roles_desc', 'block_people', null, true);
$default = ['editingteacher'];
$settings->add(new admin_setting_pickroles($name, $title, $description, $default));
// Setting to show multiple roles within the block.
$name = 'block_people/multipleroles';
$title = get_string('setting_multipleroles', 'block_people', null, true);
$description = get_string('setting_multipleroles_desc', 'block_people', null, true);
$settings->add(new admin_setting_configcheckbox($name, $title, $description, 0));
// Settings title to group linking related settings together with a common heading. We don't want a description here.
$name = 'block_people/linkingheading';
$title = get_string('setting_linkingheading', 'block_people', null, true);
$setting = new admin_setting_heading($name, $title, '');
$settings->add($setting);
// Setting to add a link to the user's page onto the avatar.
$name = 'block_people/linkavatar';
$title = get_string('setting_linkavatar', 'block_people', null, true);
$description = get_string('setting_linkavatar_desc', 'block_people', null, true);
$settings->add(new admin_setting_configcheckbox($name, $title, $description, 1));
// Setting to add a link to the user's page onto the name.
$name = 'block_people/linkname';
$title = get_string('setting_linkname', 'block_people', null, true);
$description = get_string('setting_linkname_desc', 'block_people', null, true);
$settings->add(new admin_setting_configcheckbox($name, $title, $description, 0));
// Setting to add a link to the user's message system below the name.
$name = 'block_people/linkmessaging';
$title = get_string('setting_linkmessaging', 'block_people', null, true);
$description = get_string('setting_linkmessaging_desc', 'block_people', null, true);
$settings->add(new admin_setting_configcheckbox($name, $title, $description, 1));
// Settings title to group partictpants page related settings together with a common heading. We don't want a description here.
$name = 'block_people/participantspageheading';
$title = get_string('setting_participantspageheading', 'block_people', null, true);
$setting = new admin_setting_heading($name, $title, '');
$settings->add($setting);
// Setting to show link to the participants page within the block.
$name = 'block_people/linkparticipantspage';
$title = get_string('setting_linkparticipantspage', 'block_people', null, true);
$description = get_string('setting_linkparticipantspage_desc', 'block_people', null, true);
$settings->add(new admin_setting_configcheckbox($name, $title, $description, 1));
// Settings title to group hiding the block related settings together with a common heading. We don't want a description here.
$name = 'block_people/hideblockheading';
$title = get_string('setting_hideblockheading', 'block_people', null, true);
$setting = new admin_setting_heading($name, $title, '');
$settings->add($setting);
// Setting to disable the possibility to hide the block.
$name = 'block_people/hideblock';
$title = get_string('setting_hideblock', 'block_people', null, true);
$description = get_string('setting_hideblock_desc', 'block_people', null, true);
$settings->add(new admin_setting_configcheckbox($name, $title, $description, 1));
// Setting to make all people blocks visible again.
$name = 'block_people/resetvisibility';
$title = get_string('setting_resetvisibility', 'block_people', null, true);
$description = get_string('setting_resetvisibility_desc', 'block_people', null, true);
$setting = new admin_setting_configcheckbox($name, $title, $description, 0);
$setting->set_updatedcallback('block_people_reset_visibility');
$settings->add($setting);
}