2 This file is part of Moodle - http://moodle.org/
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.
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.
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/>.
19 @template core/editswitch
21 This template renders the top navbar.
23 Example context (json):
25 "url": "http://localhost/",
31 "legacyseturl": "/editmode.php"
34 <div class="divider border-left h-75 align-self-center ml-1 mr-3"></div>
35 <form action="{{{legacyseturl}}}" method="post" class="d-flex align-items-center editmode-switch-form">
36 <div class="input-group">
37 <label class="mr-2 mb-0 {{#checked}}text-primary{{/checked}}" for="{{uniqid}}-editingswitch">
38 {{#str}} editmode {{/str}}
40 <div class="custom-control custom-switch">
41 <input type="checkbox"{{!
46 }} class="custom-control-input"{{!
47 }} id="{{uniqid}}-editingswitch"{{!
48 }} data-context="{{{pagecontextid}}}"{{!
49 }} data-pageurl="{{{pageurl}}}"{{!
51 <span class="custom-control-label"> </span>
54 <input type="hidden" name="sesskey" value="{{{sesskey}}}">
55 <input type="hidden" name="pageurl" value="{{{pageurl}}}">
56 <input type="hidden" name="context" value="{{{pagecontextid}}}">
58 <input type="submit" value="{{#str}}setmode, core{{/str}}">
62 require(['core/edit_switch'], function(editSwitch) {
63 editSwitch.init('{{uniqid}}-editingswitch');