MDL-9652 rename new password reveal to unmask

This commit is contained in:
skodak 2007-04-30 18:03:19 +00:00
parent fb01314b0e
commit 54bb33eb10
13 changed files with 27 additions and 27 deletions

View file

@ -7,25 +7,25 @@ global $CFG;
require_once($CFG->libdir.'/form/password.php');
/**
* HTML class for a password type element with reveal option
* HTML class for a password type element with unmask option
*
* @author Petr Skoda
* @access public
*/
class MoodleQuickForm_passwordreveal extends MoodleQuickForm_password {
class MoodleQuickForm_passwordunmask extends MoodleQuickForm_password {
function toHtml() {
if ($this->_flagFrozen) {
return $this->getFrozenHtml();
} else {
$id = $this->getAttribute('id');
$reveal = get_string('revealpassword', 'form');
$revealjs = '<script type="text/javascript">
$unmask = get_string('unmaskpassword', 'form');
$unmaskjs = '<script type="text/javascript">
//<![CDATA[
document.write(\'<div class="reveal"><input id="'.$id.'reveal" value="1" type="checkbox" onclick="revealPassword(\\\''.$id.'\\\')"/><label for="'.$id.'reveal">'.addslashes_js($reveal).'<\/label><\/div>\');
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>\');
//]]>
</script>';
return $this->_getTabs() . '<input' . $this->_getAttrString($this->_attributes) . ' />'.$revealjs;
return $this->_getTabs() . '<input' . $this->_getAttrString($this->_attributes) . ' />'.$unmaskjs;
}
} //end func toHtml