X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialMovepage.php;h=dce5ad95c232d52b89d3bbd84d27f6fd06bbebd5;hb=4e7a7d180585b8cdde185b2c7cc07e08b7bf1fb6;hp=0e342cc0bb4ad2f9e3ed615646fe3a8bf005dc0a;hpb=ae1274fd282f16e99b4c02a30020fb460d1db0b7;p=lhc%2Fweb%2Fwiklou.git
diff --git a/includes/specials/SpecialMovepage.php b/includes/specials/SpecialMovepage.php
index 0e342cc0bb..dce5ad95c2 100644
--- a/includes/specials/SpecialMovepage.php
+++ b/includes/specials/SpecialMovepage.php
@@ -27,15 +27,35 @@
* @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;
@@ -163,6 +183,11 @@ class MovePageForm extends UnlistedSpecialPage {
"
\n$1\n
",
'moveuserpage-warning'
);
+ } elseif ( $this->oldTitle->getNamespace() == NS_CATEGORY ) {
+ $out->wrapWikiMsg(
+ "\n$1\n
",
+ 'movecategorypage-warning'
+ );
}
$out->addWikiMsg( $wgFixDoubleRedirects ?
@@ -281,7 +306,7 @@ class MovePageForm extends UnlistedSpecialPage {
'form',
array(
'method' => 'post',
- 'action' => $this->getTitle()->getLocalURL( 'action=submit' ),
+ 'action' => $this->getPageTitle()->getLocalURL( 'action=submit' ),
'id' => 'movepage'
)
) .
@@ -351,7 +376,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( "
|
@@ -360,7 +394,8 @@ class MovePageForm extends UnlistedSpecialPage {
$this->msg( 'move-leave-redirect' )->text(),
'wpLeaveRedirect',
'wpLeaveRedirect',
- $this->leaveRedirect
+ $isChecked,
+ $options
) .
"
"
@@ -457,7 +492,7 @@ class MovePageForm extends UnlistedSpecialPage {
$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;
@@ -583,8 +618,8 @@ class MovePageForm extends UnlistedSpecialPage {
$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(
@@ -646,7 +681,7 @@ class MovePageForm extends UnlistedSpecialPage {
$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;
}
@@ -670,17 +705,20 @@ class MovePageForm extends UnlistedSpecialPage {
);
$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();
}
}
}
@@ -692,13 +730,6 @@ class MovePageForm extends UnlistedSpecialPage {
# 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 ) {