Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
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/dataformat_selector
19
 
20
    Context variables required for this template:
21
    * label
22
    * base
23
    * name
24
    * params
25
    * options
26
    * sesskey
27
    * submit
28
 
29
    Example context (json):
30
    {
31
        "base": "http://example.org/",
32
        "name": "test",
33
        "value": "test",
34
        "label": "Download table data as",
35
        "params": false,
36
        "options": [{"label": "CSV", "name": "csv"}, {"label": "Excel", "name": "excel"}],
37
        "submit": "Download",
38
        "sesskey": ""
39
    }
40
}}
41
<form method="get" action="{{base}}" class="dataformatselector m-1">
42
    <div class="d-flex flex-wrap align-items-end text-xs-right">
43
        <input type="hidden" name="sesskey" value="{{sesskey}}">
44
        <label for="downloadtype_{{name}}" class="mr-1">{{label}}</label>
45
        <select name="{{name}}" id="downloadtype_{{name}}" class="form-control custom-select mr-1">
46
            {{#options}}
47
                <option value="{{value}}">{{label}}</option>
48
            {{/options}}
49
        </select>
50
        <button type="submit" class="btn btn-secondary">{{submit}}</button>
51
        {{#params}}
52
            <input type="hidden" name="{{name}}" value="{{value}}">
53
        {{/params}}
54
    </div>
55
</form>