Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
<?php
2
// This file is part of Moodle - http://moodle.org/
3
//
4
// Moodle is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
8
//
9
// Moodle is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
// GNU General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
16
 
17
/**
18
 * Block "People" - Settings
19
 *
20
 * @package    block_people
21
 * @copyright  2017 Kathrin Osswald, Ulm University <kathrin.osswald@uni-ulm.de>
22
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23
 */
24
 
25
defined('MOODLE_INTERNAL') || die();
26
 
27
if ($ADMIN->fulltree) {
28
    global $CFG;
29
    // Locallib for updatedcallback function.
30
    require_once($CFG->dirroot.'/blocks/people/locallib.php');
31
 
32
    // Settings title to group role related settings together with a common heading. We don't want a description here.
33
    $name = 'block_people/rolesheading';
34
    $title = get_string('setting_rolesheading', 'block_people', null, true);
35
    $setting = new admin_setting_heading($name, $title, '');
36
    $settings->add($setting);
37
 
38
    // Setting to configure the roles to be shown within the block.
39
    $name = 'block_people/roles';
40
    $title = get_string('setting_roles', 'block_people', null, true);
41
    $description = get_string('setting_roles_desc', 'block_people', null, true);
42
    $default = ['editingteacher'];
43
    $settings->add(new admin_setting_pickroles($name, $title, $description, $default));
44
 
45
    // Setting to show multiple roles within the block.
46
    $name = 'block_people/multipleroles';
47
    $title = get_string('setting_multipleroles', 'block_people', null, true);
48
    $description = get_string('setting_multipleroles_desc', 'block_people', null, true);
49
    $settings->add(new admin_setting_configcheckbox($name, $title, $description, 0));
50
 
51
    // Settings title to group linking related settings together with a common heading. We don't want a description here.
52
    $name = 'block_people/linkingheading';
53
    $title = get_string('setting_linkingheading', 'block_people', null, true);
54
    $setting = new admin_setting_heading($name, $title, '');
55
    $settings->add($setting);
56
 
57
    // Setting to add a link to the user's page onto the avatar.
58
    $name = 'block_people/linkavatar';
59
    $title = get_string('setting_linkavatar', 'block_people', null, true);
60
    $description = get_string('setting_linkavatar_desc', 'block_people', null, true);
61
    $settings->add(new admin_setting_configcheckbox($name, $title, $description, 1));
62
 
63
    // Setting to add a link to the user's page onto the name.
64
    $name = 'block_people/linkname';
65
    $title = get_string('setting_linkname', 'block_people', null, true);
66
    $description = get_string('setting_linkname_desc', 'block_people', null, true);
67
    $settings->add(new admin_setting_configcheckbox($name, $title, $description, 0));
68
 
69
    // Setting to add a link to the user's message system below the name.
70
    $name = 'block_people/linkmessaging';
71
    $title = get_string('setting_linkmessaging', 'block_people', null, true);
72
    $description = get_string('setting_linkmessaging_desc', 'block_people', null, true);
73
    $settings->add(new admin_setting_configcheckbox($name, $title, $description, 1));
74
 
75
    // Settings title to group partictpants page related settings together with a common heading. We don't want a description here.
76
    $name = 'block_people/participantspageheading';
77
    $title = get_string('setting_participantspageheading', 'block_people', null, true);
78
    $setting = new admin_setting_heading($name, $title, '');
79
    $settings->add($setting);
80
 
81
    // Setting to show link to the participants page within the block.
82
    $name = 'block_people/linkparticipantspage';
83
    $title = get_string('setting_linkparticipantspage', 'block_people', null, true);
84
    $description = get_string('setting_linkparticipantspage_desc', 'block_people', null, true);
85
    $settings->add(new admin_setting_configcheckbox($name, $title, $description, 1));
86
 
87
    // Settings title to group hiding the block related settings together with a common heading. We don't want a description here.
88
    $name = 'block_people/hideblockheading';
89
    $title = get_string('setting_hideblockheading', 'block_people', null, true);
90
    $setting = new admin_setting_heading($name, $title, '');
91
    $settings->add($setting);
92
 
93
    // Setting to disable the possibility to hide the block.
94
    $name = 'block_people/hideblock';
95
    $title = get_string('setting_hideblock', 'block_people', null, true);
96
    $description = get_string('setting_hideblock_desc', 'block_people', null, true);
97
    $settings->add(new admin_setting_configcheckbox($name, $title, $description, 1));
98
 
99
    // Setting to make all people blocks visible again.
100
    $name = 'block_people/resetvisibility';
101
    $title = get_string('setting_resetvisibility', 'block_people', null, true);
102
    $description = get_string('setting_resetvisibility_desc', 'block_people', null, true);
103
    $setting = new admin_setting_configcheckbox($name, $title, $description, 0);
104
    $setting->set_updatedcallback('block_people_reset_visibility');
105
    $settings->add($setting);
106
}
107