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/user_menu_metadata
|
|
|
19 |
|
|
|
20 |
User menu metadata template.
|
|
|
21 |
|
|
|
22 |
Context variables required for this template:
|
|
|
23 |
* metadata - Array of additional metadata to be displayed in the dropdown button.
|
|
|
24 |
* classes - Additional classes to be applied to the content
|
|
|
25 |
* content - The content to be displayed. May/may not have html within it.
|
|
|
26 |
* avatardata - Array of avatars to be displayed. Usually only the current user's avatar. If viewing as another user,
|
|
|
27 |
includes that user's avatar.
|
|
|
28 |
* classes - Additional classes to be applied to the content
|
|
|
29 |
* content - The content to be displayed. May/may not have html within it.
|
|
|
30 |
* userfullname - The name of the logged in user
|
|
|
31 |
|
|
|
32 |
Example context (json):
|
|
|
33 |
{
|
|
|
34 |
"metadata": [
|
|
|
35 |
{
|
|
|
36 |
"classes": "loginfailures",
|
|
|
37 |
"content": "<span>1</span> failed login attempts"
|
|
|
38 |
}
|
|
|
39 |
],
|
|
|
40 |
"avatardata": [
|
|
|
41 |
{
|
|
|
42 |
"classes": "current",
|
|
|
43 |
"content": "<img src=\"http://localhost/stable_master/theme/image.php/boost/core/1617863836/u/f2\" class=\"userpicture defaultuserpic\">"
|
|
|
44 |
}
|
|
|
45 |
],
|
|
|
46 |
"userfullname": "Admin User"
|
|
|
47 |
}
|
|
|
48 |
}}
|
|
|
49 |
{{#metadata}}
|
|
|
50 |
<span class="usertext d-flex mr-3">
|
|
|
51 |
<span class="meta d-flex {{classes}}">
|
|
|
52 |
{{{content}}}
|
|
|
53 |
</span>
|
|
|
54 |
</span>
|
|
|
55 |
{{/metadata}}
|
|
|
56 |
<span class="avatars">
|
|
|
57 |
{{#avatardata}}
|
|
|
58 |
<span class="avatar {{classes}}">
|
|
|
59 |
{{{content}}}
|
|
|
60 |
</span>
|
|
|
61 |
{{/avatardata}}
|
|
|
62 |
</span>
|