Permalink
Browse files

auth config: MDL-19053 Use the HTML editor to edit the login page aut…

…hentication instructions

They are actually displayed as HTML, but they are edited through a plain
text area control instead.
  • Loading branch information...
1 parent a012708 commit a24cd879b78c7925f5e6fde189d4ae48a77cd549 @iarenaza iarenaza committed Apr 10, 2010
Showing with 20 additions and 1 deletion.
  1. +1 −1 admin/settings/users.php
  2. +19 −0 lib/adminlib.php
View
@@ -25,7 +25,7 @@
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));
View
@@ -1917,6 +1917,25 @@ function output_html($data, $query='') {
}
/**
+ * 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
*/
class admin_setting_configpasswordunmask extends admin_setting_configtext {

0 comments on commit a24cd87

Please sign in to comment.