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_form/element-url
|
|
|
19 |
|
|
|
20 |
URL form element template.
|
|
|
21 |
|
|
|
22 |
Example context (json):
|
|
|
23 |
{
|
|
|
24 |
"element": {
|
|
|
25 |
"name": "test",
|
|
|
26 |
"id": "test0",
|
|
|
27 |
"wrapperid": "test0-wrapper",
|
|
|
28 |
"size": null,
|
|
|
29 |
"error": null,
|
|
|
30 |
"value": "http://example.org",
|
|
|
31 |
"frozen": false,
|
|
|
32 |
"iderror": "test0_error",
|
|
|
33 |
"attributes": "",
|
|
|
34 |
"filepickerclientid": "test0-filepickerclientid"
|
|
|
35 |
}
|
|
|
36 |
}
|
|
|
37 |
}}
|
|
|
38 |
{{< core_form/element-template }}
|
|
|
39 |
{{$element}}
|
|
|
40 |
{{#element.filepickerclientid}}
|
|
|
41 |
<div id="url-wrapper-{{element.filepickerclientid}}" class="d-inline-block mw-100">
|
|
|
42 |
{{/element.filepickerclientid}}
|
|
|
43 |
<input type="url"
|
|
|
44 |
class="form-control {{#error}}is-invalid{{/error}}"
|
|
|
45 |
name="{{element.name}}"
|
|
|
46 |
id="{{element.id}}"
|
|
|
47 |
value="{{element.value}}"
|
|
|
48 |
{{#element.size}}size="{{element.size}}"{{/element.size}}
|
|
|
49 |
{{#error}}
|
|
|
50 |
autofocus aria-describedby="{{element.iderror}}"
|
|
|
51 |
{{/error}}
|
|
|
52 |
{{#required}}
|
|
|
53 |
aria-required="true"
|
|
|
54 |
{{/required}}
|
|
|
55 |
{{#element.frozen}}
|
|
|
56 |
readonly {{#element.hardfrozen}}disabled{{/element.hardfrozen}}
|
|
|
57 |
{{/element.frozen}}
|
|
|
58 |
{{{element.attributes}}} >
|
|
|
59 |
{{#element.filepickerclientid}}
|
|
|
60 |
</div>
|
|
|
61 |
{{/element.filepickerclientid}}
|
|
|
62 |
{{^element.frozen}}
|
|
|
63 |
{{{element.filepickerhtml}}}
|
|
|
64 |
{{/element.frozen}}
|
|
|
65 |
{{/element}}
|
|
|
66 |
{{/ core_form/element-template }}
|