Proyectos de Subversion Moodle

Rev

| 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 tool_dataprivacy/category_purpose_form
19
 
20
    Manage data registry defaults.
21
 
22
    Classes required for JS:
23
 
24
    Data attributes required for JS:
25
 
26
    Context variables required for this template:
27
    * actionurl String The action URL.
28
    * contextlevel Number - The context level.
29
    * modemodule Boolean - Whether to display the activity select element.
30
    * activityoptions Array - An array of objects for the activity select element.
31
    * categoryoptions Array - An array of objects for the category select element.
32
    * purposeoptions Array - An array of objects for the purpose select element.
33
 
34
    Example context (json):
35
    {
36
        "actionurl": "#",
37
        "contextlevel": 70,
38
        "newactivitydefaults": true,
39
        "modemodule": true,
40
        "activityoptions": [
41
            { "name": "assign", "displayname": "Assignment" },
42
            { "name": "forum", "displayname": "Forum", "selected": true },
43
            { "name": "lesson", "displayname": "Lesson" },
44
            { "name": "quiz", "displayname": "Quiz" }
45
        ],
46
        "categoryoptions": [
47
            { "id": 1, "name": "Category 1" },
48
            { "id": 2, "name": "Category 2", "selected": true },
49
            { "id": 3, "name": "Category 3" }
50
        ],
51
        "purposeoptions": [
52
            { "id": 1, "name": "Purpose 1" },
53
            { "id": 2, "name": "Purpose 2" },
54
            { "id": 3, "name": "Purpose 3", "selected": true }
55
        ]
56
    }
57
}}
58
 
59
<div class="alert alert-warning" role="alert">
60
    {{#str}}defaultswarninginfo, tool_dataprivacy{{/str}}
61
</div>
62
<form method="post" action="{{actionurl}}" id="category_purpose_form">
63
    <input type="hidden" value="{{contextlevel}}" id="contextlevel" />
64
    {{#modemodule}}
65
    <div class="form-group">
66
        <label class="mr-2" for="activity">{{#str}}activitymodule{{/str}}</label>
67
        {{^newactivitydefaults}}
68
            <input type="hidden" id="activity" value="{{#activityoptions}}{{#selected}}{{name}}{{/selected}}{{/activityoptions}}" />
69
        {{/newactivitydefaults}}
70
        <select class="form-control custom-select" {{#newactivitydefaults}}id="activity" {{/newactivitydefaults}}{{^newactivitydefaults}}disabled{{/newactivitydefaults}}>
71
            {{#activityoptions}}
72
                <option value="{{name}}" {{#selected}}selected{{/selected}}>{{displayname}}</option>
73
            {{/activityoptions}}
74
        </select>
75
    </div>
76
    {{/modemodule}}
77
    <div class="form-group">
78
        <label class="mr-2" for="category">{{#str}}category, tool_dataprivacy{{/str}}</label>
79
        <select class="form-control custom-select" id="category">
80
        {{#categoryoptions}}
81
            <option value="{{id}}" {{#selected}}selected{{/selected}}>{{name}}</option>
82
        {{/categoryoptions}}
83
        </select>
84
    </div>
85
    <div class="form-group">
86
        <label class="mr-2" for="purpose">{{#str}}purpose, tool_dataprivacy{{/str}}</label>
87
        <select class="form-control custom-select" id="purpose">
88
        {{#purposeoptions}}
89
            <option value="{{id}}" {{#selected}}selected{{/selected}}>{{name}}</option>
90
        {{/purposeoptions}}
91
        </select>
92
    </div>
93
    <div class="form-check px-0">
94
        <div class="custom-control custom-switch">
95
            <input type="checkbox" class="custom-control-input tool_lp_scale_proficient" value="1" id="override">
96
            <label class="custom-control-label" for="override">{{#str}}overrideinstances, tool_dataprivacy{{/str}}</label>
97
        </div>
98
    </div>
99
</form>