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 mod_unilabel/activity_picker
19
    Template showing a bootstrap modal dialog to pick an activity instance and get its url.
20
 
21
    Example context (json):
22
    {
23
        "formid": "xyzabc-123",
24
        "hasactivities": 1,
25
        "activities": [
26
            {
27
                "name": "name1",
28
                "module": "forum",
29
                "modulename": "Forum",
30
                "activityname": "Announcements",
31
                "url": "https://example.com",
32
                "icon": "https://example.com/img.png",
33
                "purpose": "content",
34
                "filterstring": "Forum Announcements",
35
                "hasavailabilityinfo": 1,
36
                "availableinfo": [
37
                    {
38
                        "text": "Not available unless: ..."
39
                    }
40
                ],
41
                "modstealth": "",
42
                "stealthinfo": "",
43
                "hidden": "1",
44
                "hiddeninfo": "Hidden from students"
45
            },
46
            {
47
                "name": "name1",
48
                "module": "page",
49
                "modulename": "Page",
50
                "activityname": "Text of something",
51
                "url": "https://example.com",
52
                "icon": "https://example.com/img.png",
53
                "purpose": "content",
54
                "filterstring": "Page Text of something",
55
                "hasavailabilityinfo": "",
56
                "availableinfo": "",
57
                "modstealth": 1,
58
                "stealthinfo": "Hidden but available",
59
                "hidden": "",
60
                "hiddeninfo": ""
61
            }
62
        ]
63
    }
64
}}
65
 
66
<!-- The Modal -->
67
<div class="modal fade" tabindex="-1" id="unilabel-modal-activity-picker-{{formid}}">
68
    <div class="modal-dialog modal-lg">
69
        <div class="modal-content">
70
 
71
            <!-- Modal Header -->
72
            <div class="modal-header">
73
                <h4 class="modal-title"><i class="fa fa-external-link"></i> {{#str}}chooseurlfromactivity, mod_unilabel{{/str}}</h4>
74
                <button type="button" class="close" data-dismiss="modal">&times;</button>
75
            </div>
76
 
77
            <!-- Modal body -->
78
            <div id="unilabel-activity-picker" class="modal-body">
79
                {{> mod_unilabel/activity_picker_list }}
80
            </div>
81
            <!-- Modal footer -->
82
            <div class="modal-footer">
83
                <button type="button" class="btn btn-primary" data-dismiss="modal">{{#str}} closebuttontitle {{/str}}</button>
84
            </div>
85
        </div>
86
    </div>
87
</div>
88
 
89
{{#js}}
90
    require(['mod_unilabel/activity_picker'], function(activitypicker) {
91
        activitypicker.init('{{formid}}');
92
    });
93
{{/js}}