From a24cd879b78c7925f5e6fde189d4ae48a77cd549 Mon Sep 17 00:00:00 2001 From: Inaki Date: Sat, 10 Apr 2010 15:11:49 +0000 Subject: [PATCH] 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. --- admin/settings/users.php | 2 +- lib/adminlib.php | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/admin/settings/users.php b/admin/settings/users.php index 7de1fe62ca9..89a6ea844ff 100644 --- a/admin/settings/users.php +++ b/admin/settings/users.php @@ -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)); diff --git a/lib/adminlib.php b/lib/adminlib.php index e4bbee6bd49..fc8e3af0eb9 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -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 = '
'.print_textarea($CFG->adminusehtmleditor, 15, 60, 0, 0, $this->get_full_name(), $data, 0, true).'
'; + + return format_admin_setting($this, $this->visiblename, $return, $this->description, false, '', NULL, $query); + } +} + /** * Password field, allows unmasking of password */