3 * Implements Special:Movepage
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
21 * @ingroup SpecialPage
25 * A special page that allows users to change page titles
27 * @ingroup SpecialPage
29 class MovePageForm
extends UnlistedSpecialPage
{
31 protected $oldTitle = null;
37 /** @var string Text input */
46 protected $deleteAndMove;
49 protected $moveSubpages;
52 protected $fixRedirects;
55 protected $leaveRedirect;
58 protected $moveOverShared;
60 private $watch = false;
62 public function __construct() {
63 parent
::__construct( 'Movepage' );
66 public function execute( $par ) {
67 $this->useTransactionalTimeLimit();
69 $this->checkReadOnly();
72 $this->outputHeader();
74 $request = $this->getRequest();
75 $target = !is_null( $par ) ?
$par : $request->getVal( 'target' );
77 // Yes, the use of getVal() and getText() is wanted, see bug 20365
79 $oldTitleText = $request->getVal( 'wpOldTitle', $target );
80 if ( is_string( $oldTitleText ) ) {
81 $this->oldTitle
= Title
::newFromText( $oldTitleText );
84 if ( $this->oldTitle
=== null ) {
85 // Either oldTitle wasn't passed, or newFromText returned null
86 throw new ErrorPageError( 'notargettitle', 'notargettext' );
88 if ( !$this->oldTitle
->exists() ) {
89 throw new ErrorPageError( 'nopagetitle', 'nopagetext' );
92 $newTitleTextMain = $request->getText( 'wpNewTitleMain' );
93 $newTitleTextNs = $request->getInt( 'wpNewTitleNs', $this->oldTitle
->getNamespace() );
94 // Backwards compatibility for forms submitting here from other sources
95 // which is more common than it should be..
96 $newTitleText_bc = $request->getText( 'wpNewTitle' );
97 $this->newTitle
= strlen( $newTitleText_bc ) > 0
98 ? Title
::newFromText( $newTitleText_bc )
99 : Title
::makeTitleSafe( $newTitleTextNs, $newTitleTextMain );
101 $user = $this->getUser();
104 $permErrors = $this->oldTitle
->getUserPermissionsErrors( 'move', $user );
105 if ( count( $permErrors ) ) {
106 // Auto-block user's IP if the account was "hard" blocked
107 DeferredUpdates
::addCallableUpdate( function() use ( $user ) {
108 $user->spreadAnyEditBlock();
110 throw new PermissionsError( 'move', $permErrors );
113 $def = !$request->wasPosted();
115 $this->reason
= $request->getText( 'wpReason' );
116 $this->moveTalk
= $request->getBool( 'wpMovetalk', $def );
117 $this->fixRedirects
= $request->getBool( 'wpFixRedirects', $def );
118 $this->leaveRedirect
= $request->getBool( 'wpLeaveRedirect', $def );
119 $this->moveSubpages
= $request->getBool( 'wpMovesubpages', false );
120 $this->deleteAndMove
= $request->getBool( 'wpDeleteAndMove' ) && $request->getBool( 'wpConfirm' );
121 $this->moveOverShared
= $request->getBool( 'wpMoveOverSharedFile', false );
122 $this->watch
= $request->getCheck( 'wpWatch' ) && $user->isLoggedIn();
124 if ( 'submit' == $request->getVal( 'action' ) && $request->wasPosted()
125 && $user->matchEditToken( $request->getVal( 'wpEditToken' ) )
129 $this->showForm( array() );
136 * @param array $err Error messages. Each item is an error message.
137 * It may either be a string message name or array message name and
138 * parameters, like the second argument to OutputPage::wrapWikiMsg().
140 function showForm( $err ) {
143 $this->getSkin()->setRelevantTitle( $this->oldTitle
);
145 $oldTitleLink = Linker
::link( $this->oldTitle
);
147 $out = $this->getOutput();
148 $out->setPageTitle( $this->msg( 'move-page', $this->oldTitle
->getPrefixedText() ) );
149 $out->addModules( 'mediawiki.special.movePage' );
150 $out->addModuleStyles( 'mediawiki.special.movePage.styles' );
151 $this->addHelpLink( 'Help:Moving a page' );
153 $newTitle = $this->newTitle
;
156 # Show the current title as a default
157 # when the form is first opened.
158 $newTitle = $this->oldTitle
;
159 } elseif ( !count( $err ) ) {
160 # If a title was supplied, probably from the move log revert
161 # link, check for validity. We can then show some diagnostic
162 # information and save a click.
163 $newerr = $this->oldTitle
->isValidMoveOperation( $newTitle );
164 if ( is_array( $newerr ) ) {
169 $user = $this->getUser();
171 if ( count( $err ) == 1 && isset( $err[0][0] ) && $err[0][0] == 'articleexists'
172 && $newTitle->quickUserCan( 'delete', $user )
174 $out->addWikiMsg( 'delete_and_move_text', $newTitle->getPrefixedText() );
175 $movepagebtn = $this->msg( 'delete_and_move' )->text();
176 $submitVar = 'wpDeleteAndMove';
180 if ( $this->oldTitle
->getNamespace() == NS_USER
&& !$this->oldTitle
->isSubpage() ) {
182 "<div class=\"error mw-moveuserpage-warning\">\n$1\n</div>",
183 'moveuserpage-warning'
185 } elseif ( $this->oldTitle
->getNamespace() == NS_CATEGORY
) {
187 "<div class=\"error mw-movecategorypage-warning\">\n$1\n</div>",
188 'movecategorypage-warning'
192 $out->addWikiMsg( $this->getConfig()->get( 'FixDoubleRedirects' ) ?
194 'movepagetext-noredirectfixer'
196 $movepagebtn = $this->msg( 'movepagebtn' )->text();
197 $submitVar = 'wpMove';
201 if ( count( $err ) == 1 && isset( $err[0][0] ) && $err[0][0] == 'file-exists-sharedrepo'
202 && $user->isAllowed( 'reupload-shared' )
204 $out->addWikiMsg( 'move-over-sharedrepo', $newTitle->getPrefixedText() );
205 $submitVar = 'wpMoveOverSharedFile';
209 $oldTalk = $this->oldTitle
->getTalkPage();
210 $oldTitleSubpages = $this->oldTitle
->hasSubpages();
211 $oldTitleTalkSubpages = $this->oldTitle
->getTalkPage()->hasSubpages();
213 $canMoveSubpage = ( $oldTitleSubpages ||
$oldTitleTalkSubpages ) &&
214 !count( $this->oldTitle
->getUserPermissionsErrors( 'move-subpages', $user ) );
216 # We also want to be able to move assoc. subpage talk-pages even if base page
217 # has no associated talk page, so || with $oldTitleTalkSubpages.
218 $considerTalk = !$this->oldTitle
->isTalkPage() &&
220 ||
( $oldTitleTalkSubpages && $canMoveSubpage ) );
222 $dbr = wfGetDB( DB_SLAVE
);
223 if ( $this->getConfig()->get( 'FixDoubleRedirects' ) ) {
224 $hasRedirects = $dbr->selectField( 'redirect', '1',
226 'rd_namespace' => $this->oldTitle
->getNamespace(),
227 'rd_title' => $this->oldTitle
->getDBkey(),
230 $hasRedirects = false;
233 if ( $considerTalk ) {
234 $out->addWikiMsg( 'movepagetalktext' );
237 if ( count( $err ) ) {
238 $out->addHTML( "<div class='error'>\n" );
239 $action_desc = $this->msg( 'action-move' )->plain();
240 $out->addWikiMsg( 'permissionserrorstext-withaction', count( $err ), $action_desc );
242 if ( count( $err ) == 1 ) {
244 $errMsgName = array_shift( $errMsg );
246 if ( $errMsgName == 'hookaborted' ) {
247 $out->addHTML( "<p>{$errMsg[0]}</p>\n" );
249 $out->addWikiMsgArray( $errMsgName, $errMsg );
254 foreach ( $err as $errMsg ) {
255 if ( $errMsg[0] == 'hookaborted' ) {
256 $errStr[] = $errMsg[1];
258 $errMsgName = array_shift( $errMsg );
259 $errStr[] = $this->msg( $errMsgName, $errMsg )->parse();
263 $out->addHTML( '<ul><li>' . implode( "</li>\n<li>", $errStr ) . "</li></ul>\n" );
265 $out->addHTML( "</div>\n" );
268 if ( $this->oldTitle
->isProtected( 'move' ) ) {
269 # Is the title semi-protected?
270 if ( $this->oldTitle
->isSemiProtected( 'move' ) ) {
271 $noticeMsg = 'semiprotectedpagemovewarning';
272 $classes[] = 'mw-textarea-sprotected';
274 # Then it must be protected based on static groups (regular)
275 $noticeMsg = 'protectedpagemovewarning';
276 $classes[] = 'mw-textarea-protected';
278 $out->addHTML( "<div class='mw-warning-with-logexcerpt'>\n" );
279 $out->addWikiMsg( $noticeMsg );
280 LogEventsList
::showLogExtract(
287 $out->addHTML( "</div>\n" );
290 // Byte limit (not string length limit) for wpReason and wpNewTitleMain
291 // is enforced in the mediawiki.special.movePage module
293 $immovableNamespaces = array();
294 foreach ( array_keys( $this->getLanguage()->getNamespaces() ) as $nsId ) {
295 if ( !MWNamespace
::isMovable( $nsId ) ) {
296 $immovableNamespaces[] = $nsId;
300 $handler = ContentHandler
::getForTitle( $this->oldTitle
);
305 $fields[] = new OOUI\
FieldLayout(
306 new OOUI\
LabelWidget( array(
307 'label' => new OOUI\
HtmlSnippet( "<strong>$oldTitleLink</strong>" )
310 'label' => $this->msg( 'movearticle' )->text(),
315 $fields[] = new OOUI\
FieldLayout(
316 new MediaWiki\Widget\
ComplexTitleInputWidget( array(
317 'id' => 'wpNewTitle',
318 'namespace' => array(
319 'id' => 'wpNewTitleNs',
320 'name' => 'wpNewTitleNs',
321 'value' => $newTitle->getNamespace(),
322 'exclude' => $immovableNamespaces,
325 'id' => 'wpNewTitleMain',
326 'name' => 'wpNewTitleMain',
327 'value' => $wgContLang->recodeForEdit( $newTitle->getText() ),
328 // Inappropriate, since we're expecting the user to input a non-existent page's title
329 'suggestions' => false,
334 'label' => $this->msg( 'newtitle' )->text(),
339 $fields[] = new OOUI\
FieldLayout(
340 new OOUI\
TextInputWidget( array(
341 'name' => 'wpReason',
347 'label' => $this->msg( 'movereason' )->text(),
352 if ( $considerTalk ) {
353 $fields[] = new OOUI\
FieldLayout(
354 new OOUI\
CheckboxInputWidget( array(
355 'name' => 'wpMovetalk',
356 'id' => 'wpMovetalk',
358 'selected' => $this->moveTalk
,
361 'label' => $this->msg( 'movetalk' )->text(),
367 if ( $user->isAllowed( 'suppressredirect' ) ) {
368 if ( $handler->supportsRedirects() ) {
369 $isChecked = $this->leaveRedirect
;
375 $fields[] = new OOUI\
FieldLayout(
376 new OOUI\
CheckboxInputWidget( array(
377 'name' => 'wpLeaveRedirect',
378 'id' => 'wpLeaveRedirect',
380 'selected' => $isChecked,
381 'disabled' => $isDisabled,
384 'label' => $this->msg( 'move-leave-redirect' )->text(),
390 if ( $hasRedirects ) {
391 $fields[] = new OOUI\
FieldLayout(
392 new OOUI\
CheckboxInputWidget( array(
393 'name' => 'wpFixRedirects',
394 'id' => 'wpFixRedirects',
396 'selected' => $this->fixRedirects
,
399 'label' => $this->msg( 'fix-double-redirects' )->text(),
405 if ( $canMoveSubpage ) {
406 $maximumMovedPages = $this->getConfig()->get( 'MaximumMovedPages' );
407 $fields[] = new OOUI\
FieldLayout(
408 new OOUI\
CheckboxInputWidget( array(
409 'name' => 'wpMovesubpages',
410 'id' => 'wpMovesubpages',
412 # Don't check the box if we only have talk subpages to
413 # move and we aren't moving the talk page.
414 'selected' => $this->moveSubpages
&& ( $this->oldTitle
->hasSubpages() ||
$this->moveTalk
),
417 'label' => new OOUI\
HtmlSnippet(
419 ( $this->oldTitle
->hasSubpages()
421 : 'move-talk-subpages' )
422 )->numParams( $maximumMovedPages )->params( $maximumMovedPages )->parse()
429 # Don't allow watching if user is not logged in
430 if ( $user->isLoggedIn() ) {
431 $watchChecked = $user->isLoggedIn() && ( $this->watch ||
$user->getBoolOption( 'watchmoves' )
432 ||
$user->isWatched( $this->oldTitle
) );
433 $fields[] = new OOUI\
FieldLayout(
434 new OOUI\
CheckboxInputWidget( array(
436 'id' => 'watch', # ew
438 'selected' => $watchChecked,
441 'label' => $this->msg( 'move-watch' )->text(),
448 $watchChecked = $user->isLoggedIn() && ( $this->watch ||
$user->getBoolOption( 'watchmoves' )
449 ||
$user->isWatched( $this->oldTitle
) );
450 $fields[] = new OOUI\
FieldLayout(
451 new OOUI\
CheckboxInputWidget( array(
452 'name' => 'wpConfirm',
457 'label' => $this->msg( 'delete_and_move_confirm' )->text(),
463 $fields[] = new OOUI\
FieldLayout(
464 new OOUI\
ButtonInputWidget( array(
465 'name' => $submitVar,
466 'value' => $movepagebtn,
467 'label' => $movepagebtn,
468 'flags' => array( 'progressive', 'primary' ),
476 $fieldset = new OOUI\
FieldsetLayout( array(
477 'label' => $this->msg( 'move-page-legend' )->text(),
478 'id' => 'mw-movepage-table',
482 $form = new OOUI\
FormLayout( array(
484 'action' => $this->getPageTitle()->getLocalURL( 'action=submit' ),
487 $form->appendContent(
489 new OOUI\
HtmlSnippet(
490 Html
::hidden( 'wpOldTitle', $this->oldTitle
->getPrefixedText() ) .
491 Html
::hidden( 'wpEditToken', $user->getEditToken() )
496 new OOUI\
PanelLayout( array(
497 'classes' => array( 'movepage-wrapper' ),
505 $this->showLogFragment( $this->oldTitle
);
506 $this->showSubpages( $this->oldTitle
);
509 function doSubmit() {
510 $user = $this->getUser();
512 if ( $user->pingLimiter( 'move' ) ) {
513 throw new ThrottledError
;
516 $ot = $this->oldTitle
;
517 $nt = $this->newTitle
;
519 # don't allow moving to pages with # in
520 if ( !$nt ||
$nt->hasFragment() ) {
521 $this->showForm( array( array( 'badtitletext' ) ) );
526 # Show a warning if the target file exists on a shared repo
527 if ( $nt->getNamespace() == NS_FILE
528 && !( $this->moveOverShared
&& $user->isAllowed( 'reupload-shared' ) )
529 && !RepoGroup
::singleton()->getLocalRepo()->findFile( $nt )
532 $this->showForm( array( array( 'file-exists-sharedrepo' ) ) );
537 # Delete to make way if requested
538 if ( $this->deleteAndMove
) {
539 $permErrors = $nt->getUserPermissionsErrors( 'delete', $user );
540 if ( count( $permErrors ) ) {
541 # Only show the first error
542 $this->showForm( $permErrors );
547 $reason = $this->msg( 'delete_and_move_reason', $ot )->inContentLanguage()->text();
549 // Delete an associated image if there is
550 if ( $nt->getNamespace() == NS_FILE
) {
551 $file = wfLocalFile( $nt );
552 $file->load( File
::READ_LATEST
);
553 if ( $file->exists() ) {
554 $file->delete( $reason, false, $user );
558 $error = ''; // passed by ref
559 $page = WikiPage
::factory( $nt );
560 $deleteStatus = $page->doDeleteArticleReal( $reason, false, 0, true, $error, $user );
561 if ( !$deleteStatus->isGood() ) {
562 $this->showForm( $deleteStatus->getErrorsArray() );
568 $handler = ContentHandler
::getForTitle( $ot );
570 if ( !$handler->supportsRedirects() ) {
571 $createRedirect = false;
572 } elseif ( $user->isAllowed( 'suppressredirect' ) ) {
573 $createRedirect = $this->leaveRedirect
;
575 $createRedirect = true;
578 # Do the actual move.
579 $mp = new MovePage( $ot, $nt );
580 $valid = $mp->isValidMove();
581 if ( !$valid->isOK() ) {
582 $this->showForm( $valid->getErrorsArray() );
586 $permStatus = $mp->checkPermissions( $user, $this->reason
);
587 if ( !$permStatus->isOK() ) {
588 $this->showForm( $permStatus->getErrorsArray() );
592 $status = $mp->move( $user, $this->reason
, $createRedirect );
593 if ( !$status->isOK() ) {
594 $this->showForm( $status->getErrorsArray() );
598 if ( $this->getConfig()->get( 'FixDoubleRedirects' ) && $this->fixRedirects
) {
599 DoubleRedirectJob
::fixRedirects( 'move', $ot, $nt );
602 $out = $this->getOutput();
603 $out->setPageTitle( $this->msg( 'pagemovedsub' ) );
605 $oldLink = Linker
::link(
608 array( 'id' => 'movepage-oldlink' ),
609 array( 'redirect' => 'no' )
611 $newLink = Linker
::linkKnown(
614 array( 'id' => 'movepage-newlink' )
616 $oldText = $ot->getPrefixedText();
617 $newText = $nt->getPrefixedText();
619 if ( $ot->exists() ) {
620 //NOTE: we assume that if the old title exists, it's because it was re-created as
621 // a redirect to the new title. This is not safe, but what we did before was
622 // even worse: we just determined whether a redirect should have been created,
623 // and reported that it was created if it should have, without any checks.
624 // Also note that isRedirect() is unreliable because of bug 37209.
625 $msgName = 'movepage-moved-redirect';
627 $msgName = 'movepage-moved-noredirect';
630 $out->addHTML( $this->msg( 'movepage-moved' )->rawParams( $oldLink,
631 $newLink )->params( $oldText, $newText )->parseAsBlock() );
632 $out->addWikiMsg( $msgName );
634 Hooks
::run( 'SpecialMovepageAfterMove', array( &$this, &$ot, &$nt ) );
636 # Now we move extra pages we've been asked to move: subpages and talk
637 # pages. First, if the old page or the new page is a talk page, we
638 # can't move any talk pages: cancel that.
639 if ( $ot->isTalkPage() ||
$nt->isTalkPage() ) {
640 $this->moveTalk
= false;
643 if ( count( $ot->getUserPermissionsErrors( 'move-subpages', $user ) ) ) {
644 $this->moveSubpages
= false;
647 # Next make a list of id's. This might be marginally less efficient
648 # than a more direct method, but this is not a highly performance-cri-
649 # tical code path and readable code is more important here.
651 # Note: this query works nicely on MySQL 5, but the optimizer in MySQL
652 # 4 might get confused. If so, consider rewriting as a UNION.
654 # If the target namespace doesn't allow subpages, moving with subpages
655 # would mean that you couldn't move them back in one operation, which
657 # @todo FIXME: A specific error message should be given in this case.
659 // @todo FIXME: Use Title::moveSubpages() here
660 $dbr = wfGetDB( DB_MASTER
);
661 if ( $this->moveSubpages
&& (
662 MWNamespace
::hasSubpages( $nt->getNamespace() ) ||
(
664 && MWNamespace
::hasSubpages( $nt->getTalkPage()->getNamespace() )
668 'page_title' . $dbr->buildLike( $ot->getDBkey() . '/', $dbr->anyString() )
669 . ' OR page_title = ' . $dbr->addQuotes( $ot->getDBkey() )
671 $conds['page_namespace'] = array();
672 if ( MWNamespace
::hasSubpages( $nt->getNamespace() ) ) {
673 $conds['page_namespace'][] = $ot->getNamespace();
675 if ( $this->moveTalk
&&
676 MWNamespace
::hasSubpages( $nt->getTalkPage()->getNamespace() )
678 $conds['page_namespace'][] = $ot->getTalkPage()->getNamespace();
680 } elseif ( $this->moveTalk
) {
682 'page_namespace' => $ot->getTalkPage()->getNamespace(),
683 'page_title' => $ot->getDBkey()
690 $extraPages = array();
691 if ( !is_null( $conds ) ) {
692 $extraPages = TitleArray
::newFromResult(
693 $dbr->select( 'page',
694 array( 'page_id', 'page_namespace', 'page_title' ),
701 $extraOutput = array();
703 foreach ( $extraPages as $oldSubpage ) {
704 if ( $ot->equals( $oldSubpage ) ||
$nt->equals( $oldSubpage ) ) {
705 # Already did this one.
709 $newPageName = preg_replace(
710 '#^' . preg_quote( $ot->getDBkey(), '#' ) . '#',
711 StringUtils
::escapeRegexReplacement( $nt->getDBkey() ), # bug 21234
712 $oldSubpage->getDBkey()
715 if ( $oldSubpage->isSubpage() && ( $ot->isTalkPage() xor $nt->isTalkPage() ) ) {
716 // Moving a subpage from a subject namespace to a talk namespace or vice-versa
717 $newNs = $nt->getNamespace();
718 } elseif ( $oldSubpage->isTalkPage() ) {
719 $newNs = $nt->getTalkPage()->getNamespace();
721 $newNs = $nt->getSubjectPage()->getNamespace();
724 # Bug 14385: we need makeTitleSafe because the new page names may
725 # be longer than 255 characters.
726 $newSubpage = Title
::makeTitleSafe( $newNs, $newPageName );
727 if ( !$newSubpage ) {
728 $oldLink = Linker
::linkKnown( $oldSubpage );
729 $extraOutput[] = $this->msg( 'movepage-page-unmoved' )->rawParams( $oldLink )
730 ->params( Title
::makeName( $newNs, $newPageName ) )->escaped();
734 # This was copy-pasted from Renameuser, bleh.
735 if ( $newSubpage->exists() && !$oldSubpage->isValidMoveTarget( $newSubpage ) ) {
736 $link = Linker
::linkKnown( $newSubpage );
737 $extraOutput[] = $this->msg( 'movepage-page-exists' )->rawParams( $link )->escaped();
739 $success = $oldSubpage->moveTo( $newSubpage, true, $this->reason
, $createRedirect );
741 if ( $success === true ) {
742 if ( $this->fixRedirects
) {
743 DoubleRedirectJob
::fixRedirects( 'move', $oldSubpage, $newSubpage );
745 $oldLink = Linker
::link(
749 array( 'redirect' => 'no' )
752 $newLink = Linker
::linkKnown( $newSubpage );
753 $extraOutput[] = $this->msg( 'movepage-page-moved' )
754 ->rawParams( $oldLink, $newLink )->escaped();
757 $maximumMovedPages = $this->getConfig()->get( 'MaximumMovedPages' );
758 if ( $count >= $maximumMovedPages ) {
759 $extraOutput[] = $this->msg( 'movepage-max-pages' )
760 ->numParams( $maximumMovedPages )->escaped();
764 $oldLink = Linker
::linkKnown( $oldSubpage );
765 $newLink = Linker
::link( $newSubpage );
766 $extraOutput[] = $this->msg( 'movepage-page-unmoved' )
767 ->rawParams( $oldLink, $newLink )->escaped();
772 if ( $extraOutput !== array() ) {
773 $out->addHTML( "<ul>\n<li>" . implode( "</li>\n<li>", $extraOutput ) . "</li>\n</ul>" );
776 # Deal with watches (we don't watch subpages)
777 WatchAction
::doWatchOrUnwatch( $this->watch
, $ot, $user );
778 WatchAction
::doWatchOrUnwatch( $this->watch
, $nt, $user );
781 function showLogFragment( $title ) {
782 $moveLogPage = new LogPage( 'move' );
783 $out = $this->getOutput();
784 $out->addHTML( Xml
::element( 'h2', null, $moveLogPage->getName()->text() ) );
785 LogEventsList
::showLogExtract( $out, 'move', $title );
788 function showSubpages( $title ) {
789 if ( !MWNamespace
::hasSubpages( $title->getNamespace() ) ) {
793 $subpages = $title->getSubpages();
794 $count = $subpages instanceof TitleArray ?
$subpages->count() : 0;
796 $out = $this->getOutput();
797 $out->wrapWikiMsg( '== $1 ==', array( 'movesubpage', $count ) );
801 $out->addWikiMsg( 'movenosubpage' );
806 $out->addWikiMsg( 'movesubpagetext', $this->getLanguage()->formatNum( $count ) );
807 $out->addHTML( "<ul>\n" );
809 foreach ( $subpages as $subpage ) {
810 $link = Linker
::link( $subpage );
811 $out->addHTML( "<li>$link</li>\n" );
813 $out->addHTML( "</ul>\n" );
816 protected function getGroupName() {