1 |
efrain |
1 |
{{!
|
|
|
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 |
@template core_admin/themeselector/theme_selector
|
|
|
19 |
|
|
|
20 |
This template renders the cards view for choosing a theme.
|
|
|
21 |
|
|
|
22 |
Example context (json):
|
|
|
23 |
{
|
|
|
24 |
"themes": [
|
|
|
25 |
{
|
|
|
26 |
"name": "Boost",
|
|
|
27 |
"choose": "boost",
|
|
|
28 |
"image": "http://moodlesite/theme/image.php?theme=boost&image=screenshot&component=theme",
|
|
|
29 |
"current": true,
|
|
|
30 |
"actionurl": "http://moodlesite/admin/themeselector.php",
|
|
|
31 |
"sesskey": "123XYZ"
|
|
|
32 |
},
|
|
|
33 |
{
|
|
|
34 |
"name": "Classic",
|
|
|
35 |
"choose": "classic",
|
|
|
36 |
"image": "http://moodlesite/theme/image.php?theme=classic&image=screenshot&component=theme",
|
|
|
37 |
"actionurl": "http://moodlesite/admin/themeselector.php",
|
|
|
38 |
"sesskey": "123XYZ"
|
|
|
39 |
}
|
|
|
40 |
],
|
|
|
41 |
"resetbutton": {
|
|
|
42 |
"id": "single_button123",
|
|
|
43 |
"method": "post",
|
|
|
44 |
"url": "index.php",
|
|
|
45 |
"label": "Clear theme caches",
|
|
|
46 |
"params": [
|
|
|
47 |
{
|
|
|
48 |
"name": "sesskey",
|
|
|
49 |
"value": "123XYZ"
|
|
|
50 |
},
|
|
|
51 |
{
|
|
|
52 |
"name": "reset",
|
|
|
53 |
"value": "1"
|
|
|
54 |
}
|
|
|
55 |
]
|
|
|
56 |
}
|
|
|
57 |
}
|
|
|
58 |
}}
|
|
|
59 |
<h2>{{#str}}themeselector, admin{{/str}}</h2>
|
|
|
60 |
{{#resetbutton}}
|
|
|
61 |
<div class="mb-3">
|
|
|
62 |
{{>core/single_button}}
|
|
|
63 |
</div>
|
|
|
64 |
{{/resetbutton}}
|
|
|
65 |
<div class="card-grid row row-cols-1 row-cols-md-3 mx-0" id="themelist" data-region="card-deck" role="list" data-definedinconfig="{{definedinconfig}}">
|
|
|
66 |
{{#themes}}
|
|
|
67 |
<div class="col d-flex px-1 mb-2">
|
|
|
68 |
{{>core_admin/themeselector/theme_card}}
|
|
|
69 |
</div>
|
|
|
70 |
{{/themes}}
|
|
|
71 |
</div>
|
|
|
72 |
|
|
|
73 |
{{#js}}
|
|
|
74 |
require(['core_admin/themeselector/preview_modal'], function(Modal) {
|
|
|
75 |
Modal.init();
|
|
|
76 |
});
|
|
|
77 |
{{/js}}
|