2 This file is part of Moodle - http://moodle.org/
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.
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.
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/>.
18 @template core_form/filetypes-browser
20 The template is used to render the content of the UI widget allowing the
21 user to select individual file types or their groups.
23 Classes required for JS:
26 Data attributes required for JS:
29 Context variables required for this template:
43 Example context (json):
51 "ext": ".css .html .xhtml .htm .js",
55 "name": "Cascading Style-Sheet",
63 "ext": ".htm .xhtml .html"
69 "name": "Web-safe audio files",
76 "name": "Audio file (MP3)",
85 <div data-filetypesbrowserbody="{{elementid}}" role="tree">
87 <div data-filetypesbrowserkey="{{key}}" role="treeitem" aria-expanded="{{#expanded}}true{{/expanded}}{{^expanded}}false{{/expanded}}">
90 <input data-filetypesbrowserkey="{{key}}" type="checkbox" {{#selected}}checked{{/selected}}>
91 <strong data-filetypesname="{{key}}">{{name}}</strong>
92 <small class="muted" data-filetypesextensions="{{key}}">
97 <strong>{{name}}</strong>
101 {{! The tree provides its own accessibility controls, these two links are here for mouse users.
102 For that reason, we hide them from assistive technologies. }}
103 <small aria-hidden="true" data-filetypesbrowserfeature="hideifexpanded" class="float-right float-right"><a href="#">{{#str}}expand{{/str}}</a></small>
104 <small aria-hidden="true" data-filetypesbrowserfeature="hideifcollapsed" class="float-right float-right"><a href="#">{{#str}}collapse{{/str}}</a></small>
106 <ul class="unstyled list-unstyled" role="group">
108 <li data-filetypesbrowserkey="{{key}}" style="margin-left: 2em" role="treeitem">
110 <input data-filetypesbrowserkey="{{key}}" type="checkbox" {{#selected}}checked{{/selected}}>
111 <span data-filetypesname="{{key}}">{{name}}</span>
112 <small class="muted" data-filetypesextensions="{{key}}">
119 <hr style="clear:both">