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_contentbank/bankcontent
|
|
|
19 |
|
|
|
20 |
Example context (json):
|
|
|
21 |
{
|
|
|
22 |
"contents": [
|
|
|
23 |
{
|
|
|
24 |
"name": "Accordion.h5p",
|
|
|
25 |
"title": "accordion.h5p",
|
|
|
26 |
"timemodified": 1589792272,
|
|
|
27 |
"size": "699.3KB",
|
|
|
28 |
"bytes": 716126,
|
|
|
29 |
"type": "Archive (H5P)",
|
|
|
30 |
"author": "Admin user",
|
|
|
31 |
"link": "http://something/contentbank/contenttype/h5p/view.php?url=http://something/pluginfile.php/1/contentbank/public/accordion.h5p",
|
|
|
32 |
"icon" : "http://something/theme/image.php/boost/core/1581597850/f/h5p-64",
|
|
|
33 |
"visibilityunlisted": true
|
|
|
34 |
},
|
|
|
35 |
{
|
|
|
36 |
"name": "resume.pdf",
|
|
|
37 |
"title": "resume",
|
|
|
38 |
"timemodified": 1589792039,
|
|
|
39 |
"size": "699.3KB",
|
|
|
40 |
"uses": 3,
|
|
|
41 |
"bytes": 716126,
|
|
|
42 |
"type": "Archive (PDF)",
|
|
|
43 |
"author": "Admin user",
|
|
|
44 |
"icon": "http://something/theme/image.php/boost/core/1584597850/f/pdf-64",
|
|
|
45 |
"visibilityunlisted": false
|
|
|
46 |
}
|
|
|
47 |
],
|
|
|
48 |
"tools": [
|
|
|
49 |
{
|
|
|
50 |
"name": "Add",
|
|
|
51 |
"dropdown": true,
|
|
|
52 |
"link": "http://something/contentbank/edit.php?contextid=1",
|
|
|
53 |
"contenttypes": [
|
|
|
54 |
{
|
|
|
55 |
"name": "H5P Interactive Content",
|
|
|
56 |
"baseurl": "http://something/contentbank/edit.php?contextid=1&plugin=h5p",
|
|
|
57 |
"types": [
|
|
|
58 |
{
|
|
|
59 |
"typename": "H5P Interactive Content"
|
|
|
60 |
},
|
|
|
61 |
{
|
|
|
62 |
"typename": "Accordion",
|
|
|
63 |
"typeeditorparams": "library=Accordion-1.4",
|
|
|
64 |
"typeicon": "http://something/pluginfile.php/1/core_h5p/libraries/13/H5P.Accordion-1.4/icon.svg"
|
|
|
65 |
}
|
|
|
66 |
]
|
|
|
67 |
}
|
|
|
68 |
]
|
|
|
69 |
},
|
|
|
70 |
{
|
|
|
71 |
"name": "Upload",
|
|
|
72 |
"link": "http://something/contentbank/contenttype/h5p/view.php?url=http://something/pluginfile.php/1/contentbank/public/accordion.h5p",
|
|
|
73 |
"icon" : "i/upload"
|
|
|
74 |
},
|
|
|
75 |
{
|
|
|
76 |
"icon": "i/export"
|
|
|
77 |
}
|
|
|
78 |
],
|
|
|
79 |
"allowedcontexts": [
|
|
|
80 |
{
|
|
|
81 |
"name": "contextid",
|
|
|
82 |
"method": "get",
|
|
|
83 |
"action": "http://localhost/stable_master/contentbank/index.php",
|
|
|
84 |
"options": [
|
|
|
85 |
{
|
|
|
86 |
"value": "1",
|
|
|
87 |
"name": "System",
|
|
|
88 |
"selected": true,
|
|
|
89 |
"optgroup": false
|
|
|
90 |
},
|
|
|
91 |
{
|
|
|
92 |
"value": "32",
|
|
|
93 |
"name": "Category 1",
|
|
|
94 |
"selected": false,
|
|
|
95 |
"optgroup": false
|
|
|
96 |
}
|
|
|
97 |
]
|
|
|
98 |
}
|
|
|
99 |
]
|
|
|
100 |
}
|
|
|
101 |
}}
|
|
|
102 |
|
|
|
103 |
<div class="content-bank-container {{#viewlist}}view-list{{/viewlist}} {{^viewlist}}view-grid{{/viewlist}}"
|
|
|
104 |
data-region="contentbank">
|
|
|
105 |
<div class="d-flex justify-content-between">
|
|
|
106 |
<div class="cb-search-container mb-2 mr-2">
|
|
|
107 |
{{>core_contentbank/bankcontent/search}}
|
|
|
108 |
</div>
|
|
|
109 |
<div class="cb-toolbar-container mb-2 d-flex">
|
|
|
110 |
{{>core_contentbank/bankcontent/toolbar}}
|
|
|
111 |
</div>
|
|
|
112 |
</div>
|
|
|
113 |
<div class="cb-navigation-container mb-2">
|
|
|
114 |
{{>core_contentbank/bankcontent/navigation}}
|
|
|
115 |
</div>
|
|
|
116 |
<div class="pb-3 border">
|
|
|
117 |
<div class="content-bank">
|
|
|
118 |
<div class="cb-navbar bg-light p-2 border-bottom">
|
|
|
119 |
<div class="cb-navbar-breadbrumb">
|
|
|
120 |
{{#pix}} i/folder {{/pix}}
|
|
|
121 |
</div>
|
|
|
122 |
<div class="cb-navbar-totalsearch d-none">
|
|
|
123 |
</div>
|
|
|
124 |
</div>
|
|
|
125 |
{{#contents.0}}
|
|
|
126 |
<div role="{{#viewlist}}table{{/viewlist}}{{^viewlist}}list{{/viewlist}}" aria-label="{{#str}} contentbank, contentbank {{/str}}"
|
|
|
127 |
class="cb-content-wrapper d-flex px-2" data-region="filearea">
|
|
|
128 |
<div {{#viewlist}}role="row"{{/viewlist}} class="cb-heading bg-white">
|
|
|
129 |
<div {{#viewlist}}role="columnheader"{{/viewlist}} aria-sort="none" class="cb-file cb-column d-flex">
|
|
|
130 |
<button class="btn btn-block cb-btnsort dir-none text-left" data-string="contentname" data-action="sortname"
|
|
|
131 |
title="{{#str}} sortbyx, core, {{#str}} contentname, contentbank {{/str}} {{/str}}">
|
|
|
132 |
<span class="title">{{#str}} contentname, contentbank {{/str}}</span>
|
|
|
133 |
<span class="default">{{#pix}} t/sort, core {{/pix}}</span>
|
|
|
134 |
<span class="desc">{{#pix}} t/sort_desc, core {{/pix}}</span>
|
|
|
135 |
<span class="asc">{{#pix}} t/sort_asc, core {{/pix}}</span>
|
|
|
136 |
</button>
|
|
|
137 |
</div>
|
|
|
138 |
<div {{#viewlist}}role="columnheader"{{/viewlist}} aria-sort="none" class="cb-uses cb-column d-flex">
|
|
|
139 |
<button class="btn btn-block cb-btnsort dir-none text-left" data-string="uses" data-action="sortuses"
|
|
|
140 |
title="{{#str}} sortbyx, core, {{#str}} uses, contentbank {{/str}} {{/str}}">
|
|
|
141 |
<span class="title">{{#str}} uses, contentbank {{/str}}</span>
|
|
|
142 |
<span class="default">{{#pix}} t/sort, core {{/pix}}</span>
|
|
|
143 |
<span class="desc">{{#pix}} t/sort_desc, core {{/pix}}</span>
|
|
|
144 |
<span class="asc">{{#pix}} t/sort_asc, core {{/pix}}</span>
|
|
|
145 |
</button>
|
|
|
146 |
</div>
|
|
|
147 |
<div {{#viewlist}}role="columnheader"{{/viewlist}} aria-sort="none" class="cb-date cb-column d-flex">
|
|
|
148 |
<button class="btn btn-block cb-btnsort dir-none text-left" data-string="lastmodified" data-action="sortdate"
|
|
|
149 |
title="{{#str}} sortbyx, core, {{#str}} lastmodified, contentbank {{/str}} {{/str}}">
|
|
|
150 |
<span class="title">{{#str}} lastmodified, contentbank {{/str}}</span>
|
|
|
151 |
<span class="default">{{#pix}} t/sort, core {{/pix}}</span>
|
|
|
152 |
<span class="desc">{{#pix}} t/sort_desc, core {{/pix}}</span>
|
|
|
153 |
<span class="asc">{{#pix}} t/sort_asc, core {{/pix}}</span>
|
|
|
154 |
</button>
|
|
|
155 |
</div>
|
|
|
156 |
<div {{#viewlist}}role="columnheader"{{/viewlist}} aria-sort="none" class="cb-size cb-column d-flex">
|
|
|
157 |
<button class="btn btn-block cb-btnsort dir-none text-left" data-string="size" data-action="sortsize"
|
|
|
158 |
title="{{#str}} sortbyx, core, {{#str}} size, contentbank {{/str}} {{/str}}">
|
|
|
159 |
<span class="title">{{#str}} size, contentbank {{/str}}</span>
|
|
|
160 |
<span class="default">{{#pix}} t/sort, core {{/pix}}</span>
|
|
|
161 |
<span class="desc">{{#pix}} t/sort_desc, core {{/pix}}</span>
|
|
|
162 |
<span class="asc">{{#pix}} t/sort_asc, core {{/pix}}</span>
|
|
|
163 |
</button>
|
|
|
164 |
</div>
|
|
|
165 |
<div {{#viewlist}}role="columnheader"{{/viewlist}} aria-sort="none" class="cb-type cb-column d-flex">
|
|
|
166 |
<button class="btn btn-block cb-btnsort dir-none text-left" data-string="type" data-action="sorttype"
|
|
|
167 |
title="{{#str}} sortbyx, core, {{#str}} type, contentbank {{/str}} {{/str}}">
|
|
|
168 |
<span class="title">{{#str}} type, contentbank {{/str}}</span>
|
|
|
169 |
<span class="default">{{#pix}} t/sort, core {{/pix}}</span>
|
|
|
170 |
<span class="desc">{{#pix}} t/sort_desc, core {{/pix}}</span>
|
|
|
171 |
<span class="asc">{{#pix}} t/sort_asc, core {{/pix}}</span>
|
|
|
172 |
</button>
|
|
|
173 |
</div>
|
|
|
174 |
<div {{#viewlist}}role="columnheader"{{/viewlist}} aria-sort="none" class="cb-author cb-column d-flex last">
|
|
|
175 |
<button class="btn btn-block cb-btnsort dir-none text-left" data-string="author" data-action="sortauthor"
|
|
|
176 |
title="{{#str}} sortbyx, core, {{#str}} author, contentbank {{/str}} {{/str}}">
|
|
|
177 |
<span class="title">{{#str}} author, contentbank {{/str}}</span>
|
|
|
178 |
<span class="default">{{#pix}} t/sort, core {{/pix}}</span>
|
|
|
179 |
<span class="desc">{{#pix}} t/sort_desc, core {{/pix}}</span>
|
|
|
180 |
<span class="asc">{{#pix}} t/sort_asc, core {{/pix}}</span>
|
|
|
181 |
</button>
|
|
|
182 |
</div>
|
|
|
183 |
</div>
|
|
|
184 |
{{#contents}}
|
|
|
185 |
<div role="{{#viewlist}}row{{/viewlist}}{{^viewlist}}listitem{{/viewlist}}"
|
|
|
186 |
class="cb-listitem {{#visibilityunlisted}}cb-unlisted{{/visibilityunlisted}}"
|
|
|
187 |
data-file="{{ title }}"
|
|
|
188 |
data-name="{{ name }}"
|
|
|
189 |
data-bytes="{{ bytes }}"
|
|
|
190 |
data-uses="{{ uses }}"
|
|
|
191 |
data-timemodified="{{ timemodified }}"
|
|
|
192 |
data-type="{{ type }}"
|
|
|
193 |
data-author="{{ author }}">
|
|
|
194 |
<div {{#viewlist}}role="cell"{{/viewlist}} class="cb-file cb-column position-relative">
|
|
|
195 |
<div class="cb-thumbnail" style="background-image: url('{{{ icon }}}');">
|
|
|
196 |
</div>
|
|
|
197 |
<a href="{{{ link }}}" class="cb-link stretched-link">
|
|
|
198 |
<span class="cb-name word-break-all clamp-2" data-region="cb-content-name">
|
|
|
199 |
{{{ name }}}
|
|
|
200 |
</span>
|
|
|
201 |
</a>
|
|
|
202 |
</div>
|
|
|
203 |
<div {{#viewlist}}role="cell"{{/viewlist}} class="cb-uses cb-column small">
|
|
|
204 |
{{ uses }}
|
|
|
205 |
</div>
|
|
|
206 |
<div {{#viewlist}}role="cell"{{/viewlist}} class="cb-date cb-column small">
|
|
|
207 |
{{#userdate}} {{ timemodified }}, {{#str}} strftimedatetimeshort, core_langconfig {{/str}} {{/userdate}}
|
|
|
208 |
</div>
|
|
|
209 |
<div {{#viewlist}}role="cell"{{/viewlist}} class="cb-size cb-column small">
|
|
|
210 |
{{ size }}
|
|
|
211 |
</div>
|
|
|
212 |
<div {{#viewlist}}role="cell"{{/viewlist}} class="cb-type cb-column small">
|
|
|
213 |
{{{ type }}}
|
|
|
214 |
</div>
|
|
|
215 |
<div {{#viewlist}}role="cell"{{/viewlist}} class="cb-type cb-column last small">
|
|
|
216 |
{{{ author }}}
|
|
|
217 |
</div>
|
|
|
218 |
</div>
|
|
|
219 |
{{/contents}}
|
|
|
220 |
</div>
|
|
|
221 |
{{/contents.0}}
|
|
|
222 |
{{^contents.0}}
|
|
|
223 |
<div class="cb-content-wrapper d-flex flex-wrap p-2" data-region="filearea">
|
|
|
224 |
<div class="w-100 p-3 text-center text-muted">
|
|
|
225 |
{{#str}} nocontentavailable, core_contentbank {{/str}}
|
|
|
226 |
</div>
|
|
|
227 |
</div>
|
|
|
228 |
{{/contents.0}}
|
|
|
229 |
</div>
|
|
|
230 |
</div>
|
|
|
231 |
</div>
|