42 protected $oldTitle =
null;
70 private $watch =
false;
73 private $movePageFactory;
79 private $userOptionsLookup;
82 private $loadBalancer;
85 private $contentHandlerFactory;
91 private $linkBatchFactory;
97 private $wikiPageFactory;
100 private $searchEngineFactory;
103 private $watchlistManager;
106 private $restrictionStore;
136 parent::__construct(
'Movepage' );
137 $this->movePageFactory = $movePageFactory;
138 $this->permManager = $permManager;
139 $this->userOptionsLookup = $userOptionsLookup;
140 $this->loadBalancer = $loadBalancer;
141 $this->contentHandlerFactory = $contentHandlerFactory;
142 $this->nsInfo = $nsInfo;
143 $this->linkBatchFactory = $linkBatchFactory;
144 $this->repoGroup = $repoGroup;
145 $this->wikiPageFactory = $wikiPageFactory;
146 $this->searchEngineFactory = $searchEngineFactory;
147 $this->watchlistManager = $watchlistManager;
148 $this->restrictionStore = $restrictionStore;
166 $target = $par ?? $request->getText(
'target' );
167 $oldTitleText = $request->getText(
'wpOldTitle', $target );
168 $this->oldTitle = Title::newFromText( $oldTitleText );
170 if ( !$this->oldTitle ) {
174 $this->
getOutput()->addBacklinkSubtitle( $this->oldTitle );
176 if ( !$this->oldTitle->exists() ) {
180 $newTitleTextMain = $request->getText(
'wpNewTitleMain' );
181 $newTitleTextNs = $request->getInt(
'wpNewTitleNs', $this->oldTitle->getNamespace() );
184 $newTitleText_bc = $request->getText(
'wpNewTitle' );
185 $this->newTitle = strlen( $newTitleText_bc ) > 0
186 ? Title::newFromText( $newTitleText_bc )
187 : Title::makeTitleSafe( $newTitleTextNs, $newTitleTextMain );
192 $permErrors = $this->permManager->getPermissionErrors(
'move', $user, $this->oldTitle );
193 if ( count( $permErrors ) ) {
195 DeferredUpdates::addCallableUpdate(
static function () use ( $user ) {
196 $user->spreadAnyEditBlock();
201 $def = !$request->wasPosted();
203 $this->reason = $request->getText(
'wpReason' );
204 $this->moveTalk = $request->getBool(
'wpMovetalk', $def );
205 $this->fixRedirects = $request->getBool(
'wpFixRedirects', $def );
206 $this->leaveRedirect = $request->getBool(
'wpLeaveRedirect', $def );
208 $this->moveSubpages = $request->getBool(
'wpMovesubpages', $def );
209 $this->deleteAndMove = $request->getBool(
'wpDeleteAndMove' );
210 $this->moveOverShared = $request->getBool(
'wpMoveOverSharedFile' );
211 $this->watch = $request->getCheck(
'wpWatch' ) && $user->isRegistered();
213 if ( $request->getRawVal(
'action' ) ==
'submit' && $request->wasPosted()
214 && $user->matchEditToken( $request->getVal(
'wpEditToken' ) )
230 protected function showForm( $err, $isPermError =
false ) {
231 $this->
getSkin()->setRelevantTitle( $this->oldTitle );
234 $out->setPageTitle( $this->
msg(
'move-page', $this->oldTitle->getPrefixedText() ) );
235 $out->addModuleStyles( [
237 'mediawiki.interface.helpers.styles'
239 $out->addModules(
'mediawiki.misc-authed-ooui' );
242 $handlerSupportsRedirects = $this->contentHandlerFactory
243 ->getContentHandler( $this->oldTitle->getContentModel() )
244 ->supportsRedirects();
246 if ( $this->
getConfig()->
get( MainConfigNames::FixDoubleRedirects ) ) {
247 $out->addWikiMsg(
'movepagetext' );
249 $out->addWikiMsg( $handlerSupportsRedirects ?
250 'movepagetext-noredirectfixer' :
251 'movepagetext-noredirectsupport' );
254 if ( $this->oldTitle->getNamespace() ===
NS_USER && !$this->oldTitle->isSubpage() ) {
257 $out->msg(
'moveuserpage-warning' )->parse(),
258 'mw-moveuserpage-warning'
261 } elseif ( $this->oldTitle->getNamespace() ===
NS_CATEGORY ) {
264 $out->msg(
'movecategorypage-warning' )->parse(),
265 'mw-movecategorypage-warning'
270 $deleteAndMove =
false;
271 $moveOverShared =
false;
275 $newTitle = $this->newTitle;
278 # Show the current title as a default
279 # when the form is first opened.
280 $newTitle = $this->oldTitle;
281 } elseif ( !count( $err ) ) {
282 # If a title was supplied, probably from the move log revert
283 # link, check for validity. We can then show some diagnostic
284 # information and save a click.
285 $mp = $this->movePageFactory->newMovePage( $this->oldTitle, $newTitle );
286 $status = $mp->isValidMove();
287 $status->merge( $mp->probablyCanMove( $this->getAuthority() ) );
288 if ( $status->getErrors() ) {
289 $err = $status->getErrorsArray();
293 if ( count( $err ) == 1 && isset( $err[0][0] ) ) {
294 if ( $err[0][0] ==
'articleexists'
295 && $this->permManager->quickUserCan(
'delete', $user, $newTitle )
299 $out->msg(
'delete_and_move_text', $newTitle->
getPrefixedText() )->parse()
302 $deleteAndMove =
true;
304 } elseif ( $err[0][0] ==
'redirectexists' && (
306 $this->permManager->quickUserCan(
'delete-redirect', $user, $newTitle ) ||
307 $this->permManager->quickUserCan(
'delete', $user, $newTitle ) )
311 $out->msg(
'delete_redirect_and_move_text', $newTitle->
getPrefixedText() )->parse()
314 $deleteAndMove =
true;
316 } elseif ( $err[0][0] ==
'file-exists-sharedrepo'
317 && $this->permManager->userHasRight( $user,
'reupload-shared' )
321 $out->msg(
'move-over-sharedrepo', $newTitle->
getPrefixedText() )->parse()
324 $moveOverShared =
true;
330 $oldTitleSubpages = $this->oldTitle->hasSubpages();
331 $oldTitleTalkSubpages = $this->oldTitle->getTalkPage()->hasSubpages();
333 $canMoveSubpage = ( $oldTitleSubpages || $oldTitleTalkSubpages ) &&
334 !count( $this->permManager->getPermissionErrors(
340 # We also want to be able to move assoc. subpage talk-pages even if base page
341 # has no associated talk page, so || with $oldTitleTalkSubpages.
342 $considerTalk = !$this->oldTitle->isTalkPage() &&
344 || ( $oldTitleTalkSubpages && $canMoveSubpage ) );
346 $dbr = $this->loadBalancer->getConnectionRef( ILoadBalancer::DB_REPLICA );
347 if ( $this->
getConfig()->get( MainConfigNames::FixDoubleRedirects ) ) {
348 $hasRedirects = (bool)
$dbr->selectField(
'redirect',
'1',
350 'rd_namespace' => $this->oldTitle->getNamespace(),
351 'rd_title' => $this->oldTitle->getDBkey(),
354 $hasRedirects =
false;
357 if ( count( $err ) ) {
358 '@phan-var array[] $err';
359 if ( $isPermError ) {
360 $action_desc = $this->
msg(
'action-move' )->plain();
361 $errMsgHtml = $this->
msg(
'permissionserrorstext-withaction',
362 count( $err ), $action_desc )->parseAsBlock();
364 $errMsgHtml = $this->
msg(
'cannotmove', count( $err ) )->parseAsBlock();
367 if ( count( $err ) == 1 ) {
369 $errMsgName = array_shift( $errMsg );
371 if ( $errMsgName ==
'hookaborted' ) {
372 $errMsgHtml .=
"<p>{$errMsg[0]}</p>\n";
374 $errMsgHtml .= $this->
msg( $errMsgName, $errMsg )->parseAsBlock();
379 foreach ( $err as $errMsg ) {
380 if ( $errMsg[0] ==
'hookaborted' ) {
381 $errStr[] = $errMsg[1];
383 $errMsgName = array_shift( $errMsg );
384 $errStr[] = $this->
msg( $errMsgName, $errMsg )->parse();
388 $errMsgHtml .=
'<ul><li>' . implode(
"</li>\n<li>", $errStr ) .
"</li></ul>\n";
390 $out->addHTML( Html::errorBox( $errMsgHtml ) );
393 if ( $this->restrictionStore->isProtected( $this->oldTitle,
'move' ) ) {
394 # Is the title semi-protected?
395 if ( $this->restrictionStore->isSemiProtected( $this->oldTitle,
'move' ) ) {
396 $noticeMsg =
'semiprotectedpagemovewarning';
398 # Then it must be protected based on static groups (regular)
399 $noticeMsg =
'protectedpagemovewarning';
401 LogEventsList::showLogExtract(
406 [
'lim' => 1,
'msgKey' => $noticeMsg ]
413 $immovableNamespaces = [];
414 foreach ( array_keys( $this->
getLanguage()->getNamespaces() ) as $nsId ) {
415 if ( !$this->nsInfo->isMovable( $nsId ) ) {
416 $immovableNamespaces[] = $nsId;
423 $fields[] =
new OOUI\FieldLayout(
424 new MediaWiki\Widget\ComplexTitleInputWidget( [
425 'id' =>
'wpNewTitle',
427 'id' =>
'wpNewTitleNs',
428 'name' =>
'wpNewTitleNs',
430 'exclude' => $immovableNamespaces,
433 'id' =>
'wpNewTitleMain',
434 'name' =>
'wpNewTitleMain',
435 'value' => $newTitle->
getText(),
437 'suggestions' =>
false,
442 'label' => $this->msg(
'newtitle' )->text(),
450 $fields[] =
new OOUI\FieldLayout(
451 new OOUI\TextInputWidget( [
452 'name' =>
'wpReason',
454 'maxLength' => CommentStore::COMMENT_CHARACTER_LIMIT,
456 'value' => $this->reason,
459 'label' => $this->
msg(
'movereason' )->text(),
464 if ( $considerTalk ) {
465 $fields[] =
new OOUI\FieldLayout(
466 new OOUI\CheckboxInputWidget( [
467 'name' =>
'wpMovetalk',
468 'id' =>
'wpMovetalk',
470 'selected' => $this->moveTalk,
473 'label' => $this->
msg(
'movetalk' )->text(),
474 'help' =>
new OOUI\HtmlSnippet( $this->
msg(
'movepagetalktext' )->parseAsBlock() ),
475 'helpInline' =>
true,
477 'id' =>
'wpMovetalk-field',
482 if ( $this->permManager->userHasRight( $user,
'suppressredirect' ) ) {
483 if ( $handlerSupportsRedirects ) {
484 $isChecked = $this->leaveRedirect;
490 $fields[] =
new OOUI\FieldLayout(
491 new OOUI\CheckboxInputWidget( [
492 'name' =>
'wpLeaveRedirect',
493 'id' =>
'wpLeaveRedirect',
495 'selected' => $isChecked,
496 'disabled' => $isDisabled,
499 'label' => $this->
msg(
'move-leave-redirect' )->text(),
505 if ( $hasRedirects ) {
506 $fields[] =
new OOUI\FieldLayout(
507 new OOUI\CheckboxInputWidget( [
508 'name' =>
'wpFixRedirects',
509 'id' =>
'wpFixRedirects',
511 'selected' => $this->fixRedirects,
514 'label' => $this->
msg(
'fix-double-redirects' )->text(),
520 if ( $canMoveSubpage ) {
521 $maximumMovedPages = $this->
getConfig()->get( MainConfigNames::MaximumMovedPages );
522 $fields[] =
new OOUI\FieldLayout(
523 new OOUI\CheckboxInputWidget( [
524 'name' =>
'wpMovesubpages',
525 'id' =>
'wpMovesubpages',
527 'selected' => $this->moveSubpages,
530 'label' =>
new OOUI\HtmlSnippet(
532 ( $this->oldTitle->hasSubpages()
534 :
'move-talk-subpages' )
535 )->numParams( $maximumMovedPages )->params( $maximumMovedPages )->parse()
542 # Don't allow watching if user is not logged in
543 if ( $user->isRegistered() ) {
544 $watchChecked = ( $this->watch || $this->userOptionsLookup->getBoolOption( $user,
'watchmoves' )
545 || $this->watchlistManager->isWatched( $user, $this->oldTitle ) );
546 $fields[] =
new OOUI\FieldLayout(
547 new OOUI\CheckboxInputWidget( [
549 'id' =>
'watch', # ew
551 'selected' => $watchChecked,
554 'label' => $this->
msg(
'move-watch' )->text(),
561 if ( $moveOverShared ) {
562 $hiddenFields .= Html::hidden(
'wpMoveOverSharedFile',
'1' );
565 if ( $deleteAndMove ) {
566 $fields[] =
new OOUI\FieldLayout(
567 new OOUI\CheckboxInputWidget( [
568 'name' =>
'wpDeleteAndMove',
569 'id' =>
'wpDeleteAndMove',
573 'label' => $this->
msg(
'delete_and_move_confirm' )->text(),
579 $fields[] =
new OOUI\FieldLayout(
580 new OOUI\ButtonInputWidget( [
582 'value' => $this->
msg(
'movepagebtn' )->text(),
583 'label' => $this->
msg(
'movepagebtn' )->text(),
584 'flags' => [
'primary',
'progressive' ],
592 $fieldset =
new OOUI\FieldsetLayout( [
593 'label' => $this->
msg(
'move-page-legend' )->text(),
594 'id' =>
'mw-movepage-table',
598 $form =
new OOUI\FormLayout( [
600 'action' => $this->
getPageTitle()->getLocalURL(
'action=submit' ),
603 $form->appendContent(
605 new OOUI\HtmlSnippet(
607 Html::hidden(
'wpOldTitle', $this->oldTitle->getPrefixedText() ) .
608 Html::hidden(
'wpEditToken', $user->getEditToken() )
613 new OOUI\PanelLayout( [
614 'classes' => [
'movepage-wrapper' ],
622 $this->showLogFragment( $this->oldTitle );
623 $this->showSubpages( $this->oldTitle );
626 private function doSubmit() {
629 if ( $user->pingLimiter(
'move' ) ) {
633 $ot = $this->oldTitle;
634 $nt = $this->newTitle;
636 # don't allow moving to pages with # in
637 if ( !$nt || $nt->hasFragment() ) {
638 $this->
showForm( [ [
'badtitletext' ] ] );
643 # Show a warning if the target file exists on a shared repo
644 if ( $nt->getNamespace() ===
NS_FILE
645 && !( $this->moveOverShared && $this->permManager->userHasRight( $user,
'reupload-shared' ) )
646 && !$this->repoGroup->getLocalRepo()->findFile( $nt )
647 && $this->repoGroup->findFile( $nt )
649 $this->
showForm( [ [
'file-exists-sharedrepo' ] ] );
654 # Delete to make way if requested
655 if ( $this->deleteAndMove ) {
656 $redir2 = $nt->isSingleRevRedirect();
658 $permErrors = $this->permManager->getPermissionErrors(
659 $redir2 ?
'delete-redirect' :
'delete',
662 if ( count( $permErrors ) ) {
664 if ( count( $this->permManager->getPermissionErrors(
'delete', $user, $nt ) ) ) {
667 $this->
showForm( $permErrors,
true );
677 $this->
showForm( $permErrors,
true );
682 $page = $this->wikiPageFactory->newFromTitle( $nt );
685 if ( $page->isBatchedDelete( 5 ) ) {
686 $this->
showForm( [ [
'movepage-delete-first' ] ] );
691 $reason = $this->
msg(
'delete_and_move_reason', $ot )->inContentLanguage()->text();
694 if ( $nt->getNamespace() ===
NS_FILE ) {
695 $file = $this->repoGroup->getLocalRepo()->newFile( $nt );
696 $file->load( File::READ_LATEST );
697 if (
$file->exists() ) {
698 $file->deleteFile( $reason, $user,
false );
703 $deletionLog = $redir2 ?
'delete_redir2' :
'delete';
704 $deleteStatus = $page->doDeleteArticleReal(
705 $reason, $user,
false,
null, $error,
706 null, [], $deletionLog
708 if ( !$deleteStatus->isGood() ) {
709 $this->
showForm( $deleteStatus->getErrorsArray() );
715 $handler = $this->contentHandlerFactory->getContentHandler( $ot->getContentModel() );
717 if ( !$handler->supportsRedirects() ) {
718 $createRedirect =
false;
719 } elseif ( $this->permManager->userHasRight( $user,
'suppressredirect' ) ) {
720 $createRedirect = $this->leaveRedirect;
722 $createRedirect =
true;
725 # Do the actual move.
726 $mp = $this->movePageFactory->newMovePage( $ot, $nt );
728 # check whether the requested actions are permitted / possible
729 $userPermitted = $mp->authorizeMove( $this->
getAuthority(), $this->reason )->isOK();
730 if ( $ot->isTalkPage() || $nt->isTalkPage() ) {
731 $this->moveTalk =
false;
733 if ( $this->moveSubpages ) {
734 $this->moveSubpages = $this->permManager->userCan(
'move-subpages', $user, $ot );
737 $status = $mp->moveIfAllowed( $this->
getAuthority(), $this->reason, $createRedirect );
738 if ( !$status->isOK() ) {
739 $this->
showForm( $status->getErrorsArray(), !$userPermitted );
743 if ( $this->
getConfig()->
get( MainConfigNames::FixDoubleRedirects ) &&
744 $this->fixRedirects ) {
749 $out->setPageTitle( $this->
msg(
'pagemovedsub' ) );
752 $oldLink = $linkRenderer->makeLink(
755 [
'id' =>
'movepage-oldlink' ],
756 [
'redirect' =>
'no' ]
758 $newLink = $linkRenderer->makeKnownLink(
761 [
'id' =>
'movepage-newlink' ]
763 $oldText = $ot->getPrefixedText();
764 $newText = $nt->getPrefixedText();
766 if ( $status->getValue()[
'redirectRevision'] !==
null ) {
767 $msgName =
'movepage-moved-redirect';
769 $msgName =
'movepage-moved-noredirect';
772 $out->addHTML( $this->
msg(
'movepage-moved' )->rawParams( $oldLink,
773 $newLink )->params( $oldText, $newText )->parseAsBlock() );
774 $out->addWikiMsg( $msgName );
776 $this->
getHookRunner()->onSpecialMovepageAfterMove( $this, $ot, $nt );
793 $dbr = $this->loadBalancer->getConnectionRef( ILoadBalancer::DB_REPLICA );
794 if ( $this->moveSubpages && (
795 $this->nsInfo->hasSubpages( $nt->getNamespace() ) || (
797 && $this->nsInfo->hasSubpages( $nt->getTalkPage()->getNamespace() )
801 'page_title' .
$dbr->buildLike( $ot->getDBkey() .
'/',
$dbr->anyString() )
802 .
' OR page_title = ' .
$dbr->addQuotes( $ot->getDBkey() )
804 $conds[
'page_namespace'] = [];
805 if ( $this->nsInfo->hasSubpages( $nt->getNamespace() ) ) {
806 $conds[
'page_namespace'][] = $ot->getNamespace();
808 if ( $this->moveTalk &&
809 $this->nsInfo->hasSubpages( $nt->getTalkPage()->getNamespace() )
811 $conds[
'page_namespace'][] = $ot->getTalkPage()->getNamespace();
813 } elseif ( $this->moveTalk ) {
815 'page_namespace' => $ot->getTalkPage()->getNamespace(),
816 'page_title' => $ot->getDBkey()
824 if ( $conds !==
null ) {
826 $dbr->select(
'page',
827 [
'page_id',
'page_namespace',
'page_title' ],
836 foreach ( $extraPages as $oldSubpage ) {
837 if ( $ot->equals( $oldSubpage ) || $nt->equals( $oldSubpage ) ) {
838 # Already did this one.
842 $newPageName = preg_replace(
843 '#^' . preg_quote( $ot->getDBkey(),
'#' ) .
'#',
845 $oldSubpage->getDBkey()
848 if ( $oldSubpage->isSubpage() && ( $ot->isTalkPage() xor $nt->isTalkPage() ) ) {
850 $newNs = $nt->getNamespace();
851 } elseif ( $oldSubpage->isTalkPage() ) {
852 $newNs = $nt->getTalkPage()->getNamespace();
854 $newNs = $nt->getSubjectPage()->getNamespace();
857 # T16385: we need makeTitleSafe because the new page names may
858 # be longer than 255 characters.
860 if ( !$newSubpage ) {
861 $oldLink = $linkRenderer->makeKnownLink( $oldSubpage );
862 $extraOutput[] = $this->
msg(
'movepage-page-unmoved' )->rawParams( $oldLink )
863 ->params( Title::makeName( $newNs, $newPageName ) )->escaped();
867 $mp = $this->movePageFactory->newMovePage( $oldSubpage, $newSubpage );
868 # This was copy-pasted from Renameuser, bleh.
869 if ( $newSubpage->exists() && !$mp->isValidMove()->isOK() ) {
870 $link = $linkRenderer->makeKnownLink( $newSubpage );
871 $extraOutput[] = $this->
msg(
'movepage-page-exists' )->rawParams( $link )->escaped();
873 $status = $mp->moveIfAllowed( $this->
getAuthority(), $this->reason, $createRedirect );
875 if ( $status->isOK() ) {
876 if ( $this->fixRedirects ) {
879 $oldLink = $linkRenderer->makeLink(
883 [
'redirect' =>
'no' ]
886 $newLink = $linkRenderer->makeKnownLink( $newSubpage );
887 $extraOutput[] = $this->
msg(
'movepage-page-moved' )
888 ->rawParams( $oldLink, $newLink )->escaped();
892 $this->
getConfig()->get( MainConfigNames::MaximumMovedPages );
893 if ( $count >= $maximumMovedPages ) {
894 $extraOutput[] = $this->
msg(
'movepage-max-pages' )
895 ->numParams( $maximumMovedPages )->escaped();
899 $oldLink = $linkRenderer->makeKnownLink( $oldSubpage );
900 $newLink = $linkRenderer->makeLink( $newSubpage );
901 $extraOutput[] = $this->
msg(
'movepage-page-unmoved' )
902 ->rawParams( $oldLink, $newLink )->escaped();
907 if ( $extraOutput !== [] ) {
908 $out->addHTML(
"<ul>\n<li>" . implode(
"</li>\n<li>", $extraOutput ) .
"</li>\n</ul>" );
911 # Deal with watches (we don't watch subpages)
912 $this->watchlistManager->setWatch( $this->watch, $this->
getAuthority(), $ot );
913 $this->watchlistManager->setWatch( $this->watch, $this->
getAuthority(), $nt );
916 private function showLogFragment(
$title ) {
917 $moveLogPage =
new LogPage(
'move' );
919 $out->addHTML( Xml::element(
'h2',
null, $moveLogPage->getName()->text() ) );
929 private function showSubpages(
$title ) {
930 $maximumMovedPages = $this->
getConfig()->get( MainConfigNames::MaximumMovedPages );
931 $nsHasSubpages = $this->nsInfo->hasSubpages(
$title->getNamespace() );
932 $subpages =
$title->getSubpages( $maximumMovedPages + 1 );
933 $count = $subpages instanceof
TitleArray ? $subpages->count() : 0;
935 $titleIsTalk =
$title->isTalkPage();
936 $subpagesTalk =
$title->getTalkPage()->getSubpages( $maximumMovedPages + 1 );
937 $countTalk = $subpagesTalk instanceof
TitleArray ? $subpagesTalk->count() : 0;
938 $totalCount = $count + $countTalk;
940 if ( !$nsHasSubpages && $countTalk == 0 ) {
946 [
'movesubpage', ( $titleIsTalk ? $count : $totalCount ) ]
949 if ( $nsHasSubpages ) {
950 $this->showSubpagesList(
951 $subpages, $count,
'movesubpagetext',
'movesubpagetext-truncated',
true
955 if ( !$titleIsTalk && $countTalk > 0 ) {
956 $this->showSubpagesList(
957 $subpagesTalk, $countTalk,
'movesubpagetalktext',
'movesubpagetalktext-truncated'
962 private function showSubpagesList( $subpages, $pagecount, $msg, $truncatedMsg, $noSubpageMsg =
false ) {
966 if ( $pagecount == 0 && $noSubpageMsg ) {
967 $out->addWikiMsg(
'movenosubpage' );
971 $maximumMovedPages = $this->
getConfig()->get( MainConfigNames::MaximumMovedPages );
973 if ( $pagecount > $maximumMovedPages ) {
974 $subpages = $this->truncateSubpagesList( $subpages );
975 $out->addWikiMsg( $truncatedMsg, $this->
getLanguage()->formatNum( $maximumMovedPages ) );
977 $out->addWikiMsg( $msg, $this->
getLanguage()->formatNum( $pagecount ) );
979 $out->addHTML(
"<ul>\n" );
981 $linkBatch = $this->linkBatchFactory->newLinkBatch( $subpages );
982 $linkBatch->setCaller( __METHOD__ );
983 $linkBatch->execute();
986 foreach ( $subpages as $subpage ) {
987 $link = $linkRenderer->makeLink( $subpage );
988 $out->addHTML(
"<li>$link</li>\n" );
990 $out->addHTML(
"</ul>\n" );
993 private function truncateSubpagesList( iterable $subpages ): array {
995 foreach ( $subpages as $subpage ) {
996 $returnArray[] = $subpage;
997 if ( count( $returnArray ) >= $this->
getConfig()->
get( MainConfigNames::MaximumMovedPages ) ) {
1001 return $returnArray;
1013 return $this->prefixSearchString( $search, $limit, $offset, $this->searchEngineFactory );