r41714 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41713‎ | r41714 | r41715 >
Date:01:21, 6 October 2008
Author:tstarling
Status:old (Comments)
Tags:
Comment:
Allow humans to suppress redirect too, not just bots. Added human interface, gave sysops the right by default.
Modified paths:
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialMovepage.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/DefaultSettings.php
@@ -3456,4 +3456,4 @@
34573457 * Cache-busting number for dismissable sitenotice
34583458 * Don't bump this, instead bump the number on [[MediaWiki:Sitenotice id]]
34593459 */
3460 -$wgMajorSiteNoticeID = 1;
\ No newline at end of file
 3460+$wgMajorSiteNoticeID = 1;
Index: trunk/phase3/includes/specials/SpecialMovepage.php
@@ -56,7 +56,7 @@
5757 class MovePageForm {
5858 var $oldTitle, $newTitle; # Objects
5959 var $reason; # Text input
60 - var $moveTalk, $deleteAndMove, $moveSubpages, $fixRedirects; # Checks
 60+ var $moveTalk, $deleteAndMove, $moveSubpages, $fixRedirects, $leaveRedirect; # Checks
6161
6262 private $watch = false;
6363
@@ -69,9 +69,11 @@
7070 if ( $wgRequest->wasPosted() ) {
7171 $this->moveTalk = $wgRequest->getBool( 'wpMovetalk', false );
7272 $this->fixRedirects = $wgRequest->getBool( 'wpFixRedirects', false );
 73+ $this->leaveRedirect = $wgRequest->getBool( 'wpLeaveRedirect', false );
7374 } else {
7475 $this->moveTalk = $wgRequest->getBool( 'wpMovetalk', true );
7576 $this->fixRedirects = $wgRequest->getBool( 'wpFixRedirects', true );
 77+ $this->leaveRedirect = $wgRequest->getBool( 'wpLeaveRedirect', true );
7678 }
7779 $this->moveSubpages = $wgRequest->getBool( 'wpMovesubpages', false );
7880 $this->deleteAndMove = $wgRequest->getBool( 'wpDeleteAndMove' ) && $wgRequest->getBool( 'wpConfirm' );
@@ -201,6 +203,18 @@
202204 );
203205 }
204206
 207+ if ( $wgUser->isAllowed( 'suppressredirect' ) ) {
 208+ $wgOut->addHTML( "
 209+ <tr>
 210+ <td></td>
 211+ <td class='mw-input' >" .
 212+ Xml::checkLabel( wfMsg( 'move-leave-redirect' ), 'wpLeaveRedirect',
 213+ 'wpLeaveRedirect', $this->leaveRedirect ) .
 214+ "</td>
 215+ </tr>"
 216+ );
 217+ }
 218+
205219 if ( $hasRedirects ) {
206220 $wgOut->addHTML( "
207221 <tr>
@@ -294,7 +308,13 @@
295309 return;
296310 }
297311
298 - $error = $ot->moveTo( $nt, true, $this->reason );
 312+ if ( $wgUser->isAllowed( 'suppressredirect' ) ) {
 313+ $createRedirect = $this->leaveRedirect;
 314+ } else {
 315+ $createRedirect = true;
 316+ }
 317+
 318+ $error = $ot->moveTo( $nt, true, $this->reason, $createRedirect );
299319 if ( $error !== true ) {
300320 call_user_func_array( array($this, 'showForm'), $error );
301321 return;
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -2660,6 +2660,7 @@
26612661 'imagetypemismatch' => 'The new file extension does not match its type',
26622662 'imageinvalidfilename' => 'The target file name is invalid',
26632663 'fix-double-redirects' => 'Update any redirects that point to the original title',
 2664+'move-leave-redirect' => 'Leave a redirect behind',
26642665
26652666 # Export
26662667 'export' => 'Export pages',

Comments

#Comment by Voice of All (talk | contribs)   05:49, 11 October 2008

messages.inc not updated here

#Comment by Tim Starling (talk | contribs)   12:33, 11 October 2008

Seems to be there now.

Status & tagging log