2 This file is part of Moodle - http://moodle.org/
3 Moodle is free software: you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation, either version 3 of the License, or
6 (at your option) any later version.
7 Moodle is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 GNU General Public License for more details.
11 You should have received a copy of the GNU General Public License
12 along with Moodle. If not, see <http://www.gnu.org/licenses/>.
15 @template core/tertiary_navigation_selector
17 Tertiary navigation selector.
19 Context variables required for this template:
20 * name - name of the form element
21 * value - value of the form element
22 * baseid - id of the dropdown element and to be used to generate id for other elements used internally
23 * label - Element label
24 * labelattributes - Label attributes.
25 * selectedoption - Text of the selected option
26 * options - Array of options for the select with value, name, selected, isgroup and id properites.
27 Example context (json):
29 "name": "Tertiary navigation selector",
31 "baseid": "select-menu56789",
32 "selectedoption": "Second option",
35 "name": "First option",
37 "id": "select-menu-option1",
41 "name": "Second option",
43 "id": "select-menu-option2",
49 "name": "First group",
50 "id": "select-menu-group1",
53 "name": "Third option",
55 "id": "select-menu-option3",
59 "name": "Fourth option",
61 "id": "select-menu-option4",
68 "name": "Fifth option",
70 "id": "select-menu-option5",
76 <nav class="tertiary-navigation-selector">
80 document.querySelector('#{{baseid}}').addEventListener('change', function(e) {
81 window.location.href = e.target.value;