MDL-35847 - Accessibility - Adding warning icon to the login error message

This commit is contained in:
Jason Fowler 2013-01-31 11:02:49 +08:00
parent ef27582f08
commit 3246648b48

View File

@ -2325,12 +2325,14 @@ EOD;
* If the error message is blank, nothing is output.
*
* @param string $message the error message.
* @param bool $icon display the icon along with the error message.
* @return string the HTML to output.
*/
public function error_text($message) {
if (empty($message)) {
return '';
}
$message = $this->pix_icon('i/warning', get_string('error'), '', array('class' => 'icon icon-pre', 'title'=>'')) . $message;
return html_writer::tag('span', $message, array('class' => 'error'));
}