dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "libs/Message: Improve documentation"
[lhc/web/wiklou.git]
/
includes
/
specials
/
SpecialMovepage.php
diff --git
a/includes/specials/SpecialMovepage.php
b/includes/specials/SpecialMovepage.php
index
161b41a
..
6da362d
100644
(file)
--- a/
includes/specials/SpecialMovepage.php
+++ b/
includes/specials/SpecialMovepage.php
@@
-197,7
+197,8
@@
class MovePageForm extends UnlistedSpecialPage {
}
if ( count( $err ) == 1 && isset( $err[0][0] ) && $err[0][0] == 'articleexists'
}
if ( count( $err ) == 1 && isset( $err[0][0] ) && $err[0][0] == 'articleexists'
- && $newTitle->quickUserCan( 'delete', $user )
+ && MediaWikiServices::getInstance()->getPermissionManager()
+ ->quickUserCan( 'delete', $user, $newTitle )
) {
$out->wrapWikiMsg(
"<div class='warningbox'>\n$1\n</div>\n",
) {
$out->wrapWikiMsg(
"<div class='warningbox'>\n$1\n</div>\n",
@@
-284,11
+285,9
@@
class MovePageForm extends UnlistedSpecialPage {
# Is the title semi-protected?
if ( $this->oldTitle->isSemiProtected( 'move' ) ) {
$noticeMsg = 'semiprotectedpagemovewarning';
# Is the title semi-protected?
if ( $this->oldTitle->isSemiProtected( 'move' ) ) {
$noticeMsg = 'semiprotectedpagemovewarning';
- $classes[] = 'mw-textarea-sprotected';
} else {
# Then it must be protected based on static groups (regular)
$noticeMsg = 'protectedpagemovewarning';
} else {
# Then it must be protected based on static groups (regular)
$noticeMsg = 'protectedpagemovewarning';
- $classes[] = 'mw-textarea-protected';
}
$out->addHTML( "<div class='mw-warning-with-logexcerpt'>\n" );
$out->addWikiMsg( $noticeMsg );
}
$out->addHTML( "<div class='mw-warning-with-logexcerpt'>\n" );
$out->addWikiMsg( $noticeMsg );
@@
-306,8
+305,9
@@
class MovePageForm extends UnlistedSpecialPage {
// mediawiki.special.movePage module
$immovableNamespaces = [];
// mediawiki.special.movePage module
$immovableNamespaces = [];
+ $namespaceInfo = MediaWikiServices::getInstance()->getNamespaceInfo();
foreach ( array_keys( $this->getLanguage()->getNamespaces() ) as $nsId ) {
foreach ( array_keys( $this->getLanguage()->getNamespaces() ) as $nsId ) {
- if ( !
MediaWikiServices::getInstance()->getNamespaceInfo()
->isMovable( $nsId ) ) {
+ if ( !
$namespaceInfo
->isMovable( $nsId ) ) {
$immovableNamespaces[] = $nsId;
}
}
$immovableNamespaces[] = $nsId;
}
}
@@
-419,9
+419,7
@@
class MovePageForm extends UnlistedSpecialPage {
'name' => 'wpMovesubpages',
'id' => 'wpMovesubpages',
'value' => '1',
'name' => 'wpMovesubpages',
'id' => 'wpMovesubpages',
'value' => '1',
- # Don't check the box if we only have talk subpages to
- # move and we aren't moving the talk page.
- 'selected' => $this->moveSubpages && ( $this->oldTitle->hasSubpages() || $this->moveTalk ),
+ 'selected' => true, // T222953 Always check the box
] ),
[
'label' => new OOUI\HtmlSnippet(
] ),
[
'label' => new OOUI\HtmlSnippet(
@@
-537,11
+535,14
@@
class MovePageForm extends UnlistedSpecialPage {
return;
}
return;
}
+ $services = MediaWikiServices::getInstance();
+
# Show a warning if the target file exists on a shared repo
# Show a warning if the target file exists on a shared repo
+ $repoGroup = $services->getRepoGroup();
if ( $nt->getNamespace() == NS_FILE
&& !( $this->moveOverShared && $user->isAllowed( 'reupload-shared' ) )
if ( $nt->getNamespace() == NS_FILE
&& !( $this->moveOverShared && $user->isAllowed( 'reupload-shared' ) )
- && !
RepoGroup::singleton()
->getLocalRepo()->findFile( $nt )
- &&
MediaWikiServices::getInstance()->getRepoGroup()
->findFile( $nt )
+ && !
$repoGroup
->getLocalRepo()->findFile( $nt )
+ &&
$repoGroup
->findFile( $nt )
) {
$this->showForm( [ [ 'file-exists-sharedrepo' ] ] );
) {
$this->showForm( [ [ 'file-exists-sharedrepo' ] ] );
@@
-571,8
+572,7
@@
class MovePageForm extends UnlistedSpecialPage {
// Delete an associated image if there is
if ( $nt->getNamespace() == NS_FILE ) {
// Delete an associated image if there is
if ( $nt->getNamespace() == NS_FILE ) {
- $file = MediaWikiServices::getInstance()->getRepoGroup()->getLocalRepo()
- ->newFile( $nt );
+ $file = $repoGroup->getLocalRepo()->newFile( $nt );
$file->load( File::READ_LATEST );
if ( $file->exists() ) {
$file->delete( $reason, false, $user );
$file->load( File::READ_LATEST );
if ( $file->exists() ) {
$file->delete( $reason, false, $user );
@@
-607,7
+607,7
@@
class MovePageForm extends UnlistedSpecialPage {
$this->moveTalk = false;
}
if ( $this->moveSubpages ) {
$this->moveTalk = false;
}
if ( $this->moveSubpages ) {
- $permissionManager =
MediaWikiServices::getInstance()
->getPermissionManager();
+ $permissionManager =
$services
->getPermissionManager();
$this->moveSubpages = $permissionManager->userCan( 'move-subpages', $user, $ot );
}
$this->moveSubpages = $permissionManager->userCan( 'move-subpages', $user, $ot );
}
@@
-673,7
+673,7
@@
class MovePageForm extends UnlistedSpecialPage {
*/
// @todo FIXME: Use Title::moveSubpages() here
*/
// @todo FIXME: Use Title::moveSubpages() here
- $nsInfo =
MediaWikiServices::getInstance()
->getNamespaceInfo();
+ $nsInfo =
$services
->getNamespaceInfo();
$dbr = wfGetDB( DB_MASTER );
if ( $this->moveSubpages && (
$nsInfo->hasSubpages( $nt->getNamespace() ) || (
$dbr = wfGetDB( DB_MASTER );
if ( $this->moveSubpages && (
$nsInfo->hasSubpages( $nt->getNamespace() ) || (
@@
-750,7
+750,7
@@
class MovePageForm extends UnlistedSpecialPage {
$mp = new MovePage( $oldSubpage, $newSubpage );
# This was copy-pasted from Renameuser, bleh.
$mp = new MovePage( $oldSubpage, $newSubpage );
# This was copy-pasted from Renameuser, bleh.
- if ( $newSubpage->exists() && !$mp->isValidMove()->isO
k
() ) {
+ if ( $newSubpage->exists() && !$mp->isValidMove()->isO
K
() ) {
$link = $linkRenderer->makeKnownLink( $newSubpage );
$extraOutput[] = $this->msg( 'movepage-page-exists' )->rawParams( $link )->escaped();
} else {
$link = $linkRenderer->makeKnownLink( $newSubpage );
$extraOutput[] = $this->msg( 'movepage-page-exists' )->rawParams( $link )->escaped();
} else {