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/action_link
19
 
20
    Action link template.
21
 
22
    Context variables required for this template:
23
    * disabled - Flag that indicates whether the action link to be rendered is disabled or not.
24
    * url - The action link URL.
25
    * id - The ID.
26
    * classes - CSS classes for the action link.
27
    * attributes - Array of attributes.
28
      * name - Attribute name.
29
      * value - Attribute value.
30
    * icon - The icon context data for this action link.
31
    * text - The text for this action link.
32
 
33
    Example context (json):
34
    {
35
        "disabled": false,
36
        "url": "#",
37
        "id": "test-id",
38
        "classes": "btn btn-link",
39
        "attributes": [
40
            {
41
                "name": "title",
42
                "value": "Action link's title"
43
            }
44
        ],
45
        "icon": {
46
            "attributes": [
47
                {"name": "src", "value": "https://raw.githubusercontent.com/moodle/moodle/master/pix/t/check.png"},
48
                {"name": "alt", "value": "Action link's icon"}
49
            ]
50
        },
51
        "text": "This is an action link"
52
    }
53
}}
54
{{^disabled}}
55
    <a href="{{{url}}}" id="{{id}}" class="{{classes}}" {{#attributes}} {{name}}="{{value}}" {{/attributes}}>{{#icon}}{{#pix}}{{key}}, {{component}}, {{title}}{{/pix}}{{/icon}}{{{text}}}</a>
56
    {{#hasactions}}
57
        {{> core/actions }}
58
    {{/hasactions}}
59
{{/disabled}}
60
{{#disabled}}
61
    <span class="currentlink {{classes}}" {{#attributes}} {{name}}="{{value}}" {{/attributes}}>{{#icon}}{{#pix}}{{key}}, {{component}}, {{title}}{{/pix}}{{/icon}}{{text}}</span>
62
{{/disabled}}