Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | 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 tiny_link/modal
19
 
20
    Modal to manage a link within the Tiny Editor.
21
 
22
    Classes required for JS:
23
    * none
24
 
25
    Data attributes required for JS:
26
    * none
27
 
28
    Context variables required for this template:
29
 
30
    Example context (json):
31
    {
32
        "elementid": "exampleId",
33
        "setLinkOnElement": false,
34
        "showfilepicker": true,
35
        "urltext": "Abc",
36
        "url": "https://moodle.org/",
1441 ariadna 37
        "newwindow": false,
38
        "isupdating": true
1 efrain 39
    }
40
}}
41
{{< core/modal }}
42
 
43
    {{$title}}
44
        {{#str}} createlink, tiny_link {{/str}}
45
    {{/title}}
46
 
47
    {{$body}}
48
        <form class="mform" id="{{uniqid}}">
49
            <div class="mb-1">
50
                <label for="{{elementid}}_tiny_link_urltext">{{#str}} texttodisplay, tiny_link {{/str}}</label>
51
                <input
52
                class="form-control fullwidth text-ltr w-100 tiny_link_urltext"
53
                id="{{elementid}}_tiny_link_urltext" type="text"
54
                data-use-link-as-text="{{#urltext}}false{{/urltext}}{{^urltext}}true{{/urltext}}"
55
                {{#setLinkOnElement}}data-link-on-element="1"{{/setLinkOnElement}}
56
                value="{{urltext}}"/>
57
            </div>
58
            <div class="mb-1">
59
                <label for="{{elementid}}_tiny_link_urlentry">{{#str}} enterurl, tiny_link {{/str}}</label>
60
                {{#showfilepicker}}
61
                    <div class="input-group input-append w-100">
62
                        <input class="form-control fullwidth text-ltr tiny_link_urlentry" id="{{elementid}}_tiny_link_urlentry" type="text" value="{{url}}"/>
63
                        <button class="btn btn-secondary openlinkbrowser" type="button">{{#str}} browserepositories, tiny_link {{/str}}</button>
64
                    </div>
65
                {{/showfilepicker}}
66
                {{^showfilepicker}}
67
                    <input class="form-control fullwidth text-ltr tiny_link_urlentry" id="{{elementid}}_tiny_link_urlentry" type="text" value="{{url}}"/>
68
                {{/showfilepicker}}
69
            </div>
70
            <div class="form-check">
71
                <input type="checkbox" class="form-check-input tiny_link_newwindow" id="{{elementid}}_tiny_link_newwindow" {{#newwindow}}checked{{/newwindow}}/>
72
                <label class="form-check-label" for="{{elementid}}_tiny_link_newwindow">{{#str}} openinnewwindow, tiny_link {{/str}}</label>
73
            </div>
74
        </form>
75
    {{/body}}
76
 
77
    {{$footer}}
78
        <button type="button" class="btn btn-primary" data-action="save">
79
            {{#isupdating}}
80
                {{#str}} updatelink, tiny_link {{/str}}
81
            {{/isupdating}}
82
            {{^isupdating}}
83
                {{#str}} createlink, tiny_link {{/str}}
84
            {{/isupdating}}
85
        </button>
86
    {{/footer}}
87
 
88
{{/ core/modal }}