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
{
17 function MoodleQuickForm_passwordunmask($elementName=null, $elementLabel=null, $attributes=null) {
18 parent
::MoodleQuickForm_password($elementName, $elementLabel, $attributes);
23 if ($this->_flagFrozen
) {
24 return $this->getFrozenHtml();
26 $id = $this->getAttribute('id');
27 $unmask = get_string('unmaskpassword', 'form');
28 $unmaskjs = html_writer
::script(js_writer
::set_variable('punmask', array('id'=>$id, 'unmaskstr'=>$unmask)));
29 $unmaskjs .= html_writer
::script('', $CFG->httpswwwroot
.'/lib/form/passwordunmask.js');
30 return $this->_getTabs() . '<input' . $this->_getAttrString($this->_attributes
) . ' /><div class="unmask" id="'.$id.'unmaskdiv"></div>'.$unmaskjs;