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
 * unilabel type course teaser.
19
 *
20
 * @package     unilabeltype_courseteaser
21
 * @author      Andreas Grabs <info@grabs-edv.de>
22
 * @copyright   2018 onwards Grabs EDV {@link https://www.grabs-edv.de}
23
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
24
 */
25
defined('MOODLE_INTERNAL') || die;
26
 
27
$page = new admin_settingpage('unilabeltype_courseteaser', get_string('pluginname', 'unilabeltype_courseteaser'));
28
 
29
$courseteasersettings = [];
30
 
31
$courseteasersettings[] = new admin_setting_configcheckbox('unilabeltype_courseteaser/active',
32
    get_string('active'),
33
    '',
34
    true
35
);
36
 
37
$courseteasersettings[] = new admin_setting_configcheckbox('unilabeltype_courseteaser/autorun',
38
    get_string('autorun', 'mod_unilabel'),
39
    '',
40
    true
41
);
42
 
43
$numbers                = array_combine(range(1, 10), range(1, 10));
44
$courseteasersettings[] = new admin_setting_configselect('unilabeltype_courseteaser/carouselinterval',
45
    get_string('default_carouselinterval', 'unilabeltype_courseteaser'),
46
    '',
47
    5,
48
    $numbers
49
);
50
 
51
$numbers                = array_combine(range(1, 6), range(1, 6));
52
$courseteasersettings[] = new admin_setting_configselect('unilabeltype_courseteaser/columns',
53
    get_string('default_columns', 'unilabeltype_courseteaser'),
54
    get_string('columns_help', 'unilabeltype_courseteaser'),
55
    4,
56
    $numbers
57
);
58
 
59
$select = [
60
    'carousel' => get_string('carousel', 'unilabeltype_courseteaser'),
61
    'grid'     => get_string('grid', 'unilabeltype_courseteaser'),
62
];
63
$courseteasersettings[] = new admin_setting_configselect(
64
    'unilabeltype_courseteaser/presentation',
65
    get_string('default_presentation', 'unilabeltype_courseteaser'),
66
    '',
67
    'carousel',
68
    $select
69
);
70
 
71
$courseteasersettings[] = new admin_setting_configcheckbox('unilabeltype_courseteaser/showintro',
72
    get_string('default_showintro', 'unilabeltype_courseteaser'),
73
    '',
74
    false
75
);
76
 
77
$courseteasersettings[] = new \mod_unilabel\setting_configselect_button('unilabeltype_courseteaser/custombutton',
78
    get_string('custombutton', 'unilabeltype_courseteaser'),
79
    '',
80
 
81
);
82
 
83
foreach ($courseteasersettings as $setting) {
84
    $page->add($setting);
85
}
86
 
87
$settingscategory->add($page);