mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
56c34d71ef
This moves away from using escaped html injected into the template and uses partial templates instead.
71 lines
2.4 KiB
Plaintext
71 lines
2.4 KiB
Plaintext
{{!
|
|
This file is part of Moodle - http://moodle.org/
|
|
|
|
Moodle is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
Moodle is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
}}
|
|
{{!
|
|
@template core/moremenu
|
|
|
|
The More menu.
|
|
|
|
Example context (json):
|
|
{
|
|
"nodecollection": {
|
|
"children": [
|
|
{
|
|
"text": "Home",
|
|
"action": "/index.php?redirect=0",
|
|
"active": "true"
|
|
},
|
|
{
|
|
"text": "Dashboard",
|
|
"action": "/my"
|
|
},
|
|
{
|
|
"text": "Courses",
|
|
"action": "/course"
|
|
},
|
|
{
|
|
"text": "Site Administration",
|
|
"action": "/admin/search.php"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}}
|
|
<nav class="moremenu">
|
|
<ul id="moremenu-{{ uniqid }}-{{navbarstyle}}" role="menubar" class="nav more-nav {{navbarstyle}}">
|
|
{{#nodecollection}}
|
|
{{#children}}
|
|
{{> core/moremenu_children}}
|
|
{{/children}}
|
|
{{/nodecollection}}
|
|
{{#nodearray}}
|
|
{{> core/moremenu_children}}
|
|
{{/nodearray}}
|
|
<li role="none" class="nav-item dropdown dropdownmoremenu d-none" data-region="morebutton">
|
|
<a class="dropdown-toggle nav-link" href="#" id="moremenu-dropdown{{ uniqid }}" role="menuitem" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" tabindex="-1">
|
|
{{#str}}moremenu, core{{/str}}
|
|
</a>
|
|
<ul class="dropdown-menu dropdown-menu-right" data-region="moredropdown" aria-labelledby="moremenu-dropdown{{ uniqid }}" role="menu">
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
{{#js}}
|
|
require(['core/moremenu'], function(moremenu) {
|
|
moremenu(document.querySelector('#moremenu-{{ uniqid }}-{{navbarstyle}}'));
|
|
});
|
|
{{/js}}
|