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.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user