From 533c5ccb86d2b8aed2e26bead37150d7edca5fc3 Mon Sep 17 00:00:00 2001 From: Michael Hawkins Date: Tue, 22 Feb 2022 14:36:09 +0800 Subject: [PATCH] MDL-73935 core: Update supportemail to accept optional custom attributes This allows calling code such as the generic error page to define the styles of the anchor element. --- lib/outputrenderers.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index 53033201598..8eb6643379f 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -4132,9 +4132,10 @@ EOD; /** * Returns the HTML for the site support email link * + * @param array $customattribs Array of custom attributes for the support email anchor tag. * @return string The html code for the support email link. */ - public function supportemail(): string { + public function supportemail(array $customattribs = []): string { global $CFG; $label = get_string('contactsitesupport', 'admin'); @@ -4148,6 +4149,8 @@ EOD; $attributes = ['href' => $CFG->wwwroot . '/user/contactsitesupport.php']; } + $attributes += $customattribs; + return html_writer::tag('a', $content, $attributes); }