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_contentbank/bankcontent/toolbar_dropdown
19
 
20
    Example context (json):
21
        {
22
            "name": "Add",
23
            "dropdown": true,
24
            "link": "http://something/contentbank/edit.php?contextid=1",
25
            "contenttypes": [
26
                {
27
                    "name": "h5p",
28
                    "baseurl": "http://something/contentbank/edit.php?contextid=1&plugin=h5p",
29
                    "types": [
30
                        {
31
                            "typename": "H5P Interactive Content"
32
                        },
33
                        {
34
                            "typename": "Accordion",
35
                            "typeeditorparams": "library=Accordion-1.4",
36
                            "typeicon": "http://something/pluginfile.php/1/core_h5p/libraries/13/H5P.Accordion-1.4/icon.svg"
37
                        }
38
                    ]
39
                }
40
            ]
41
        }
42
 
43
}}
44
<div class="btn-group mr-1" role="group">
45
    <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" data-action="{{name}}-content"
46
            aria-haspopup="true" aria-expanded="false" {{^contenttypes}}title="{{#str}}nocontenttypes, core_contentbank{{/str}}"
47
            disabled{{/contenttypes}}>
48
        {{#name}} {{name}} {{/name}}
49
    </button>
50
    <div class="dropdown-menu dropdown-scrollable dropdown-menu-right">
51
        {{#contenttypes}}
52
            {{#types}}
53
                {{^typeeditorparams}}
54
                    <h6 class="dropdown-header">{{ typename }}</h6>
55
                {{/typeeditorparams}}
56
                {{#typeeditorparams}}
57
                    <a class="dropdown-item icon-size-4" href="{{{ baseurl }}}&{{{ typeeditorparams }}}">
58
                        {{#typeicon}}
59
                            <img alt="" class="icon" src="{{{ typeicon }}}">
60
                        {{/typeicon}}
61
                        {{^typeicon}}
62
                            {{#pix}} b/h5p_library, core {{/pix}}
63
                        {{/typeicon}} {{ typename }}
64
                    </a>
65
                {{/typeeditorparams}}
66
            {{/types}}
67
        {{/contenttypes}}
68
    </div>
69
</div>