auth config: MDL-19053 Use the HTML editor to edit the login page authentication instructions

They are actually displayed as HTML, but they are edited through a plain
text area control instead.
This commit is contained in:
Inaki
2010-04-10 15:11:49 +00:00
parent a012708185
commit a24cd879b7
2 changed files with 20 additions and 1 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ if ($hassiteconfig
get_string('alternatelogin', 'auth', htmlspecialchars($CFG->wwwroot.'/login/index.php')), ''));
$temp->add(new admin_setting_configtext('forgottenpasswordurl', get_string('forgottenpasswordurl', 'auth'),
get_string('forgottenpassword', 'auth'), ''));
$temp->add(new admin_setting_configtextarea('auth_instructions', get_string('instructions', 'auth'),
$temp->add(new admin_setting_confightmltextarea('auth_instructions', get_string('instructions', 'auth'),
get_string('authinstructions', 'auth'), ''));
$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));
+19
View File
@@ -1916,6 +1916,25 @@ class admin_setting_configtextarea extends admin_setting_configtext {
}
}
/**
* General text area with html editor.
*/
class admin_setting_confightmltextarea extends admin_setting_configtext {
function admin_setting_confightmltextarea($name, $visiblename, $description, $defaultsetting, $paramtype=PARAM_RAW) {
parent::admin_setting_configtext($name, $visiblename, $description, $defaultsetting, $paramtype);
}
function output_html($data, $query='') {
global $CFG;
$CFG->adminusehtmleditor = can_use_html_editor();
$return = '<div class="form-htmlarea">'.print_textarea($CFG->adminusehtmleditor, 15, 60, 0, 0, $this->get_full_name(), $data, 0, true).'</div>';
return format_admin_setting($this, $this->visiblename, $return, $this->description, false, '', NULL, $query);
}
}
/**
* Password field, allows unmasking of password
*/