From c6c3d725631a9c35dddaf06d46641a0bdeb715f8 Mon Sep 17 00:00:00 2001 From: Nick Jenkins Date: Fri, 16 Feb 2007 03:43:40 +0000 Subject: [PATCH] (bug 3678) Allow disabling [[MediaWiki:aboutsite]] in the same way as [[MediaWiki:Disclaimers]]; Also means that if any of the footer links are disabled in the wiki's default language (by setting to "-"), they'll also be disabled in other languages too (e.g. if the user specifies uselang=fr), which was probably want the site admin wanted to happen anyway. --- RELEASE-NOTES | 4 ++++ includes/Skin.php | 28 ++++++++++++++-------------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 95cabf69fe..d5a66f31aa 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -187,6 +187,10 @@ lighter making things easier to read. * (bug 8944) The deprecated is_a() function is used in StubObjects.php * (bug 8978) Georgian i18n update * (bug 8992) Fix a remaining raw use of REQUEST_URI in history +* (bug 3678) Allow disabling MediaWiki:aboutsite in the same way as + MediaWiki:Disclaimers; Also means that if any of the footer links are + disabled in the wiki's default language (by setting to "-"), they'll also + be disabled in other languages too (e.g. if the user specifies uselang=fr). == Languages updated == diff --git a/includes/Skin.php b/includes/Skin.php index b91c23f950..55f1ca2d55 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -1202,29 +1202,29 @@ END; return $s; } - function privacyLink() { - $privacy = wfMsg( 'privacy' ); - if ($privacy == '-') { + private function footerLink ( $desc, $page ) { + // if the link description has been set to "-" in the default language, + if ( wfMsgForContent( $desc ) == '-') { + // then it is disabled, for all languages. return ''; } else { - return $this->makeKnownLink( wfMsgForContent( 'privacypage' ), $privacy); + // Otherwise, we display the link for the user, described in their + // language (which may or may not be the same as the default language), + // but we make the link target be the one site-wide page. + return $this->makeKnownLink( wfMsgForContent( $page ), wfMsg( $desc ) ); } } + function privacyLink() { + return $this->footerLink( 'privacy', 'privacypage' ); + } + function aboutLink() { - $s = $this->makeKnownLink( wfMsgForContent( 'aboutpage' ), - wfMsg( 'aboutsite' ) ); - return $s; + return $this->footerLink( 'aboutsite', 'aboutpage' ); } function disclaimerLink() { - $disclaimers = wfMsg( 'disclaimers' ); - if ($disclaimers == '-') { - return ''; - } else { - return $this->makeKnownLink( wfMsgForContent( 'disclaimerpage' ), - $disclaimers ); - } + return $this->footerLink( 'disclaimers', 'disclaimerpage' ); } function editThisPage() { -- 2.20.1