2016-08-15 17:38:24 +08:00
|
|
|
{{!
|
|
|
|
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/>.
|
|
|
|
}}
|
|
|
|
{{!
|
2016-09-21 16:48:03 +08:00
|
|
|
@template core_admin/setting_configpasswordunmask
|
|
|
|
|
|
|
|
Admin password unmask setting template.
|
|
|
|
|
|
|
|
Context variables required for this template:
|
|
|
|
* name - form element name
|
|
|
|
* size - form element size
|
|
|
|
* value - form element value
|
|
|
|
* id - element id
|
2020-02-18 23:42:58 +11:00
|
|
|
* readonly - has value been defined in config.php
|
2016-09-21 16:48:03 +08:00
|
|
|
|
|
|
|
Example context (json):
|
|
|
|
{
|
|
|
|
"name": "test",
|
|
|
|
"id": "test0",
|
|
|
|
"size": "8",
|
2019-12-20 13:30:40 +13:00
|
|
|
"value": "secret",
|
2020-02-18 23:42:58 +11:00
|
|
|
"readonly": false
|
2016-09-21 16:48:03 +08:00
|
|
|
}
|
2016-08-15 17:38:24 +08:00
|
|
|
}}
|
2020-02-18 23:42:58 +11:00
|
|
|
{{#readonly}}
|
2019-12-20 13:30:40 +13:00
|
|
|
<div class="form-password">
|
|
|
|
<input type="text"
|
|
|
|
name = "{{ name }}"
|
|
|
|
id="{{ id }}"
|
|
|
|
value="********"
|
|
|
|
size="{{ size }}"
|
|
|
|
class="form-control"
|
|
|
|
disabled
|
|
|
|
>
|
|
|
|
</div>
|
2020-02-18 23:42:58 +11:00
|
|
|
{{/readonly}}
|
|
|
|
{{^readonly}}
|
2016-08-15 17:38:24 +08:00
|
|
|
<div class="form-password">
|
2016-08-22 07:03:51 +08:00
|
|
|
<span data-passwordunmask="wrapper" data-passwordunmaskid="{{ id }}">
|
2016-11-23 15:02:33 +08:00
|
|
|
<span data-passwordunmask="editor">
|
2022-12-14 19:07:10 +00:00
|
|
|
<input type="password"
|
2023-03-14 10:22:44 +11:00
|
|
|
autocomplete="new-password"
|
2016-10-31 14:43:40 +08:00
|
|
|
name="{{ name }}"
|
|
|
|
id="{{ id }}"
|
|
|
|
value="{{ value }}"
|
2016-11-23 15:02:33 +08:00
|
|
|
data-size="{{ size }}"
|
2022-12-14 19:07:10 +00:00
|
|
|
class="form-control d-none"
|
2016-10-31 14:43:40 +08:00
|
|
|
>
|
2016-11-23 15:02:33 +08:00
|
|
|
</span>
|
|
|
|
<a href="#" data-passwordunmask="edit" title="{{ edithint }}">
|
|
|
|
<span data-passwordunmask="displayvalue">{{> core_form/element-passwordunmask-fill }}</span>
|
|
|
|
{{# pix }} t/passwordunmask-edit, core, {{# str }} passwordunmaskedithint, form {{/ str }}{{/ pix }}
|
|
|
|
</a>
|
|
|
|
<a href="#" data-passwordunmask="unmask" title="{{ unmaskhint }}">
|
|
|
|
{{# pix }} t/passwordunmask-reveal, core, {{# str }} passwordunmaskrevealhint, form {{/ str }}{{/ pix }}
|
|
|
|
</a>
|
|
|
|
<span data-passwordunmask="instructions" class="form-text text-muted" style="display: none;">
|
|
|
|
{{# str }} passwordunmaskinstructions, form {{/ str }}
|
|
|
|
</span>
|
2016-08-22 07:03:51 +08:00
|
|
|
</span>
|
2016-08-15 17:38:24 +08:00
|
|
|
</div>
|
|
|
|
{{#js}}
|
2016-08-22 07:03:51 +08:00
|
|
|
require(['core_form/passwordunmask'], function(PasswordUnmask) {
|
|
|
|
new PasswordUnmask("{{ id }}");
|
|
|
|
});
|
2016-08-15 17:38:24 +08:00
|
|
|
{{/js}}
|
2020-02-18 23:42:58 +11:00
|
|
|
{{/readonly}}
|