From 72e90545454c0e014318fa3c81658e035aac58c1 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 10 Jun 2009 13:00:47 +0200 Subject: applying patch to version 1.15.0 --- includes/specials/SpecialMovepage.php | 48 +++++++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 5 deletions(-) (limited to 'includes/specials/SpecialMovepage.php') diff --git a/includes/specials/SpecialMovepage.php b/includes/specials/SpecialMovepage.php index acc27625..8fcf33a9 100644 --- a/includes/specials/SpecialMovepage.php +++ b/includes/specials/SpecialMovepage.php @@ -234,15 +234,22 @@ class MovePageForm { } if( ($this->oldTitle->hasSubpages() || $this->oldTitle->getTalkPage()->hasSubpages()) - && $this->oldTitle->userCan( 'move-subpages' ) ) { + && $this->oldTitle->userCan( 'move-subpages' ) ) + { + global $wgMaximumMovedPages, $wgLang; + $wgOut->addHTML( " " . - Xml::checkLabel( wfMsg( - $this->oldTitle->hasSubpages() - ? 'move-subpages' - : 'move-talk-subpages' + Xml::checkLabel( wfMsgExt( + ( $this->oldTitle->hasSubpages() + ? 'move-subpages' + : 'move-talk-subpages' ), + array( 'parsemag' ), + $wgLang->formatNum( $wgMaximumMovedPages ), + # $2 to allow use of PLURAL in message. + $wgMaximumMovedPages ), 'wpMovesubpages', 'wpMovesubpages', # Don't check the box if we only have talk subpages to @@ -278,6 +285,7 @@ class MovePageForm { ); $this->showLogFragment( $this->oldTitle, $wgOut ); + $this->showSubpages( $this->oldTitle, $wgOut ); } @@ -375,6 +383,8 @@ class MovePageForm { # would mean that you couldn't move them back in one operation, which # is bad. FIXME: A specific error message should be given in this # case. + + // FIXME: Use Title::moveSubpages() here $dbr = wfGetDB( DB_MASTER ); if( $this->moveSubpages && ( MWNamespace::hasSubpages( $nt->getNamespace() ) || ( @@ -489,4 +499,32 @@ class MovePageForm { LogEventsList::showLogExtract( $out, 'move', $title->getPrefixedText() ); } + function showSubpages( $title, $out ) { + global $wgUser, $wgLang; + + if( !MWNamespace::hasSubpages( $title->getNamespace() ) ) + return; + + $subpages = $title->getSubpages(); + $count = $subpages instanceof TitleArray ? $subpages->count() : 0; + + $out->wrapWikiMsg( '== $1 ==', array( 'movesubpage', $count ) ); + + # No subpages. + if ( $count == 0 ) { + $out->addWikiMsg( 'movenosubpage' ); + return; + } + + $out->addWikiMsg( 'movesubpagetext', $wgLang->formatNum( $count ) ); + $skin = $wgUser->getSkin(); + $out->addHTML( "\n" ); + } } + -- cgit v1.2.2