Skip to content

Commit

Permalink
MDL-73935 core: Update supportemail to accept optional custom attributes
Browse files Browse the repository at this point in the history
This allows calling code such as the generic error page to define the
styles of the anchor element.
  • Loading branch information
mickhawkins committed Feb 28, 2022
1 parent a0b3cf4 commit 533c5cc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/outputrenderers.php
Original file line number Diff line number Diff line change
Expand Up @@ -4132,9 +4132,10 @@ public function page_doc_link($text = null) {
/**
* 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');
Expand All @@ -4148,6 +4149,8 @@ public function supportemail(): string {
$attributes = ['href' => $CFG->wwwroot . '/user/contactsitesupport.php'];
}

$attributes += $customattribs;

return html_writer::tag('a', $content, $attributes);
}

Expand Down

0 comments on commit 533c5cc

Please sign in to comment.