mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 10:56:56 +02:00
Merge branch 'MDL-71610-master' of git://github.com/bmbrands/moodle
This commit is contained in:
commit
34a0ba3232
110 changed files with 769 additions and 265 deletions
63
lib/templates/editswitch.mustache
Normal file
63
lib/templates/editswitch.mustache
Normal file
|
@ -0,0 +1,63 @@
|
|||
{{!
|
||||
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 theme_boost/editswitch
|
||||
|
||||
This template renders the top navbar.
|
||||
|
||||
Example context (json):
|
||||
{
|
||||
"url": "http://localhost/",
|
||||
"sesskey": "sesskey",
|
||||
"edit": 1,
|
||||
"adminedit": true,
|
||||
"checked": "",
|
||||
"string": "Edit on"
|
||||
}
|
||||
}}
|
||||
<form action="{{{legacyseturl}}}" method="post" class="d-flex align-items-center editmode-switch-form">
|
||||
<div class="custom-control custom-control-right custom-switch text-nowrap">
|
||||
<input type="checkbox"{{!
|
||||
}} name="setmode"{{!
|
||||
}}{{#checked}}{{!
|
||||
}} aria-checked="true" checked{{!
|
||||
}}{{/checked}}{{!
|
||||
}}{{^checked}}{{!
|
||||
}} aria-checked="false"{{!
|
||||
}}{{/checked}}{{!
|
||||
}} class="custom-control-input"{{!
|
||||
}} id="{{uniqid}}-editingswitch"{{!
|
||||
}} data-context="{{{pagecontextid}}}"{{!
|
||||
}} data-pageurl="{{{pageurl}}}"{{!
|
||||
}}>
|
||||
<label class="custom-control-label" for="{{uniqid}}-editingswitch">
|
||||
{{#str}} editmode {{/str}}
|
||||
</label>
|
||||
<input type="hidden" name="sesskey" value="{{{sesskey}}}">
|
||||
<input type="hidden" name="pageurl" value="{{{pageurl}}}">
|
||||
<input type="hidden" name="context" value="{{{pagecontextid}}}">
|
||||
<noscript>
|
||||
<input type="submit" value="{{#str}}setmode, core{{/str}}">
|
||||
</noscript>
|
||||
</div>
|
||||
</form>
|
||||
{{#js}}
|
||||
require(['core/edit_switch'], function(editSwitch) {
|
||||
editSwitch.init('{{uniqid}}-editingswitch');
|
||||
});
|
||||
{{/js}}
|
Loading…
Add table
Add a link
Reference in a new issue