(bug 34334) add a footer to Special:Contributions for newbie mode
authorUmherirrender <umherirrender_de.wp@web.de>
Fri, 30 Mar 2012 18:15:58 +0000 (20:15 +0200)
committerAntoine Musso <hashar@free.fr>
Sat, 31 Mar 2012 08:35:01 +0000 (10:35 +0200)
Also rewrote logic that select the footer message so it is easier to
follow.

Change-Id: I8dbf445acc2246cda96a653a35523cbd988834b8

includes/specials/SpecialContributions.php
languages/messages/MessagesEn.php
maintenance/language/messageTypes.inc
maintenance/language/messages.inc

index c598457..03dd522 100644 (file)
@@ -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(
                                                "<div class='mw-contributions-footer'>\n$1\n</div>",
index 2f3cc12..f9a586a 100644 (file)
@@ -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',
index cc34d48..c61ae39 100644 (file)
@@ -136,6 +136,7 @@ $wgIgnoredMessages = array(
        'sitetitle',
        'sp-contributions-footer',
        'sp-contributions-footer-anon',
+       'sp-contributions-footer-newbies',
        'statistics-summary',
        'statistics-footer',
        'talkpagetext',
index b889a52..33488c5 100644 (file)
@@ -2081,6 +2081,7 @@ $wgMessageStructure = array(
                'sp-contributions-explain',
                'sp-contributions-footer',
                'sp-contributions-footer-anon',
+               'sp-contributions-footer-newbies',
        ),
        'whatlinkshere' => array(
                'whatlinkshere',