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_form/element-header
|
|
|
19 |
|
|
|
20 |
Renders a form section header
|
|
|
21 |
|
|
|
22 |
Example context (json):
|
|
|
23 |
{
|
|
|
24 |
"id": "id_general",
|
|
|
25 |
"header": "General",
|
|
|
26 |
"collapsed": 0,
|
|
|
27 |
"collapseable": 1,
|
|
|
28 |
"helpbutton": "Help"
|
|
|
29 |
}
|
|
|
30 |
}}
|
|
|
31 |
<legend class="sr-only">{{{header}}}</legend>
|
|
|
32 |
<div class="d-flex align-items-center mb-2">
|
|
|
33 |
<div class="position-relative d-flex ftoggler align-items-center position-relative mr-1">
|
|
|
34 |
{{#collapseable}}
|
|
|
35 |
<a data-toggle="collapse"
|
|
|
36 |
href="#{{id}}container"
|
|
|
37 |
role="button"
|
|
|
38 |
aria-expanded="{{#collapsed}}false{{/collapsed}}{{^collapsed}}true{{/collapsed}}"
|
|
|
39 |
aria-controls="{{id}}container"
|
|
|
40 |
class="btn btn-icon mr-1 icons-collapse-expand stretched-link fheader {{#collapsed}}collapsed{{/collapsed}}"
|
|
|
41 |
>
|
|
|
42 |
<span class="expanded-icon icon-no-margin p-2" title="{{#str}} collapse, core {{/str}}">
|
|
|
43 |
{{#pix}} t/expandedchevron, core {{/pix}}
|
|
|
44 |
</span>
|
|
|
45 |
<span class="collapsed-icon icon-no-margin p-2" title="{{#str}} expand, core {{/str}}">
|
|
|
46 |
<span class="dir-rtl-hide">{{#pix}} t/collapsedchevron, core {{/pix}}</span>
|
|
|
47 |
<span class="dir-ltr-hide">{{#pix}} t/collapsedchevron_rtl, core {{/pix}}</span>
|
|
|
48 |
</span>
|
|
|
49 |
<span class="sr-only">{{{header}}}</span>
|
|
|
50 |
</a>
|
|
|
51 |
{{/collapseable}}
|
|
|
52 |
<h3 class="d-flex align-self-stretch align-items-center mb-0" aria-hidden="true">
|
|
|
53 |
{{{header}}}
|
|
|
54 |
</h3>
|
|
|
55 |
</div>
|
|
|
56 |
{{{helpbutton}}}
|
|
|
57 |
</div>
|
|
|
58 |
<div id="{{id}}container" class="fcontainer {{#collapseable}}collapseable collapse {{/collapseable}} {{^collapsed}}show{{/collapsed}}">
|