summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialMovepage.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2009-06-10 13:00:47 +0200
committerPierre Schmitz <pierre@archlinux.de>2009-06-10 13:00:47 +0200
commit72e90545454c0e014318fa3c81658e035aac58c1 (patch)
tree9212e3f46868989c4d57ae9a5c8a1a80e4dc0702 /includes/specials/SpecialMovepage.php
parent565a0ccc371ec1a2a0e9b39487cbac18e6f60e25 (diff)
applying patch to version 1.15.0
Diffstat (limited to 'includes/specials/SpecialMovepage.php')
-rw-r--r--includes/specials/SpecialMovepage.php48
1 files changed, 43 insertions, 5 deletions
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( "
<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" );
+ }
}
+