$wgGroupPermissions['user']['move'] = true;
$wgGroupPermissions['user']['move-subpages'] = true;
$wgGroupPermissions['user']['move-rootuserpages'] = true; // can move root userpages
+$wgGroupPermissions['user']['move-categorypages'] = true;
$wgGroupPermissions['user']['movefile'] = true;
$wgGroupPermissions['user']['read'] = true;
$wgGroupPermissions['user']['edit'] = true;
$wgGroupPermissions['sysop']['move'] = true;
$wgGroupPermissions['sysop']['move-subpages'] = true;
$wgGroupPermissions['sysop']['move-rootuserpages'] = true;
+$wgGroupPermissions['sysop']['move-categorypages'] = true;
$wgGroupPermissions['sysop']['patrol'] = true;
$wgGroupPermissions['sysop']['autopatrol'] = true;
$wgGroupPermissions['sysop']['protect'] = true;
public static function isMovable( $index ) {
global $wgAllowImageMoving;
- $result = !( $index < NS_MAIN || ( $index == NS_FILE && !$wgAllowImageMoving ) || $index == NS_CATEGORY );
+ $result = !( $index < NS_MAIN || ( $index == NS_FILE && !$wgAllowImageMoving ) );
/**
* @since 1.20
$errors[] = array( 'movenotallowedfile' );
}
+ // Check if user is allowed to move category pages if it's a category page
+ if ( $this->mNamespace == NS_CATEGORY && !$user->isAllowed( 'move-categorypages' ) ) {
+ $errors[] = array( 'cant-move-category-page' );
+ }
+
if ( !$user->isAllowed( 'move' ) ) {
// User can't move anything
$userCanMove = User::groupHasPermission( 'user', 'move' );
&& $this->mNamespace == NS_USER && !$this->isSubpage() ) {
// Show user page-specific message only if the user can move other pages
$errors[] = array( 'cant-move-to-user-page' );
+ } elseif ( !$user->isAllowed( 'move-categorypages' )
+ && $this->mNamespace == NS_CATEGORY ) {
+ // Show user page-specific message only if the user can move other pages
+ $errors[] = array( 'cant-move-to-category-page' );
}
} elseif ( !$user->isAllowed( $action ) ) {
$errors[] = $this->missingPermissionError( $action, $short );
}
if ( $createRedirect ) {
- $contentHandler = ContentHandler::getForTitle( $this );
- $redirectContent = $contentHandler->makeRedirectContent( $nt,
- wfMessage( 'move-redirect-text' )->inContentLanguage()->plain() );
+ if ( $this->getNamespace() == NS_CATEGORY && !wfMessage( 'category-move-redirect-override' )->isDisabled() ) {
+ $redirectContent = new WikitextContent(
+ wfMessage( 'category-move-redirect-override' )->params( $nt->getPrefixedText() )->inContentLanguage()->plain() );
+ } else {
+ $contentHandler = ContentHandler::getForTitle( $this );
+ $redirectContent = $contentHandler->makeRedirectContent( $nt,
+ wfMessage( 'move-redirect-text' )->inContentLanguage()->plain() );
+ }
// NOTE: If this page's content model does not support redirects, $redirectContent will be null.
} else {
'minoredit',
'move',
'movefile',
+ 'move-categorypages',
'move-rootuserpages',
'move-subpages',
'nominornewtalk',
"<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 ?
"right-move": "Move pages",
"right-move-subpages": "Move pages with their subpages",
"right-move-rootuserpages": "Move root user pages",
+ "right-move-categorypages": "Move category pages",
"right-movefile": "Move files",
"right-suppressredirect": "Not create redirects from source pages when moving pages",
"right-upload": "Upload files",
"action-move": "move this page",
"action-move-subpages": "move this page, and its subpages",
"action-move-rootuserpages": "move root user pages",
+ "action-move-categorypages": "move category pages",
"action-movefile": "move this file",
"action-upload": "upload this file",
"action-reupload": "overwrite this existing file",
"movepagetalktext": "The associated talk page will be automatically moved along with it <strong>unless:</strong>\n*A non-empty talk page already exists under the new name, or\n*You uncheck the box below.\n\nIn those cases, you will have to move or merge the page manually if desired.",
"movearticle": "Move page:",
"moveuserpage-warning": "<strong>Warning:</strong> You are about to move a user page. Please note that only the page will be moved and the user will <em>not</em> be renamed.",
+ "movecategorypage-warning": "<strong>Warning:</strong> You are about to move a category page. Please note that only the page will be moved and any pages in the old category will <em>not</em> be recategorized into the new one.",
"movenologintext": "You must be a registered user and [[Special:UserLogin|logged in]] to move a page.",
"movenotallowed": "You do not have permission to move pages.",
"movenotallowedfile": "You do not have permission to move files.",
"cant-move-user-page": "You do not have permission to move user pages (apart from subpages).",
"cant-move-to-user-page": "You do not have permission to move a page to a user page (except to a user subpage).",
+ "cant-move-category-page": "You do not have permission to move category pages.",
+ "cant-move-to-category-page": "You do not have permission to move a page to a category page.",
"newtitle": "To new title:",
"move-watch": "Watch source page and target page",
"movepagebtn": "Move page",
"movenosubpage": "This page has no subpages.",
"movereason": "Reason:",
"move-redirect-text": "",
+ "category-move-redirect-override": "-",
"revertmove": "revert",
"delete_and_move": "Delete and move",
"delete_and_move_text": "== Deletion required ==\nThe destination page \"[[:$1]]\" already exists.\nDo you want to delete it to make way for the move?",
"right-move": "{{doc-right|move}}\nThe right to move any page that is not protected from moving.\n{{Identical|Move page}}",
"right-move-subpages": "{{doc-right|move-subpages}}",
"right-move-rootuserpages": "{{doc-right|move-rootuserpages}}",
+ "right-move-categorypages": "{{doc-right|move-categorypages}}",
"right-movefile": "{{doc-right|movefile}}",
"right-suppressredirect": "{{doc-right|suppressredirect}}",
"right-upload": "{{doc-right|upload}}\nThe right to [[Special:Upload|upload]] a file (this includes images, media, audio, ...).\n{{Identical|Upload file}}",
"action-move": "{{Doc-action|move}}",
"action-move-subpages": "{{Doc-action|move-subpages}}",
"action-move-rootuserpages": "{{Doc-action|move-rootuserpages}}",
+ "action-move-categorypages": "{{Doc-action|move-categorypages}}",
"action-movefile": "{{doc-action|movefile}}",
"action-upload": "{{Doc-action|upload}}",
"action-reupload": "{{Doc-action|reupload}}",
"movepagetalktext": "Text on the special 'Move page'. This text only appears if the talk page is not empty.",
"movearticle": "The text before the name of the page that you are moving. Can be translated as \"Page that is going to be moved\". Used in [[Special:MovePage]].\n\nSee also:\n* {{msg-mw|move-page-legend|legend for the form}}\n* {{msg-mw|newtitle|label for new title}}\n* {{msg-mw|movereason|label for textarea}}\n* {{msg-mw|movetalk|label for checkbox}}\n* {{msg-mw|move-leave-redirect|label for checkbox}}\n* {{msg-mw|fix-double-redirects|label for checkbox}}\n* {{msg-mw|move-subpages|label for checkbox}}\n* {{msg-mw|move-talk-subpages|label for checkbox}}\n* {{msg-mw|move-watch|label for checkbox}}\n{{Identical|Move page}}",
"moveuserpage-warning": "Used as warning in [[Special:MovePage]], when moving a user page.",
- "movenologintext": "Text of message on special page 'Permissions Errors', which appears when somebody tries to move a page without being logged in.\n\nSee also:\n* {{msg-mw|cant-move-user-page}}\n* {{msg-mw|cant-move-to-user-page}}\n* {{msg-mw|movenotallowedfile}}\n* {{msg-mw|movenotallowed}}",
- "movenotallowed": "Used as error message.\n\nSee also:\n* {{msg-mw|cant-move-user-page}}\n* {{msg-mw|cant-move-to-user-page}}\n* {{msg-mw|movenotallowedfile}}\n* {{msg-mw|movenologintext}}",
- "movenotallowedfile": "Used as error message.\n\nSee also:\n* {{msg-mw|cant-move-user-page}}\n* {{msg-mw|cant-move-to-user-page}}\n* {{msg-mw|movenotallowed}}\n* {{msg-mw|movenologintext}}",
- "cant-move-user-page": "Used as error message.\n\nSee also:\n* {{msg-mw|cant-move-to-user-page}}\n* {{msg-mw|movenotallowedfile}}\n* {{msg-mw|movenotallowed}}\n* {{msg-mw|movenologintext}}",
- "cant-move-to-user-page": "Used as error message.\n\nSee also:\n* {{msg-mw|cant-move-user-page}}\n* {{msg-mw|movenotallowedfile}}\n* {{msg-mw|movenotallowed}}\n* {{msg-mw|movenologintext}}",
+ "movecategorypage-warning": "Used as warning in [[Special:MovePage]], when moving a category page.",
+ "movenologintext": "Text of message on special page 'Permissions Errors', which appears when somebody tries to move a page without being logged in.\n\nSee also:\n* {{msg-mw|cant-move-user-page}}\n* {{msg-mw|cant-move-to-user-page}}\n* {{msg-mw|cant-move-category-page}}\n* {{msg-mw|cant-move-to-category-page}}\n* {{msg-mw|movenotallowedfile}}\n* {{msg-mw|movenotallowed}}",
+ "movenotallowed": "Used as error message.\n\nSee also:\n* {{msg-mw|cant-move-user-page}}\n* {{msg-mw|cant-move-to-user-page}}\n* {{msg-mw|cant-move-category-page}}\n* {{msg-mw|cant-move-to-category-page}}\n* {{msg-mw|movenotallowedfile}}\n* {{msg-mw|movenologintext}}",
+ "movenotallowedfile": "Used as error message.\n\nSee also:\n* {{msg-mw|cant-move-user-page}}\n* {{msg-mw|cant-move-to-user-page}}\n* {{msg-mw|cant-move-category-page}}\n* {{msg-mw|cant-move-to-category-page}}\n* {{msg-mw|movenotallowed}}\n* {{msg-mw|movenologintext}}",
+ "cant-move-user-page": "Used as error message.\n\nSee also:\n* {{msg-mw|cant-move-to-user-page}}\n* {{msg-mw|cant-move-category-page}}\n* {{msg-mw|cant-move-to-category-page}}\n* {{msg-mw|movenotallowedfile}}\n* {{msg-mw|movenotallowed}}\n* {{msg-mw|movenologintext}}",
+ "cant-move-to-user-page": "Used as error message.\n\nSee also:\n* {{msg-mw|cant-move-user-page}}\n* {{msg-mw|cant-move-category-page}}\n* {{msg-mw|cant-move-to-category-page}}\n* {{msg-mw|movenotallowedfile}}\n* {{msg-mw|movenotallowed}}\n* {{msg-mw|movenologintext}}",
+ "cant-move-category-page": "Used as error message.\n\nSee also:\n* {{msg-mw|cant-move-user-page}}\n* {{msg-mw|cant-move-to-user-page}}\n* {{msg-mw|cant-move-to-category-page}}\n* {{msg-mw|movenotallowedfile}}\n* {{msg-mw|movenotallowed}}\n* {{msg-mw|movenologintext}}",
+ "cant-move-to-category-page": "Used as error message.\n\nSee also:\n* {{msg-mw|cant-move-user-page}}\n* {{msg-mw|cant-move-to-user-page}}\n* {{msg-mw|cant-move-category-page}}\n* {{msg-mw|movenotallowedfile}}\n* {{msg-mw|movenotallowed}}\n* {{msg-mw|movenologintext}}",
"newtitle": "Used in the special page \"[[Special:MovePage]]\". The text for the inputbox to give the new page title.\n\nSee also:\n* {{msg-mw|Move-page-legend|legend for the form}}\n* {{msg-mw|Movearticle|label for old title}}\n* {{msg-mw|Movereason|label for textarea}}\n* {{msg-mw|Movetalk|label for checkbox}}\n* {{msg-mw|Move-leave-redirect|label for checkbox}}\n* {{msg-mw|Fix-double-redirects|label for checkbox}}\n* {{msg-mw|Move-subpages|label for checkbox}}\n* {{msg-mw|Move-talk-subpages|label for checkbox}}\n* {{msg-mw|Move-watch|label for checkbox}}",
"move-watch": "The text of the checkbox to watch the pages you are moving from and to. If checked, both the destination page and the original page will be added to the watchlist, even if you decide not to leave a redirect behind.\n\nSee also:\n* {{msg-mw|Move-page-legend|legend for the form}}\n* {{msg-mw|Movearticle|label for old title}}\n* {{msg-mw|Newtitle|label for new title}}\n* {{msg-mw|Movereason|label for textarea}}\n* {{msg-mw|Movetalk|label for checkbox}}\n* {{msg-mw|Move-leave-redirect|label for checkbox}}\n* {{msg-mw|Fix-double-redirects|label for checkbox}}\n* {{msg-mw|Move-subpages|label for checkbox}}\n* {{msg-mw|Move-talk-subpages|label for checkbox}}",
"movepagebtn": "Button label on the special 'Move page'.\n\n{{Identical|Move page}}",
"movenosubpage": "See also:\n* {{msg-mw|movesubpage|section header}}\n* {{msg-mw|movenosubpage|without subpage}}\n* {{msg-mw|movesubpagetext|with subpages}}",
"movereason": "Used in [[Special:MovePage]]. The text for the inputbox to give a reason for the page move.\n\nSee also:\n* {{msg-mw|Move-page-legend|legend for the form}}\n* {{msg-mw|Movearticle|label for old title}}\n* {{msg-mw|Newtitle|label for new title}}\n* {{msg-mw|Movetalk|label for checkbox}}\n* {{msg-mw|Move-leave-redirect|label for checkbox}}\n* {{msg-mw|Fix-double-redirects|label for checkbox}}\n* {{msg-mw|Move-subpages|label for checkbox}}\n* {{msg-mw|Move-talk-subpages|label for checkbox}}\n* {{msg-mw|Move-watch|label for checkbox}}\n{{Identical|Reason}}",
"move-redirect-text": "{{ignored}}The text that's added to a redirected page when that redirect is created.",
+ "category-move-redirect-override": "{{ignored}}The text that's added to a redirected category page when that redirect is created.",
"revertmove": "{{Identical|Revert}}",
"delete_and_move": "Button text on the move page when the target page already exists.",
"delete_and_move_text": "Used when moving a page, but the destination page already exists and needs deletion.\n\nThis message is to confirm that you really want to delete the page.\n\nParameters:\n* $1 - the destination page title\n\nSee also:\n* {{msg-mw|Delete and move confirm}}",
'helplogin-url',
'autocomment-prefix',
'move-redirect-text',
+ 'category-move-redirect-override',
'interlanguage-link-title-langonly',
'createaccount-hook-abort',
);
'right-move',
'right-move-subpages',
'right-move-rootuserpages',
+ 'right-move-categorypages',
'right-movefile',
'right-suppressredirect',
'right-upload',
'action-move',
'action-move-subpages',
'action-move-rootuserpages',
+ 'action-move-categorypages',
'action-movefile',
'action-upload',
'action-reupload',
'movepagetalktext',
'movearticle',
'moveuserpage-warning',
+ 'movecategorypage-warning',
'movenologintext',
'movenotallowed',
'movenotallowedfile',
'cant-move-user-page',
'cant-move-to-user-page',
+ 'cant-move-category-page',
+ 'cant-move-to-category-page',
'newtitle',
'move-watch',
'movepagebtn',
'movenosubpage',
'movereason',
'move-redirect-text',
+ 'category-move-redirect-override',
'revertmove',
'delete_and_move',
'delete_and_move_text',
* @covers MWNamespace::isMovable
*/
public function testIsMovable() {
- $this->assertFalse( MWNamespace::isMovable( NS_CATEGORY ) );
+ $this->assertFalse( MWNamespace::isMovable( NS_SPECIAL ) );
# @todo FIXME: Write more tests!!
}