Skip to content

Commit

Permalink
Add early exit for footer hook
Browse files Browse the repository at this point in the history
  • Loading branch information
alistair3149 authored Nov 13, 2024
1 parent 339abe1 commit 24a7e8b
Showing 1 changed file with 52 additions and 51 deletions.
103 changes: 52 additions & 51 deletions config/LocalSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -1304,58 +1304,59 @@
* @see https://www.mediawiki.org/wiki/Manual:Hooks/SkinAddFooterLinks
*/
$wgHooks['SkinAddFooterLinks'][] = function( $sk, $key, &$footerlinks ) {
$rel = 'nofollow noreferrer noopener';

if ( $key === 'places' ) {
$footerlinks[ 'cookiestatement' ] = Html::rawElement( 'a',
[
'href' => Title::newFromText(
$sk->msg('cookiestatementpage')->inContentLanguage()->text()
)->getFullURL()
],
$sk->msg('cookiestatement')->escaped()
);
//$footerlinks['analytics'] = Html::rawElement(
// 'a',
// [
// 'href' => 'https://analytics.starcitizen.tools/starcitizen.tools',
// 'rel' => $rel
// ],
// $sk->msg( 'footer-analytics' )->escaped()
//);
$footerlinks['statuspage'] = Html::rawElement(
'a',
[
'href' => 'https://status.starcitizen.tools',
'rel' => $rel
],
$sk->msg('footer-statuspage')->escaped()
);
$footerlinks['github'] = Html::rawElement(
'a',
[
'href' => 'https://github.com/StarCitizenTools',
'rel' => $rel
],
$sk->msg('footer-github')->escaped()
);
$footerlinks['patreon'] = Html::rawElement(
'a',
[
'href' => 'https://www.patreon.com/starcitizentools',
'rel' => $rel
],
$sk->msg('footer-patreon')->escaped()
);
$footerlinks['kofi'] = Html::rawElement(
'a',
[
'href' => 'https://ko-fi.com/starcitizentools',
'rel' => $rel
],
$sk->msg('footer-kofi')->escaped()
);
// Early edit
if ( $key !== 'places' ) {
return;
}
$rel = 'nofollow noreferrer noopener';
$footerlinks[ 'cookiestatement' ] = Html::rawElement( 'a',
[
'href' => Title::newFromText(
$sk->msg('cookiestatementpage')->inContentLanguage()->text()
)->getFullURL()
],
$sk->msg('cookiestatement')->escaped()
);
//$footerlinks['analytics'] = Html::rawElement(
// 'a',
// [
// 'href' => 'https://analytics.starcitizen.tools/starcitizen.tools',
// 'rel' => $rel
// ],
// $sk->msg( 'footer-analytics' )->escaped()
//);
$footerlinks['statuspage'] = Html::rawElement(
'a',
[
'href' => 'https://status.starcitizen.tools',
'rel' => $rel
],
$sk->msg('footer-statuspage')->escaped()
);
$footerlinks['github'] = Html::rawElement(
'a',
[
'href' => 'https://github.com/StarCitizenTools',
'rel' => $rel
],
$sk->msg('footer-github')->escaped()
);
$footerlinks['patreon'] = Html::rawElement(
'a',
[
'href' => 'https://www.patreon.com/starcitizentools',
'rel' => $rel
],
$sk->msg('footer-patreon')->escaped()
);
$footerlinks['kofi'] = Html::rawElement(
'a',
[
'href' => 'https://ko-fi.com/starcitizentools',
'rel' => $rel
],
$sk->msg('footer-kofi')->escaped()
);
};

/**
Expand Down

0 comments on commit 24a7e8b

Please sign in to comment.