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 mod_bigbluebuttonbn/element_text_with_copy
|
|
|
19 |
|
|
|
20 |
This template renders a text input form element with a copy link next to it.
|
|
|
21 |
|
|
|
22 |
Context variables required for this template:
|
|
|
23 |
* label
|
|
|
24 |
* required
|
|
|
25 |
* advanced
|
|
|
26 |
* helpbutton
|
|
|
27 |
* error
|
|
|
28 |
* element
|
|
|
29 |
* id
|
|
|
30 |
* name
|
|
|
31 |
|
|
|
32 |
Example context (json):
|
|
|
33 |
{
|
|
|
34 |
"label": "Course full name",
|
|
|
35 |
"required": true,
|
|
|
36 |
"advanced": false,
|
|
|
37 |
"error": null,
|
|
|
38 |
"element": {
|
|
|
39 |
"wrapperid": "fitem_id_fullname",
|
|
|
40 |
"id": "id_fullname",
|
|
|
41 |
"name": "fullname",
|
|
|
42 |
"iderror": "id_error"
|
|
|
43 |
}
|
|
|
44 |
}
|
|
|
45 |
}}
|
|
|
46 |
{{< core_form/element-template }}
|
|
|
47 |
{{$element}}
|
|
|
48 |
<input type="text"
|
|
|
49 |
class="form-control {{#error}}is-invalid{{/error}}"
|
|
|
50 |
name="{{element.name}}"
|
|
|
51 |
{{#element.frozen}}
|
|
|
52 |
readonly {{#element.hardfrozen}}disabled{{/element.hardfrozen}}
|
|
|
53 |
{{/element.frozen}}
|
|
|
54 |
id="{{element.id}}"
|
|
|
55 |
value="{{element.value}}"
|
|
|
56 |
{{#element.size}}size="{{element.size}}"{{/element.size}}
|
|
|
57 |
{{#error}}
|
|
|
58 |
autofocus aria-describedby="{{element.iderror}}"
|
|
|
59 |
{{/error}}
|
|
|
60 |
{{{element.attributes}}} >
|
|
|
61 |
<button id="{{element.id}}-button"
|
|
|
62 |
data-action="copytoclipboard" data-clipboard-target="#{{element.id}}"
|
|
|
63 |
data-clipboard-success-message="{{#str}}success{{/str}}"
|
|
|
64 |
class="btn btn-link bigbluebuttonbn_icon_btn bigbluebuttonbn_cp_info_btn">
|
|
|
65 |
{{#pix}}t/copy, core{{/pix}} {{copylabel}}
|
|
|
66 |
</button>
|
|
|
67 |
{{/element}}
|
|
|
68 |
{{/ core_form/element-template }}
|
|
|
69 |
{{#js}}
|
|
|
70 |
require(['core/copy_to_clipboard']);
|
|
|
71 |
{{/js}}
|