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 topic teaser.
|
|
|
19 |
*
|
|
|
20 |
* @package unilabeltype_topicteaser
|
|
|
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_topicteaser', get_string('pluginname', 'unilabeltype_topicteaser'));
|
|
|
28 |
|
|
|
29 |
$topicteasersettings = [];
|
|
|
30 |
|
|
|
31 |
$topicteasersettings[] = new admin_setting_configcheckbox('unilabeltype_topicteaser/active',
|
|
|
32 |
get_string('active'),
|
|
|
33 |
'',
|
|
|
34 |
true
|
|
|
35 |
);
|
|
|
36 |
|
|
|
37 |
$topicteasersettings[] = new admin_setting_configcheckbox('unilabeltype_topicteaser/autorun',
|
|
|
38 |
get_string('autorun', 'mod_unilabel'),
|
|
|
39 |
'',
|
|
|
40 |
true
|
|
|
41 |
);
|
|
|
42 |
|
|
|
43 |
$numbers = array_combine(range(1, 10), range(1, 10));
|
|
|
44 |
$topicteasersettings[] = new admin_setting_configselect('unilabeltype_topicteaser/carouselinterval',
|
|
|
45 |
get_string('default_carouselinterval', 'unilabeltype_topicteaser'),
|
|
|
46 |
'',
|
|
|
47 |
5,
|
|
|
48 |
$numbers
|
|
|
49 |
);
|
|
|
50 |
|
|
|
51 |
$numbers = array_combine(range(1, 6), range(1, 6));
|
|
|
52 |
$topicteasersettings[] = new admin_setting_configselect('unilabeltype_topicteaser/columns',
|
|
|
53 |
get_string('default_columns', 'unilabeltype_topicteaser'),
|
|
|
54 |
get_string('columns_help', 'unilabeltype_topicteaser'),
|
|
|
55 |
4,
|
|
|
56 |
$numbers
|
|
|
57 |
);
|
|
|
58 |
|
|
|
59 |
$select = [
|
|
|
60 |
'carousel' => get_string('carousel', 'unilabeltype_topicteaser'),
|
|
|
61 |
'grid' => get_string('grid', 'unilabeltype_topicteaser'),
|
|
|
62 |
];
|
|
|
63 |
$topicteasersettings[] = new admin_setting_configselect(
|
|
|
64 |
'unilabeltype_topicteaser/presentation',
|
|
|
65 |
get_string('default_presentation', 'unilabeltype_topicteaser'),
|
|
|
66 |
'',
|
|
|
67 |
'carousel',
|
|
|
68 |
$select
|
|
|
69 |
);
|
|
|
70 |
|
|
|
71 |
$select = [
|
|
|
72 |
'opendialog' => get_string('opendialog', 'unilabeltype_topicteaser'),
|
|
|
73 |
'opencourseurl' => get_string('opencourseurl', 'unilabeltype_topicteaser'),
|
|
|
74 |
];
|
|
|
75 |
$topicteasersettings[] = new admin_setting_configselect(
|
|
|
76 |
'unilabeltype_topicteaser/clickaction',
|
|
|
77 |
get_string('default_clickaction', 'unilabeltype_topicteaser'),
|
|
|
78 |
'',
|
|
|
79 |
'opendialog',
|
|
|
80 |
$select
|
|
|
81 |
);
|
|
|
82 |
|
|
|
83 |
$topicteasersettings[] = new admin_setting_configcheckbox('unilabeltype_topicteaser/showintro',
|
|
|
84 |
get_string('default_showintro', 'unilabeltype_topicteaser'),
|
|
|
85 |
'',
|
|
|
86 |
false
|
|
|
87 |
);
|
|
|
88 |
|
|
|
89 |
$topicteasersettings[] = new admin_setting_configcheckbox('unilabeltype_topicteaser/showcoursetitle',
|
|
|
90 |
get_string('default_showcoursetitle', 'unilabeltype_topicteaser'),
|
|
|
91 |
'',
|
|
|
92 |
true
|
|
|
93 |
);
|
|
|
94 |
|
|
|
95 |
$topicteasersettings[] = new \mod_unilabel\setting_configselect_button('unilabeltype_topicteaser/custombutton',
|
|
|
96 |
get_string('custombutton', 'unilabeltype_topicteaser'),
|
|
|
97 |
'',
|
|
|
98 |
|
|
|
99 |
);
|
|
|
100 |
|
|
|
101 |
foreach ($topicteasersettings as $setting) {
|
|
|
102 |
$page->add($setting);
|
|
|
103 |
}
|
|
|
104 |
|
|
|
105 |
$settingscategory->add($page);
|