0 => get_string('disableblogs','blog'))));
$temp->add(new admin_setting_configcheckbox('cronclionly', get_string('cronclionly', 'admin'), get_string('configcronclionly', 'admin'), 0));
-$temp->add(new admin_setting_configpasswordreveal('cronremotepassword', get_string('cronremotepassword', 'admin'), get_string('configcronremotepassword', 'admin'), '', PARAM_RAW));
+$temp->add(new admin_setting_configpasswordunmask('cronremotepassword', get_string('cronremotepassword', 'admin'), get_string('configcronremotepassword', 'admin'), '', PARAM_RAW));
$temp->add(new admin_setting_configcheckbox('passwordpolicy', get_string('passwordpolicy', 'admin'), get_string('configpasswordpolicy', 'admin'), 0));
$temp->add(new admin_setting_configtext('minpasswordlength', get_string('minpasswordlength', 'admin'), get_string('configminpasswordlength', 'admin'), 8, PARAM_INT));
$temp = new admin_settingpage('mail', get_string('mail','admin'));
$temp->add(new admin_setting_configtext('smtphosts', get_string('smtphosts', 'admin'), get_string('configsmtphosts', 'admin'), '', PARAM_HOST));
$temp->add(new admin_setting_configtext('smtpuser', get_string('smtpuser', 'admin'), get_string('configsmtpuser', 'admin'), '', PARAM_NOTAGS));
-$temp->add(new admin_setting_configpasswordreveal('smtppass', get_string('smtppass', 'admin'), get_string('configsmtpuser', 'admin'), '', PARAM_RAW));
+$temp->add(new admin_setting_configpasswordunmask('smtppass', get_string('smtppass', 'admin'), get_string('configsmtpuser', 'admin'), '', PARAM_RAW));
$temp->add(new admin_setting_configtext('noreplyaddress', get_string('noreplyaddress', 'admin'), get_string('confignoreplyaddress', 'admin'), 'noreply@' . $_SERVER['HTTP_HOST'], PARAM_NOTAGS));
$temp->add(new admin_setting_configtext('allowemailaddresses', get_string('allowemailaddresses', 'admin'), get_string('configallowemailaddresses', 'admin'), '', PARAM_NOTAGS));
$temp->add(new admin_setting_configtext('denyemailaddresses', get_string('denyemailaddresses', 'admin'), get_string('configdenyemailaddresses', 'admin'), '', PARAM_NOTAGS));
$mform->setHelpButton('visible', array('courseavailability', get_string('availability')), true);
$mform->setDefault('visible', 1);
- $mform->addElement('passwordreveal', 'password', get_string('enrolmentkey'), 'size="25"');
+ $mform->addElement('passwordunmask', 'password', get_string('enrolmentkey'), 'size="25"');
$mform->setHelpButton('password', array('enrolmentkey', get_string('enrolmentkey')), true);
$mform->setDefault('password', '');
$mform->setType('password', PARAM_RAW);
$mform->addElement('htmleditor', 'description', get_string('groupdescription', 'group'), array('rows'=> '15', 'course' => $courseid, 'cols'=>'45'));
$mform->setType('description', PARAM_RAW);
- $mform->addElement('passwordreveal', 'enrolmentkey', get_string('enrolmentkey', 'group'), 'maxlength="254" size="24"', get_string('enrolmentkey'));
+ $mform->addElement('passwordunmask', 'enrolmentkey', get_string('enrolmentkey', 'group'), 'maxlength="254" size="24"', get_string('enrolmentkey'));
$mform->setHelpButton('enrolmentkey', array('groupenrolmentkey', get_string('enrolmentkey', 'group')), true);
$mform->setType('enrolmentkey', PARAM_RAW);
$string['requiredelement'] = 'Required field';
$string['general'] = 'General';
$string['optional'] = 'Optional';
-$string['revealpassword'] = 'Reveal';
+$string['unmaskpassword'] = 'Unmask';
$string['modstandardels']='Common Module Settings';
$string['miscellaneoussettings']='Miscellaneous Settings';
$string['addfields']='Add $a fields to form';
}
-class admin_setting_configpasswordreveal extends admin_setting_configtext {
+class admin_setting_configpasswordunmask extends admin_setting_configtext {
- function admin_setting_configpasswordreveal($name, $visiblename, $description, $defaultsetting, $paramtype=PARAM_RAW) {
+ function admin_setting_configpasswordunmask($name, $visiblename, $description, $defaultsetting, $paramtype=PARAM_RAW) {
parent::admin_setting_configtext($name, $visiblename, $description, $defaultsetting, $paramtype);
}
$current = $this->get_setting();
}
$id = 'id_s_'.$this->name;
- $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 format_admin_setting($this->name, $this->visiblename,
- '<input type="password" class="form-text" id="id_s_'.$this->name.'" name="s_'.$this->name.'" value="'.s($current).'" />'.$revealjs,
+ '<input type="password" class="form-text" id="id_s_'.$this->name.'" name="s_'.$this->name.'" value="'.s($current).'" />'.$unmaskjs,
$this->description);
}
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
MoodleQuickForm::registerElementType('file', "$CFG->libdir/form/file.php", 'MoodleQuickForm_file');
MoodleQuickForm::registerElementType('group', "$CFG->libdir/form/group.php", 'MoodleQuickForm_group');
MoodleQuickForm::registerElementType('password', "$CFG->libdir/form/password.php", 'MoodleQuickForm_password');
-MoodleQuickForm::registerElementType('passwordreveal', "$CFG->libdir/form/passwordreveal.php", 'MoodleQuickForm_passwordreveal');
+MoodleQuickForm::registerElementType('passwordunmask', "$CFG->libdir/form/passwordunmask.php", 'MoodleQuickForm_passwordunmask');
MoodleQuickForm::registerElementType('radio', "$CFG->libdir/form/radio.php", 'MoodleQuickForm_radio');
MoodleQuickForm::registerElementType('select', "$CFG->libdir/form/select.php", 'MoodleQuickForm_select');
MoodleQuickForm::registerElementType('text', "$CFG->libdir/form/text.php", 'MoodleQuickForm_text');
return false;
}
-function revealPassword(id) {
+function unmaskPassword(id) {
var pw = document.getElementById(id);
- var chb = document.getElementById(id+'reveal');
+ var chb = document.getElementById(id+'unmask');
try {
// first try IE way - it can not set name attribute later
$mform->setType('username', PARAM_NOTAGS);
$mform->addRule('username', get_string('missingusername'), 'required', null, 'server');
- $mform->addElement('passwordreveal', 'password', get_string('password'), 'maxlength="32" size="12"');
+ $mform->addElement('passwordunmask', 'password', get_string('password'), 'maxlength="32" size="12"');
$mform->setType('password', PARAM_RAW);
$mform->addRule('password', get_string('missingpassword'), 'required', null, 'server');
$mform->setAdvanced('popup', $CFG->quiz_fix_popup);
$mform->setDefault('popup', $CFG->quiz_popup);
- $mform->addElement('passwordreveal', 'quizpassword', get_string("requirepassword", "quiz"));
+ $mform->addElement('passwordunmask', 'quizpassword', get_string("requirepassword", "quiz"));
$mform->setType('quizpassword', PARAM_TEXT);
$mform->setHelpButton('quizpassword', array("requirepassword", get_string("requirepassword", "quiz"), "quiz"));
$mform->setAdvanced('quizpassword', $CFG->quiz_fix_password);
form.mform .fcheckbox input {
margin-left: 0px;
}
-form.mform .fpassword .reveal {
+form.mform .fpassword .unmask {
display:inline;
}
-form.mform .fpassword .reveal input {
+form.mform .fpassword .unmask input {
margin-left:5px;
margin-right:3px;
}
padding: 0.3em 0 1.5em 0;
}
-#adminsettings .form-item .reveal input {
+#adminsettings .form-item .unmask input {
margin-left:5px;
margin-right:3px;
}
-#adminsettings .form-item .reveal label {
+#adminsettings .form-item .unmask label {
width: auto;
text-align: left;
}
$mform->setHelpButton('auth', array('authchange', get_string('chooseauthmethod','auth')));
$mform->setAdvanced('auth');
- $mform->addElement('passwordreveal', 'newpassword', get_string('newpassword'), 'size="20"');
+ $mform->addElement('passwordunmask', 'newpassword', get_string('newpassword'), 'size="20"');
$mform->setType('newpassword', PARAM_RAW);
//TODO: add missing help - empty means no change