* @ingroup SpecialPage
*/
class MovePageForm extends UnlistedSpecialPage {
- /**
- * Objects
- * @var Title
- */
- var $oldTitle, $newTitle;
- // Text input
- var $reason;
+ /** @var Title */
+ protected $oldTitle;
+
+ /** @var Title */
+ protected $newTitle;
+
+
+ /** @var string Text input */
+ protected $reason;
+
// Checks
- var $moveTalk, $deleteAndMove, $moveSubpages, $fixRedirects, $leaveRedirect, $moveOverShared;
+
+ /** @var bool */
+ protected $moveTalk;
+
+ /** @var bool */
+ protected $deleteAndMove;
+
+ /** @var bool */
+ protected $moveSubpages;
+
+ /** @var bool */
+ protected $fixRedirects;
+
+ /** @var bool */
+ protected $leaveRedirect;
+
+ /** @var bool */
+ protected $moveOverShared;
private $watch = false;
"<div class=\"error mw-moveuserpage-warning\">\n$1\n</div>",
'moveuserpage-warning'
);
+ } elseif ( $this->oldTitle->getNamespace() == NS_CATEGORY ) {
+ $out->wrapWikiMsg(
+ "<div class=\"error mw-movecategorypage-warning\">\n$1\n</div>",
+ 'movecategorypage-warning'
+ );
}
$out->addWikiMsg( $wgFixDoubleRedirects ?
'form',
array(
'method' => 'post',
- 'action' => $this->getTitle()->getLocalURL( 'action=submit' ),
+ 'action' => $this->getPageTitle()->getLocalURL( 'action=submit' ),
'id' => 'movepage'
)
) .
);
}
- 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>
$this->msg( 'move-leave-redirect' )->text(),
'wpLeaveRedirect',
'wpLeaveRedirect',
- $this->leaveRedirect
+ $isChecked,
+ $options
) .
"</td>
</tr>"
$nt = $this->newTitle;
# don't allow moving to pages with # in
- if ( !$nt || $nt->getFragment() != '' ) {
+ if ( !$nt || $nt->hasFragment() ) {
$this->showForm( array( array( 'badtitletext' ) ) );
return;
$dbr = wfGetDB( DB_MASTER );
if ( $this->moveSubpages && (
MWNamespace::hasSubpages( $nt->getNamespace() ) || (
- $this->moveTalk &&
- MWNamespace::hasSubpages( $nt->getTalkPage()->getNamespace() )
+ $this->moveTalk
+ && MWNamespace::hasSubpages( $nt->getTalkPage()->getNamespace() )
)
) ) {
$conds = array(
$newSubpage = Title::makeTitleSafe( $newNs, $newPageName );
if ( !$newSubpage ) {
$oldLink = Linker::linkKnown( $oldSubpage );
- $extraOutput[] = $this->msg( 'movepage-page-unmoved' )->rawParams( $oldLink )
+ $extraOutput[] = $this->msg( 'movepage-page-unmoved' )->rawParams( $oldLink )
->params( Title::makeName( $newNs, $newPageName ) )->escaped();
continue;
}
);
$newLink = Linker::linkKnown( $newSubpage );
- $extraOutput[] = $this->msg( 'movepage-page-moved' )->rawParams( $oldLink, $newLink )->escaped();
+ $extraOutput[] = $this->msg( 'movepage-page-moved' )
+ ->rawParams( $oldLink, $newLink )->escaped();
++$count;
if ( $count >= $wgMaximumMovedPages ) {
- $extraOutput[] = $this->msg( 'movepage-max-pages' )->numParams( $wgMaximumMovedPages )->escaped();
+ $extraOutput[] = $this->msg( 'movepage-max-pages' )
+ ->numParams( $wgMaximumMovedPages )->escaped();
break;
}
} else {
$oldLink = Linker::linkKnown( $oldSubpage );
$newLink = Linker::link( $newSubpage );
- $extraOutput[] = $this->msg( 'movepage-page-unmoved' )->rawParams( $oldLink, $newLink )->escaped();
+ $extraOutput[] = $this->msg( 'movepage-page-unmoved' )
+ ->rawParams( $oldLink, $newLink )->escaped();
}
}
}
# Deal with watches (we don't watch subpages)
WatchAction::doWatchOrUnwatch( $this->watch, $ot, $user );
WatchAction::doWatchOrUnwatch( $this->watch, $nt, $user );
-
- # Re-clear the file redirect cache, which may have been polluted by
- # parsing in messages above. See CR r56745.
- # @todo FIXME: Needs a more robust solution inside FileRepo.
- if ( $ot->getNamespace() == NS_FILE ) {
- RepoGroup::singleton()->getLocalRepo()->invalidateImageRedirect( $ot );
- }
}
function showLogFragment( $title ) {