2 if (!defined('MOODLE_INTERNAL')) {
3 die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
7 require_once($CFG->libdir
.'/form/password.php');
10 * HTML class for a password type element with unmask option
15 class MoodleQuickForm_passwordunmask
extends MoodleQuickForm_password
{
18 if ($this->_flagFrozen
) {
19 return $this->getFrozenHtml();
21 $id = $this->getAttribute('id');
22 $unmask = get_string('unmaskpassword', 'form');
23 $unmaskjs = '<script type="text/javascript">
25 document.write(\'<div class="unmask"><input id="'.$id.'unmask" value="1" type="checkbox" onclick="unmaskPassword(\\\''.$id.'\\\')"/><label for="'.$id.'unmask">'.addslashes_js($unmask).'<\/label><\/div>\');
28 return $this->_getTabs() . '<input' . $this->_getAttrString($this->_attributes
) . ' />'.$unmaskjs;