]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - includes/specials/SpecialMovepage.php
MediaWiki 1.15.0
[autoinstallsdev/mediawiki.git] / includes / specials / SpecialMovepage.php
index acc27625dc24d8b6b095c6cfb772676133d7830d..8fcf33a93f9db707f572873d9faae28b773be140 100644 (file)
@@ -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( "
                                <tr>
                                        <td></td>
                                        <td class=\"mw-input\">" .
-                               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( "<ul>\n" );
+
+               foreach( $subpages as $subpage ) {
+                       $link = $skin->link( $subpage );
+                       $out->addHTML( "<li>$link</li>\n" );
+               }
+               $out->addHTML( "</ul>\n" );
+       }
 }
+