Allow humans to suppress redirect too, not just bots. Added human interface, gave...
authorTim Starling <tstarling@users.mediawiki.org>
Mon, 6 Oct 2008 01:21:16 +0000 (01:21 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Mon, 6 Oct 2008 01:21:16 +0000 (01:21 +0000)
includes/DefaultSettings.php
includes/specials/SpecialMovepage.php
languages/messages/MessagesEn.php

index f9d3ced..45b94d9 100644 (file)
@@ -3456,4 +3456,4 @@ $wgPasswordAttemptThrottle = array( 'count' => 5, 'seconds' => 300 );
  * Cache-busting number for dismissable sitenotice
  * Don't bump this, instead bump the number on [[MediaWiki:Sitenotice id]]
  */
-$wgMajorSiteNoticeID = 1;
\ No newline at end of file
+$wgMajorSiteNoticeID = 1;
index 955dd54..dffa2e4 100644 (file)
@@ -56,7 +56,7 @@ function wfSpecialMovepage( $par = null ) {
 class MovePageForm {
        var $oldTitle, $newTitle; # Objects
        var $reason; # Text input
-       var $moveTalk, $deleteAndMove, $moveSubpages, $fixRedirects; # Checks
+       var $moveTalk, $deleteAndMove, $moveSubpages, $fixRedirects, $leaveRedirect; # Checks
 
        private $watch = false;
 
@@ -69,9 +69,11 @@ class MovePageForm {
                if ( $wgRequest->wasPosted() ) {
                        $this->moveTalk = $wgRequest->getBool( 'wpMovetalk', false );
                        $this->fixRedirects = $wgRequest->getBool( 'wpFixRedirects', false );
+                       $this->leaveRedirect = $wgRequest->getBool( 'wpLeaveRedirect', false );
                } else {
                        $this->moveTalk = $wgRequest->getBool( 'wpMovetalk', true );
                        $this->fixRedirects = $wgRequest->getBool( 'wpFixRedirects', true );
+                       $this->leaveRedirect = $wgRequest->getBool( 'wpLeaveRedirect', true );
                }
                $this->moveSubpages = $wgRequest->getBool( 'wpMovesubpages', false );
                $this->deleteAndMove = $wgRequest->getBool( 'wpDeleteAndMove' ) && $wgRequest->getBool( 'wpConfirm' );
@@ -201,6 +203,18 @@ class MovePageForm {
                        );
                }
 
+               if ( $wgUser->isAllowed( 'suppressredirect' ) ) {
+                       $wgOut->addHTML( "
+                               <tr>
+                                       <td></td>
+                                       <td class='mw-input' >" .
+                                               Xml::checkLabel( wfMsg( 'move-leave-redirect' ), 'wpLeaveRedirect', 
+                                                       'wpLeaveRedirect', $this->leaveRedirect ) .
+                                       "</td>
+                               </tr>"
+                       );
+               }
+
                if ( $hasRedirects ) {
                        $wgOut->addHTML( "
                                <tr>
@@ -294,7 +308,13 @@ class MovePageForm {
                        return;
                }
 
-               $error = $ot->moveTo( $nt, true, $this->reason );
+               if ( $wgUser->isAllowed( 'suppressredirect' ) ) {
+                       $createRedirect = $this->leaveRedirect;
+               } else {
+                       $createRedirect = true;
+               }
+
+               $error = $ot->moveTo( $nt, true, $this->reason, $createRedirect );
                if ( $error !== true ) {
                        call_user_func_array( array($this, 'showForm'), $error );
                        return;
index 73293d9..b2e8380 100644 (file)
@@ -2660,6 +2660,7 @@ cannot move pages from and into that namespace.',
 'imagetypemismatch'       => 'The new file extension does not match its type',
 'imageinvalidfilename'    => 'The target file name is invalid',
 'fix-double-redirects'    => 'Update any redirects that point to the original title',
+'move-leave-redirect'     => 'Leave a redirect behind',
 
 # Export
 'export'            => 'Export pages',