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_moodlenet/import_options_select
19
 
20
    MoodleNet import options template.
21
 
22
    The purpose of this template is to render an list of import options as radio-button-like controls.
23
 
24
    Classes required for JS:
25
    * none
26
 
27
    Data attributes required for JS:
28
    * none
29
 
30
    Context variables required for this template:
31
    * course The course id.
32
    * section The sectio id.
33
    * resourceurl The URL to the remote resource on MoodleNet.
34
    * resourcename The name of the remote resource on MoodleNet.
35
    * sesskey The CSRF token, as per sesskey()
36
    * handlers The array of handler options to present the user with
37
 
38
    Example context (json):
39
    {
40
        "course": 33,
41
        "coursename": "Introduction to quantum physics",
42
        "section": 0,
43
        "resourceurl": "http://example.com/test.png",
44
        "resourcename": "A test image",
45
        "sesskey": "abc123",
46
        "handlers": [
47
            {
48
                "module": "label",
49
                "message": "Add media to the course page"
50
            }
51
        ]
52
    }
53
}}
54
<div class="generalbox modal modal-dialog modal-in-page show">
55
    <div class="box py-3 modal-content">
56
        <form action="#" method="post">
57
            <input type="hidden" name="course" value="{{course}}">
58
            <input type="hidden" name="section" value="{{section}}">
59
            <input type="hidden" name="resourceurl" value="{{resourceurl}}">
60
            <input type="hidden" name="sesskey" value="{{sesskey}}">
61
            <div class="box py-3 modal-header px-3">
62
                <h4>{{#str}}importformatselectheader, tool_moodlenet{{/str}}</h4>
63
            </div>
64
            <div class="box py-3 modal-body">
65
                {{#str}}importformatselectguidingtext, tool_moodlenet, {"name": {{#quote}}{{resourcename}}{{/quote}}, "type": {{#quote}}{{resourcetype}}{{/quote}} }{{/str}}
66
                <br><br>
67
                {{#handlers}}
68
                    <input id="{{module}}_option" name="module" type="radio" value="{{module}}" {{#oneoption}}checked="checked"{{/oneoption}}>&nbsp;<label for="{{module}}_option">{{message}}</label>
69
                    <br>
70
                {{/handlers}}
71
            </div>
72
            <div class="box py-3 modal-footer">
73
                <div class="buttons">
74
                    <input class="btn btn-secondary" type="submit" name="cancel" value="{{#str}}cancel, core{{/str}}">
75
                    <input class="btn btn-primary" type="submit" name="import" value="{{#str}}continue, core{{/str}}">
76
                </div>
77
            </div>
78
        </form>
79
    </div>
80
</div>