Merge "Disabled, unticked "Leave redirect" checkbox when redirect impossible"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 26 Dec 2013 15:01:11 +0000 (15:01 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 26 Dec 2013 15:01:11 +0000 (15:01 +0000)
includes/specials/SpecialMovepage.php

index 253e6cc..9193b5d 100644 (file)
@@ -351,7 +351,16 @@ class MovePageForm extends UnlistedSpecialPage {
                        );
                }
 
-               if ( $user->isAllowed( 'suppressredirect' ) && $handler->supportsRedirects() ) {
+               if ( $user->isAllowed( 'suppressredirect' ) ) {
+                       if ( $handler->supportsRedirects() ) {
+                               $isChecked = $this->leaveRedirect;
+                               $options = array();
+                       } else {
+                               $isChecked = false;
+                               $options = array(
+                                       'disabled' => 'disabled'
+                               );
+                       }
                        $out->addHTML( "
                                <tr>
                                        <td></td>
@@ -360,7 +369,8 @@ class MovePageForm extends UnlistedSpecialPage {
                                                $this->msg( 'move-leave-redirect' )->text(),
                                                'wpLeaveRedirect',
                                                'wpLeaveRedirect',
-                                               $this->leaveRedirect
+                                               $isChecked,
+                                               $options
                                        ) .
                                        "</td>
                                </tr>"