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_forum/forum_new_discussion_actionbar
19
    Add button to create a new discussion in the forum activity.
20
    Classes required for JS:
21
    * none
22
    Data attributes required for JS:
23
    * none
24
    Context variables required for this template:
25
    * see mod/forum/classes/output/activity_actionbar.php
26
    Example context (json):
27
    {
28
        "forum": {
29
            "id": 3,
30
            "name": "Forum test",
31
            "state": [],
32
            "userstate": "",
33
            "capabilities": [{
34
                "viewdiscussions": true,
35
                "create": true,
36
                "selfenrol": false
37
            }],
38
            "urls": [{
39
                "create": "http://localhost/mod/forum/post.php?forum=11"
40
            }]
41
        }
42
    }
43
}}
44
 
45
{{#forum.capabilities.create}}
46
    <a class="btn btn-primary" data-toggle="collapse" href="#collapseAddForm">
47
        {{#str}}addanewdiscussion, forum{{/str}}
48
    </a>
49
{{/forum.capabilities.create}}
50
{{^forum.capabilities.create}}
51
    {{#forum.capabilities.selfenrol}}
52
        <a class="btn btn-primary" href="{{forum.urls.create}}">
53
            {{#str}}addanewdiscussion, forum{{/str}}
54
        </a>
55
    {{/forum.capabilities.selfenrol}}
56
{{/forum.capabilities.create}}