From 2ecfc8fcb5750ac91bf3309d386e95aab615451d Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Wed, 18 Feb 2009 21:46:38 +0000 Subject: [PATCH] (bug 16762) Special:Movepage now shows a list of subpages when possible --- CREDITS | 1 + RELEASE-NOTES | 1 + includes/specials/SpecialMovepage.php | 29 +++++++++++++++++++++++++++ 3 files changed, 31 insertions(+) diff --git a/CREDITS b/CREDITS index 38d1730d2e..119f243425 100644 --- a/CREDITS +++ b/CREDITS @@ -68,6 +68,7 @@ following names for their contribution to the product. * Juliano F. Ravasi * Lucas Garczewski * Louperivois +* Manuel Menal * Marcin Cieślak * Marooned * Max Semenik diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 0b5aaabbd9..846fcf52cd 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -111,6 +111,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN Mediawiki:Shared-repo-name-REPONAME, where REPONAME is the name in $wgForeignFileRepos * Special:ListUsers: Sort list of usergroups by alphabet +* (bug 16762) Special:Movepage now shows a list of subpages when possible === Bug fixes in 1.15 === * (bug 16968) Special:Upload no longer throws useless warnings. diff --git a/includes/specials/SpecialMovepage.php b/includes/specials/SpecialMovepage.php index 0375edf7cd..d7a8eaa0f0 100644 --- a/includes/specials/SpecialMovepage.php +++ b/includes/specials/SpecialMovepage.php @@ -284,6 +284,7 @@ class MovePageForm { ); $this->showLogFragment( $this->oldTitle, $wgOut ); + $this->showSubpages( $this->oldTitle, $wgOut ); } @@ -497,4 +498,32 @@ class MovePageForm { LogEventsList::showLogExtract( $out, 'move', $title->getPrefixedText() ); } + function showSubpages( $title, $out ) { + global $wgUser; + + if( !MWNamespace::hasSubpages( $title->getNamespace() ) ) + return; + + $out->wrapWikiMsg( '== $1 ==', 'movesubpage' ); + $subpages = $title->getSubpages(); + + # No subpages. + if ( !( $subpages instanceof TitleArray ) || $subpages->count() == 0 ) { + $out->addWikiMsg( 'movenosubpage' ); + return; + } + + $skin = $wgUser->getSkin(); + $out->addHTML( "\n" ); + } } + -- 2.20.1