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 core_course/activitychooserbutton
|
|
|
19 |
|
|
|
20 |
Displays a add activity or resource button.
|
|
|
21 |
|
|
|
22 |
Example context (json):
|
|
|
23 |
{
|
1441 |
ariadna |
24 |
"hasactionlinks": false,
|
|
|
25 |
"sectionnum": 0,
|
|
|
26 |
"sectionname": "Section example",
|
|
|
27 |
"modid": 1,
|
|
|
28 |
"activityname": "Activity example",
|
1 |
efrain |
29 |
"sectionreturn": 0
|
|
|
30 |
}
|
|
|
31 |
}}
|
1441 |
ariadna |
32 |
|
|
|
33 |
{{! Single button to add a new activity or resource. }}
|
|
|
34 |
{{^hasactionlinks}}
|
|
|
35 |
{{> core_course/addresourceoractivitybutton }}
|
|
|
36 |
{{/hasactionlinks}}
|
|
|
37 |
|
|
|
38 |
{{! Dropdown with "add a new activity or resource" item and any other action links. }}
|
|
|
39 |
{{#hasactionlinks}}
|
|
|
40 |
<div class="dropdown">
|
|
|
41 |
<button class="btn add-content d-flex justify-content-center align-items-center p-1 icon-no-margin"
|
|
|
42 |
type="button"
|
|
|
43 |
id="dropdownMenuButton-{{#modid}}{{modid}}{{/modid}}{{^modid}}{{uniqid}}{{/modid}}"
|
|
|
44 |
data-bs-toggle="dropdown"
|
|
|
45 |
data-action="open-addingcontent"
|
|
|
46 |
{{#modid}}
|
|
|
47 |
data-beforemod="{{modid}}"
|
|
|
48 |
aria-label="{{#str}}insertcontentbefore, core, { "activityname": {{#quote}} {{activityname}} {{/quote}} } {{/str}}"
|
|
|
49 |
{{/modid}}
|
|
|
50 |
{{^modid}}
|
|
|
51 |
aria-label="{{#str}}insertcontentsection, core, { "sectionname": {{#quote}} {{sectionname}} {{/quote}} } {{/str}}"
|
|
|
52 |
{{/modid}}
|
|
|
53 |
aria-haspopup="true"
|
|
|
54 |
aria-expanded="false"
|
|
|
55 |
tabindex="0"
|
|
|
56 |
title="{{#str}}addcontent, core{{/str}}"
|
|
|
57 |
>
|
|
|
58 |
{{#pix}} t/add, core {{/pix}}
|
|
|
59 |
</button>
|
|
|
60 |
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton-{{#modid}}{{modid}}{{/modid}}{{^modid}}{{uniqid}}{{/modid}}">
|
|
|
61 |
{{> core_course/addresourceoractivitybutton }}
|
|
|
62 |
{{#actionlinks}}
|
|
|
63 |
{{> core/action_link}}
|
|
|
64 |
{{/actionlinks}}
|
|
|
65 |
</div>
|
|
|
66 |
</div>
|
|
|
67 |
{{/hasactionlinks}}
|