From 2419f5072436622086e9aefff73179eab094d1a0 Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Fri, 30 Mar 2012 20:15:58 +0200 Subject: [PATCH] (bug 34334) add a footer to Special:Contributions for newbie mode Also rewrote logic that select the footer message so it is easier to follow. Change-Id: I8dbf445acc2246cda96a653a35523cbd988834b8 --- includes/specials/SpecialContributions.php | 20 +++++++++++--------- languages/messages/MessagesEn.php | 1 + maintenance/language/messageTypes.inc | 1 + maintenance/language/messages.inc | 1 + 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index c598457061..03dd5228a1 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -189,18 +189,20 @@ class SpecialContributions extends SpecialPage { } $out->preventClickjacking( $pager->getPreventClickjacking() ); + # Show the appropriate "footer" message - WHOIS tools, etc. - if ( $this->opts['contribs'] != 'newbie' ) { + if ( $this->opts['contribs'] == 'newbie' ) { + $message = 'sp-contributions-footer-newbies'; + } elseif( IP::isIPAddress( $target ) ) { + $message = 'sp-contributions-footer-anon'; + } elseif( $userObj->isAnon() ) { + // No message for non-existing users + $message = ''; + } else { $message = 'sp-contributions-footer'; - if ( IP::isIPAddress( $target ) ) { - $message = 'sp-contributions-footer-anon'; - } else { - if ( $userObj->isAnon() ) { - // No message for non-existing users - return; - } - } + } + if( $message ) { if ( !$this->msg( $message, $target )->isDisabled() ) { $out->wrapWikiMsg( "", diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 2f3cc1215a..f9a586a075 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -3069,6 +3069,7 @@ The latest block log entry is provided below for reference:', 'sp-contributions-explain' => '', # only translate this message to other languages if you have to change it 'sp-contributions-footer' => '-', # do not translate or duplicate this message to other languages 'sp-contributions-footer-anon' => '-', # do not translate or duplicate this message to other languages +'sp-contributions-footer-newbies' => '-', # do not translate or duplicate this message to other languages # What links here 'whatlinkshere' => 'What links here', diff --git a/maintenance/language/messageTypes.inc b/maintenance/language/messageTypes.inc index cc34d48e40..c61ae39e53 100644 --- a/maintenance/language/messageTypes.inc +++ b/maintenance/language/messageTypes.inc @@ -136,6 +136,7 @@ $wgIgnoredMessages = array( 'sitetitle', 'sp-contributions-footer', 'sp-contributions-footer-anon', + 'sp-contributions-footer-newbies', 'statistics-summary', 'statistics-footer', 'talkpagetext', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index b889a52b76..33488c53c0 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -2081,6 +2081,7 @@ $wgMessageStructure = array( 'sp-contributions-explain', 'sp-contributions-footer', 'sp-contributions-footer-anon', + 'sp-contributions-footer-newbies', ), 'whatlinkshere' => array( 'whatlinkshere', -- 2.20.1