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/",
|
|
|
37 |
"newwindow": false
|
|
|
38 |
}
|
|
|
39 |
}}
|
|
|
40 |
{{< core/modal }}
|
|
|
41 |
|
|
|
42 |
{{$title}}
|
|
|
43 |
{{#str}} createlink, tiny_link {{/str}}
|
|
|
44 |
{{/title}}
|
|
|
45 |
|
|
|
46 |
{{$body}}
|
|
|
47 |
<form class="mform" id="{{uniqid}}">
|
|
|
48 |
<div class="mb-1">
|
|
|
49 |
<label for="{{elementid}}_tiny_link_urltext">{{#str}} texttodisplay, tiny_link {{/str}}</label>
|
|
|
50 |
<input
|
|
|
51 |
class="form-control fullwidth text-ltr w-100 tiny_link_urltext"
|
|
|
52 |
id="{{elementid}}_tiny_link_urltext" type="text"
|
|
|
53 |
data-use-link-as-text="{{#urltext}}false{{/urltext}}{{^urltext}}true{{/urltext}}"
|
|
|
54 |
{{#setLinkOnElement}}data-link-on-element="1"{{/setLinkOnElement}}
|
|
|
55 |
value="{{urltext}}"/>
|
|
|
56 |
</div>
|
|
|
57 |
<div class="mb-1">
|
|
|
58 |
<label for="{{elementid}}_tiny_link_urlentry">{{#str}} enterurl, tiny_link {{/str}}</label>
|
|
|
59 |
{{#showfilepicker}}
|
|
|
60 |
<div class="input-group input-append w-100">
|
|
|
61 |
<input class="form-control fullwidth text-ltr tiny_link_urlentry" id="{{elementid}}_tiny_link_urlentry" type="text" value="{{url}}"/>
|
|
|
62 |
<span class="input-group-append">
|
|
|
63 |
<button class="btn btn-secondary openlinkbrowser" type="button">{{#str}} browserepositories, tiny_link {{/str}}</button>
|
|
|
64 |
</span>
|
|
|
65 |
</div>
|
|
|
66 |
{{/showfilepicker}}
|
|
|
67 |
{{^showfilepicker}}
|
|
|
68 |
<input class="form-control fullwidth text-ltr tiny_link_urlentry" id="{{elementid}}_tiny_link_urlentry" type="text" value="{{url}}"/>
|
|
|
69 |
{{/showfilepicker}}
|
|
|
70 |
</div>
|
|
|
71 |
<div class="form-check">
|
|
|
72 |
<input type="checkbox" class="form-check-input tiny_link_newwindow" id="{{elementid}}_tiny_link_newwindow" {{#newwindow}}checked{{/newwindow}}/>
|
|
|
73 |
<label class="form-check-label" for="{{elementid}}_tiny_link_newwindow">{{#str}} openinnewwindow, tiny_link {{/str}}</label>
|
|
|
74 |
</div>
|
|
|
75 |
</form>
|
|
|
76 |
{{/body}}
|
|
|
77 |
|
|
|
78 |
{{$footer}}
|
|
|
79 |
<button type="button" class="btn btn-primary" data-action="save">
|
|
|
80 |
{{#isupdating}}
|
|
|
81 |
{{#str}} updatelink, tiny_link {{/str}}
|
|
|
82 |
{{/isupdating}}
|
|
|
83 |
{{^isupdating}}
|
|
|
84 |
{{#str}} createlink, tiny_link {{/str}}
|
|
|
85 |
{{/isupdating}}
|
|
|
86 |
</button>
|
|
|
87 |
{{/footer}}
|
|
|
88 |
|
|
|
89 |
{{/ core/modal }}
|