r43099 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43098‎ | r43099 | r43100 >
Date:22:58, 2 November 2008
Author:siebrand
Status:old
Tags:
Comment:
(bug 16113) Show/hide for redirects in Special:NewPages. Patch by Paul Copperman
Modified paths:
  • /trunk/phase3/CREDITS (modified) (history)
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/specials/SpecialNewpages.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -1363,6 +1363,7 @@
13641364 'newpages',
13651365 'newpages-summary',
13661366 'newpages-username',
 1367+ 'newpages-showhideredirs',
13671368 'ancientpages',
13681369 'ancientpages-summary',
13691370 'move',
Index: trunk/phase3/CREDITS
@@ -58,6 +58,7 @@
5959 * Mormegil
6060 * Nathaniel Herman
6161 * Nathan Larson
 62+* Paul Copperman
6263 * RememberTheDot
6364 * ST47
6465
Index: trunk/phase3/includes/specials/SpecialNewpages.php
@@ -26,6 +26,7 @@
2727 $opts->add( 'hideliu', false );
2828 $opts->add( 'hidepatrolled', false );
2929 $opts->add( 'hidebots', false );
 30+ $opts->add( 'hideredirs', true );
3031 $opts->add( 'limit', (int)$wgUser->getOption( 'rclimit' ) );
3132 $opts->add( 'offset', '' );
3233 $opts->add( 'namespace', '0' );
@@ -58,6 +59,8 @@
5960 $this->opts->setValue( 'hidepatrolled', true );
6061 if ( 'hidebots' == $bit )
6162 $this->opts->setValue( 'hidebots', true );
 63+ if ( 'showredirs' == $bit )
 64+ $this->opts->setValue( 'hideredirs', false );
6265 if ( is_numeric( $bit ) )
6366 $this->opts->setValue( 'limit', intval( $bit ) );
6467
@@ -125,7 +128,8 @@
126129 $filters = array(
127130 'hideliu' => 'rcshowhideliu',
128131 'hidepatrolled' => 'rcshowhidepatr',
129 - 'hidebots' => 'rcshowhidebots'
 132+ 'hidebots' => 'rcshowhidebots',
 133+ 'hideredirs' => 'newpages-showhideredirs'
130134 );
131135
132136 // Disable some if needed
@@ -142,8 +146,8 @@
143147 $self = $this->getTitle();
144148 foreach ( $filters as $key => $msg ) {
145149 $onoff = 1 - $this->opts->getValue($key);
146 - $link = $this->skin->makeKnownLinkObj( $self, $showhide[$onoff],
147 - wfArrayToCGI( array( $key => $onoff ), $changed )
 150+ $link = $this->skin->link( $self, $showhide[$onoff], array(),
 151+ array( $key => $onoff ) + $changed
148152 );
149153 $links[$key] = wfMsgHtml( $msg, $link );
150154 }
@@ -348,8 +352,6 @@
349353 // Stored opts
350354 protected $opts, $mForm;
351355
352 - private $hideliu, $hidepatrolled, $hidebots, $namespace, $user, $spTitle;
353 -
354356 function __construct( $form, FormOptions $opts ) {
355357 parent::__construct();
356358 $this->mForm = $form;
@@ -381,7 +383,7 @@
382384 $rcIndexes = array( 'rc_timestamp' );
383385 }
384386 $conds[] = 'page_id = rc_cur_id';
385 - $conds['page_is_redirect'] = 0;
 387+
386388 # $wgEnableNewpagesUserFilter - temp WMF hack
387389 if( $wgEnableNewpagesUserFilter && $user ) {
388390 $conds['rc_user_text'] = $user->getText();
@@ -398,6 +400,10 @@
399401 $conds['rc_bot'] = 0;
400402 }
401403
 404+ if ( $this->opts->getValue( 'hideredirs' ) ) {
 405+ $conds['page_is_redirect'] = 0;
 406+ }
 407+
402408 return array(
403409 'tables' => array( 'recentchanges', 'page' ),
404410 'fields' => 'rc_namespace,rc_title, rc_cur_id, rc_user,rc_user_text,rc_comment,
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -2095,6 +2095,7 @@
20962096 'newpages' => 'New pages',
20972097 'newpages-summary' => '', # do not translate or duplicate this message to other languages
20982098 'newpages-username' => 'Username:',
 2099+'newpages-showhideredirs' => '$1 redirects',
20992100 'ancientpages' => 'Oldest pages',
21002101 'ancientpages-summary' => '', # do not translate or duplicate this message to other languages
21012102 'move' => 'Move',
Index: trunk/phase3/RELEASE-NOTES
@@ -188,6 +188,7 @@
189189 * (bug 13710) Allow to force "watch this" checkbox via URL using para "watchthis"
190190 * (bug 15125) Add Public Domain to default options when installing. Patch by Nathan Larson.
191191 * Set a special temporary directory for ImageMagick with $wgImageMagickTempDir
 192+* (bug 16113) Show/hide for redirects in Special:NewPages
192193
193194 === Bug fixes in 1.14 ===
194195

Status & tagging log