(bug 16113) Show/hide for redirects in Special:NewPages. Patch by Paul Copperman
authorSiebrand Mazeland <siebrand@users.mediawiki.org>
Sun, 2 Nov 2008 22:58:35 +0000 (22:58 +0000)
committerSiebrand Mazeland <siebrand@users.mediawiki.org>
Sun, 2 Nov 2008 22:58:35 +0000 (22:58 +0000)
CREDITS
RELEASE-NOTES
includes/specials/SpecialNewpages.php
languages/messages/MessagesEn.php
maintenance/language/messages.inc

diff --git a/CREDITS b/CREDITS
index 84a25a5..6d2ac09 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -58,6 +58,7 @@ following names for their contribution to the product.
 * Mormegil
 * Nathaniel Herman
 * Nathan Larson
+* Paul Copperman
 * RememberTheDot
 * ST47
 
index 7141495..a216ff7 100644 (file)
@@ -188,6 +188,7 @@ The following extensions are migrated into MediaWiki 1.14:
 * (bug 13710) Allow to force "watch this" checkbox via URL using para "watchthis"
 * (bug 15125) Add Public Domain to default options when installing. Patch by Nathan Larson.
 * Set a special temporary directory for ImageMagick with $wgImageMagickTempDir
+* (bug 16113) Show/hide for redirects in Special:NewPages
 
 === Bug fixes in 1.14 ===
 
index 5096d2d..35bc265 100644 (file)
@@ -26,6 +26,7 @@ class SpecialNewpages extends SpecialPage {
                $opts->add( 'hideliu', false );
                $opts->add( 'hidepatrolled', false );
                $opts->add( 'hidebots', false );
+               $opts->add( 'hideredirs', true );
                $opts->add( 'limit', (int)$wgUser->getOption( 'rclimit' ) );
                $opts->add( 'offset', '' );
                $opts->add( 'namespace', '0' );
@@ -58,6 +59,8 @@ class SpecialNewpages extends SpecialPage {
                                $this->opts->setValue( 'hidepatrolled', true );
                        if ( 'hidebots' == $bit )
                                $this->opts->setValue( 'hidebots', true );
+                       if ( 'showredirs' == $bit )
+                               $this->opts->setValue( 'hideredirs', false );
                        if ( is_numeric( $bit ) )
                                $this->opts->setValue( 'limit', intval( $bit ) );
 
@@ -125,7 +128,8 @@ class SpecialNewpages extends SpecialPage {
                $filters = array(
                        'hideliu' => 'rcshowhideliu',
                        'hidepatrolled' => 'rcshowhidepatr',
-                       'hidebots' => 'rcshowhidebots'
+                       'hidebots' => 'rcshowhidebots',
+                       'hideredirs' => 'newpages-showhideredirs'
                );
 
                // Disable some if needed
@@ -142,8 +146,8 @@ class SpecialNewpages extends SpecialPage {
                $self = $this->getTitle();
                foreach ( $filters as $key => $msg ) {
                        $onoff = 1 - $this->opts->getValue($key);
-                       $link = $this->skin->makeKnownLinkObj( $self, $showhide[$onoff],
-                               wfArrayToCGI( array( $key => $onoff ), $changed )
+                       $link = $this->skin->link( $self, $showhide[$onoff], array(),
+                                array( $key => $onoff ) + $changed
                        );
                        $links[$key] = wfMsgHtml( $msg, $link );
                }
@@ -348,8 +352,6 @@ class NewPagesPager extends ReverseChronologicalPager {
        // Stored opts
        protected $opts, $mForm;
 
-       private $hideliu, $hidepatrolled, $hidebots, $namespace, $user, $spTitle;
-
        function __construct( $form, FormOptions $opts ) {
                parent::__construct();
                $this->mForm = $form;
@@ -381,7 +383,7 @@ class NewPagesPager extends ReverseChronologicalPager {
                        $rcIndexes = array( 'rc_timestamp' );
                }
                $conds[] = 'page_id = rc_cur_id';
-               $conds['page_is_redirect'] = 0;
+
                # $wgEnableNewpagesUserFilter - temp WMF hack
                if( $wgEnableNewpagesUserFilter && $user ) {
                        $conds['rc_user_text'] = $user->getText();
@@ -398,6 +400,10 @@ class NewPagesPager extends ReverseChronologicalPager {
                        $conds['rc_bot'] = 0;
                }
 
+               if ( $this->opts->getValue( 'hideredirs' ) ) {
+                       $conds['page_is_redirect'] = 0;
+               }
+
                return array(
                        'tables' => array( 'recentchanges', 'page' ),
                        'fields' => 'rc_namespace,rc_title, rc_cur_id, rc_user,rc_user_text,rc_comment,
index d9175fc..cb4cb2f 100644 (file)
@@ -2095,6 +2095,7 @@ Each row contains links to the first and second redirect, as well as the target
 'newpages'                        => 'New pages',
 'newpages-summary'                => '', # do not translate or duplicate this message to other languages
 'newpages-username'               => 'Username:',
+'newpages-showhideredirs'         => '$1 redirects',
 'ancientpages'                    => 'Oldest pages',
 'ancientpages-summary'            => '', # do not translate or duplicate this message to other languages
 'move'                            => 'Move',
index ce668c8..c0b2b66 100644 (file)
@@ -1363,6 +1363,7 @@ $wgMessageStructure = array(
                'newpages',
                'newpages-summary',
                'newpages-username',
+               'newpages-showhideredirs',
                'ancientpages',
                'ancientpages-summary',
                'move',