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 datafield_textarea/textarea
|
|
|
19 |
|
|
|
20 |
The purpose of this template is to enable the user to define a textarea field.
|
|
|
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 |
* name string The field's name.
|
|
|
30 |
* description string The field's description.
|
|
|
31 |
* required bool The field's requiredness.
|
|
|
32 |
* param2 int The field's width in columns.
|
|
|
33 |
* param3 int The field's height in rows.
|
|
|
34 |
* param5 int The field's attached files maxsize.
|
|
|
35 |
|
|
|
36 |
Example context (json):
|
|
|
37 |
{
|
|
|
38 |
"name": "A name",
|
|
|
39 |
"description": "A description",
|
|
|
40 |
"required": true,
|
|
|
41 |
"param2": 60,
|
|
|
42 |
"param3": 35,
|
|
|
43 |
"param5": 4096
|
|
|
44 |
}
|
|
|
45 |
}}
|
|
|
46 |
|
|
|
47 |
<fieldset>
|
|
|
48 |
{{> mod_data/fields/basicfields }}
|
|
|
49 |
{{> mod_data/fields/requiredfield }}
|
|
|
50 |
<div class="form-group row fitem">
|
|
|
51 |
<div class="col-md-3">
|
|
|
52 |
<label for="param2">{{#str}}fieldwidth, data{{/str}}</label>
|
|
|
53 |
</div>
|
|
|
54 |
<div class="col-md-9 form-inline align-items-start felement">
|
|
|
55 |
<input class="textareafieldsize form-control mr-1" type="text" name="param2" id="param2" value="{{#param2}}{{param2}}{{/param2}}{{^param2}}60{{/param2}}">
|
|
|
56 |
{{#str}}columns, data{{/str}}</div>
|
|
|
57 |
</div>
|
|
|
58 |
<div class="form-group row fitem">
|
|
|
59 |
<div class="col-md-3">
|
|
|
60 |
<label for="param3">{{#str}}fieldheight, data{{/str}}</label>
|
|
|
61 |
</div>
|
|
|
62 |
<div class="col-md-9 form-inline align-items-start felement">
|
|
|
63 |
<input class="textareafieldsize form-control mr-1" type="text" name="param3" id="param3" value="{{#param3}}{{param3}}{{/param3}}{{^param3}}35{{/param3}}">
|
|
|
64 |
{{#str}}rows, data{{/str}}</div>
|
|
|
65 |
</div>
|
|
|
66 |
<div class="form-group row fitem">
|
|
|
67 |
<div class="col-md-3">
|
|
|
68 |
<label for="param5">{{#str}}maxbytes, datafield_textarea{{/str}}</label>
|
|
|
69 |
</div>
|
|
|
70 |
<div class="col-md-9 form-inline align-items-start felement">
|
|
|
71 |
<input class="c1 form-control mr-1" type="text" name="param5" id="param5" value="{{#param5}}{{param5}}{{/param5}}{{^param5}}0{{/param5}}">
|
|
|
72 |
{{#str}}maxbytes_desc, datafield_textarea{{/str}}</div>
|
|
|
73 |
</div>
|
|
|
74 |
<input type="hidden" name="param4" id="param4" value="1"/>
|
|
|
75 |
</fieldset>
|