FU r102073:
[lhc/web/wiklou.git] / includes / specials / SpecialMovepage.php
1 <?php
2 /**
3 * Implements Special:Movepage
4 *
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.
9 *
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.
14 *
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
19 *
20 * @file
21 * @ingroup SpecialPage
22 */
23
24 /**
25 * A special page that allows users to change page titles
26 *
27 * @ingroup SpecialPage
28 */
29 class MovePageForm extends UnlistedSpecialPage {
30
31 /**
32 * @var Title
33 */
34 var $oldTitle, $newTitle; # Objects
35 var $reason; # Text input
36 var $moveTalk, $deleteAndMove, $moveSubpages, $fixRedirects, $leaveRedirect, $moveOverShared; # Checks
37
38 private $watch = false;
39
40 public function __construct() {
41 parent::__construct( 'Movepage' );
42 }
43
44 public function execute( $par ) {
45 # Check for database lock
46 if ( wfReadOnly() ) {
47 throw new ReadOnlyError;
48 }
49
50 $this->setHeaders();
51 $this->outputHeader();
52
53 $request = $this->getRequest();
54 $target = !is_null( $par ) ? $par : $request->getVal( 'target' );
55
56 // Yes, the use of getVal() and getText() is wanted, see bug 20365
57 $oldTitleText = $request->getVal( 'wpOldTitle', $target );
58 $newTitleText = $request->getText( 'wpNewTitle' );
59
60 $this->oldTitle = Title::newFromText( $oldTitleText );
61 $this->newTitle = Title::newFromText( $newTitleText );
62
63 if( is_null( $this->oldTitle ) ) {
64 throw new ErrorPageError( 'notargettitle', 'notargettext' );
65 }
66 if( !$this->oldTitle->exists() ) {
67 throw new ErrorPageError( 'nopagetitle', 'nopagetext' );
68 }
69
70 $user = $this->getUser();
71
72 # Check rights
73 $permErrors = $this->oldTitle->getUserPermissionsErrors( 'move', $user );
74 if( !empty( $permErrors ) ) {
75 // Auto-block user's IP if the account was "hard" blocked
76 $user->spreadAnyEditBlock();
77 throw new PermissionsError( 'move', $permErrors );
78 }
79
80 $def = !$request->wasPosted();
81
82 $this->reason = $request->getText( 'wpReason' );
83 $this->moveTalk = $request->getBool( 'wpMovetalk', $def );
84 $this->fixRedirects = $request->getBool( 'wpFixRedirects', $def );
85 $this->leaveRedirect = $request->getBool( 'wpLeaveRedirect', $def );
86 $this->moveSubpages = $request->getBool( 'wpMovesubpages', false );
87 $this->deleteAndMove = $request->getBool( 'wpDeleteAndMove' ) && $request->getBool( 'wpConfirm' );
88 $this->moveOverShared = $request->getBool( 'wpMoveOverSharedFile', false );
89 $this->watch = $request->getCheck( 'wpWatch' ) && $user->isLoggedIn();
90
91 if ( 'submit' == $request->getVal( 'action' ) && $request->wasPosted()
92 && $user->matchEditToken( $request->getVal( 'wpEditToken' ) ) ) {
93 $this->doSubmit();
94 } else {
95 $this->showForm( '' );
96 }
97 }
98
99 /**
100 * Show the form
101 *
102 * @param $err Mixed: error message. May either be a string message name or
103 * array message name and parameters, like the second argument to
104 * OutputPage::wrapWikiMsg().
105 */
106 function showForm( $err ) {
107 global $wgContLang, $wgFixDoubleRedirects, $wgMaximumMovedPages;
108
109 $this->getSkin()->setRelevantTitle( $this->oldTitle );
110
111 $oldTitleLink = Linker::link( $this->oldTitle );
112
113 $out = $this->getOutput();
114 $out->setPageTitle( $this->msg( 'move-page', $this->oldTitle->getPrefixedText() ) );
115 $out->addModules( 'mediawiki.special.movePage' );
116
117 $newTitle = $this->newTitle;
118
119 if( !$newTitle ) {
120 # Show the current title as a default
121 # when the form is first opened.
122 $newTitle = $this->oldTitle;
123 }
124 else {
125 if( empty($err) ) {
126 # If a title was supplied, probably from the move log revert
127 # link, check for validity. We can then show some diagnostic
128 # information and save a click.
129 $newerr = $this->oldTitle->isValidMoveOperation( $newTitle );
130 if( $newerr ) {
131 $err = $newerr[0];
132 }
133 }
134 }
135
136 $user = $this->getUser();
137
138 if ( !empty($err) && $err[0] == 'articleexists' && $user->isAllowed( 'delete' ) ) {
139 $out->addWikiMsg( 'delete_and_move_text', $newTitle->getPrefixedText() );
140 $movepagebtn = wfMsg( 'delete_and_move' );
141 $submitVar = 'wpDeleteAndMove';
142 $confirm = "
143 <tr>
144 <td></td>
145 <td class='mw-input'>" .
146 Xml::checkLabel( wfMsg( 'delete_and_move_confirm' ), 'wpConfirm', 'wpConfirm' ) .
147 "</td>
148 </tr>";
149 $err = '';
150 } else {
151 if ($this->oldTitle->getNamespace() == NS_USER && !$this->oldTitle->isSubpage() ) {
152 $out->wrapWikiMsg( "<div class=\"error mw-moveuserpage-warning\">\n$1\n</div>", 'moveuserpage-warning' );
153 }
154 $out->addWikiMsg( $wgFixDoubleRedirects ? 'movepagetext' :
155 'movepagetext-noredirectfixer' );
156 $movepagebtn = wfMsg( 'movepagebtn' );
157 $submitVar = 'wpMove';
158 $confirm = false;
159 }
160
161 if ( !empty($err) && $err[0] == 'file-exists-sharedrepo' && $user->isAllowed( 'reupload-shared' ) ) {
162 $out->addWikiMsg( 'move-over-sharedrepo', $newTitle->getPrefixedText() );
163 $submitVar = 'wpMoveOverSharedFile';
164 $err = '';
165 }
166
167 $oldTalk = $this->oldTitle->getTalkPage();
168 $oldTitleSubpages = $this->oldTitle->hasSubpages();
169 $oldTitleTalkSubpages = $this->oldTitle->getTalkPage()->hasSubpages();
170
171 $canMoveSubpage = ( $oldTitleSubpages || $oldTitleTalkSubpages ) &&
172 !count( $this->oldTitle->getUserPermissionsErrors( 'move-subpages', $user ) );
173
174 # We also want to be able to move assoc. subpage talk-pages even if base page
175 # has no associated talk page, so || with $oldTitleTalkSubpages.
176 $considerTalk = !$this->oldTitle->isTalkPage() &&
177 ( $oldTalk->exists()
178 || ( $oldTitleTalkSubpages && $canMoveSubpage ) );
179
180 $dbr = wfGetDB( DB_SLAVE );
181 if ( $wgFixDoubleRedirects ) {
182 $hasRedirects = $dbr->selectField( 'redirect', '1',
183 array(
184 'rd_namespace' => $this->oldTitle->getNamespace(),
185 'rd_title' => $this->oldTitle->getDBkey(),
186 ) , __METHOD__ );
187 } else {
188 $hasRedirects = false;
189 }
190
191 if ( $considerTalk ) {
192 $out->addWikiMsg( 'movepagetalktext' );
193 }
194
195 $token = htmlspecialchars( $user->editToken() );
196
197 if ( !empty($err) ) {
198 $out->addSubtitle( $this->msg( 'formerror' ) );
199 if( $err[0] == 'hookaborted' ) {
200 $hookErr = $err[1];
201 $errMsg = "<p><strong class=\"error\">$hookErr</strong></p>\n";
202 $out->addHTML( $errMsg );
203 } else {
204 $out->wrapWikiMsg( "<p><strong class=\"error\">\n$1\n</strong></p>", $err );
205 }
206 }
207
208 if ( $this->oldTitle->isProtected( 'move' ) ) {
209 # Is the title semi-protected?
210 if ( $this->oldTitle->isSemiProtected( 'move' ) ) {
211 $noticeMsg = 'semiprotectedpagemovewarning';
212 $classes[] = 'mw-textarea-sprotected';
213 } else {
214 # Then it must be protected based on static groups (regular)
215 $noticeMsg = 'protectedpagemovewarning';
216 $classes[] = 'mw-textarea-protected';
217 }
218 $out->addHTML( "<div class='mw-warning-with-logexcerpt'>\n" );
219 $out->addWikiMsg( $noticeMsg );
220 LogEventsList::showLogExtract( $out, 'protect', $this->oldTitle, '', array( 'lim' => 1 ) );
221 $out->addHTML( "</div>\n" );
222 }
223
224 $out->addHTML(
225 Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getTitle()->getLocalURL( 'action=submit' ), 'id' => 'movepage' ) ) .
226 Xml::openElement( 'fieldset' ) .
227 Xml::element( 'legend', null, wfMsg( 'move-page-legend' ) ) .
228 Xml::openElement( 'table', array( 'border' => '0', 'id' => 'mw-movepage-table' ) ) .
229 "<tr>
230 <td class='mw-label'>" .
231 wfMsgHtml( 'movearticle' ) .
232 "</td>
233 <td class='mw-input'>
234 <strong>{$oldTitleLink}</strong>
235 </td>
236 </tr>
237 <tr>
238 <td class='mw-label'>" .
239 Xml::label( wfMsg( 'newtitle' ), 'wpNewTitle' ) .
240 "</td>
241 <td class='mw-input'>" .
242 Xml::input( 'wpNewTitle', 60, $wgContLang->recodeForEdit( $newTitle->getPrefixedText() ), array( 'type' => 'text', 'id' => 'wpNewTitle' ) ) .
243 Html::hidden( 'wpOldTitle', $this->oldTitle->getPrefixedText() ) .
244 "</td>
245 </tr>
246 <tr>
247 <td class='mw-label'>" .
248 Xml::label( wfMsg( 'movereason' ), 'wpReason' ) .
249 "</td>
250 <td class='mw-input'>" .
251 Html::element( 'textarea', array( 'name' => 'wpReason', 'id' => 'wpReason', 'cols' => 60, 'rows' => 2,
252 'maxlength' => 200 ), $this->reason ) . // maxlength byte limit is enforce in mediawiki.special.movePage.js
253 "</td>
254 </tr>"
255 );
256
257 if( $considerTalk ) {
258 $out->addHTML( "
259 <tr>
260 <td></td>
261 <td class='mw-input'>" .
262 Xml::checkLabel( wfMsg( 'movetalk' ), 'wpMovetalk', 'wpMovetalk', $this->moveTalk ) .
263 "</td>
264 </tr>"
265 );
266 }
267
268 if ( $user->isAllowed( 'suppressredirect' ) ) {
269 $out->addHTML( "
270 <tr>
271 <td></td>
272 <td class='mw-input' >" .
273 Xml::checkLabel( wfMsg( 'move-leave-redirect' ), 'wpLeaveRedirect',
274 'wpLeaveRedirect', $this->leaveRedirect ) .
275 "</td>
276 </tr>"
277 );
278 }
279
280 if ( $hasRedirects ) {
281 $out->addHTML( "
282 <tr>
283 <td></td>
284 <td class='mw-input' >" .
285 Xml::checkLabel( wfMsg( 'fix-double-redirects' ), 'wpFixRedirects',
286 'wpFixRedirects', $this->fixRedirects ) .
287 "</td>
288 </tr>"
289 );
290 }
291
292 if( $canMoveSubpage ) {
293 $out->addHTML( "
294 <tr>
295 <td></td>
296 <td class=\"mw-input\">" .
297 Xml::check(
298 'wpMovesubpages',
299 # Don't check the box if we only have talk subpages to
300 # move and we aren't moving the talk page.
301 $this->moveSubpages && ($this->oldTitle->hasSubpages() || $this->moveTalk),
302 array( 'id' => 'wpMovesubpages' )
303 ) . '&#160;' .
304 Xml::tags( 'label', array( 'for' => 'wpMovesubpages' ),
305 wfMsgExt(
306 ( $this->oldTitle->hasSubpages()
307 ? 'move-subpages'
308 : 'move-talk-subpages' ),
309 array( 'parseinline' ),
310 $this->getLang()->formatNum( $wgMaximumMovedPages ),
311 # $2 to allow use of PLURAL in message.
312 $wgMaximumMovedPages
313 )
314 ) .
315 "</td>
316 </tr>"
317 );
318 }
319
320 $watchChecked = $user->isLoggedIn() && ($this->watch || $user->getBoolOption( 'watchmoves' )
321 || $this->oldTitle->userIsWatching());
322 # Don't allow watching if user is not logged in
323 if( $user->isLoggedIn() ) {
324 $out->addHTML( "
325 <tr>
326 <td></td>
327 <td class='mw-input'>" .
328 Xml::checkLabel( wfMsg( 'move-watch' ), 'wpWatch', 'watch', $watchChecked ) .
329 "</td>
330 </tr>");
331 }
332
333 $out->addHTML( "
334 {$confirm}
335 <tr>
336 <td>&#160;</td>
337 <td class='mw-submit'>" .
338 Xml::submitButton( $movepagebtn, array( 'name' => $submitVar ) ) .
339 "</td>
340 </tr>" .
341 Xml::closeElement( 'table' ) .
342 Html::hidden( 'wpEditToken', $token ) .
343 Xml::closeElement( 'fieldset' ) .
344 Xml::closeElement( 'form' ) .
345 "\n"
346 );
347
348 $this->showLogFragment( $this->oldTitle );
349 $this->showSubpages( $this->oldTitle );
350
351 }
352
353 function doSubmit() {
354 global $wgMaximumMovedPages, $wgFixDoubleRedirects, $wgDeleteRevisionsLimit;
355
356 $user = $this->getUser();
357
358 if ( $user->pingLimiter( 'move' ) ) {
359 throw new ThrottledError;
360 }
361
362 $ot = $this->oldTitle;
363 $nt = $this->newTitle;
364
365 # Delete to make way if requested
366 if ( !count( $nt->getUserPermissionsErrors( 'delete', $user ) ) && $this->deleteAndMove ) {
367 $page = WikiPage::factory( $nt );
368
369 # Disallow deletions of big articles
370 $bigHistory = $page->isBigDeletion();
371 if( $bigHistory && count( $nt->getUserPermissionsErrors( 'bigdelete', $user ) ) ) {
372 $this->showForm( array( 'delete-toobig', $this->getLang()->formatNum( $wgDeleteRevisionsLimit ) ) );
373 return;
374 }
375
376 $reason = wfMessage( 'delete_and_move_reason', $ot )->inContentLanguage()->text();
377
378 // Delete an associated image if there is
379 if ( $nt->getNamespace() == NS_FILE ) {
380 $file = wfLocalFile( $nt );
381 if ( $file->exists() ) {
382 $file->delete( $reason, false );
383 }
384 }
385
386 $error = ''; // passed by ref
387 if ( !$page->doDeleteArticle( $reason, false, 0, true, $error, $user ) ) {
388 $this->showForm( array( 'cannotdelete', wfEscapeWikiText( $nt->getPrefixedText() ) ) );
389 return;
390 }
391
392 }
393
394 # don't allow moving to pages with # in
395 if ( !$nt || $nt->getFragment() != '' ) {
396 $this->showForm( 'badtitletext' );
397 return;
398 }
399
400 # Show a warning if the target file exists on a shared repo
401 if ( $nt->getNamespace() == NS_FILE
402 && !( $this->moveOverShared && $user->isAllowed( 'reupload-shared' ) )
403 && !RepoGroup::singleton()->getLocalRepo()->findFile( $nt )
404 && wfFindFile( $nt ) )
405 {
406 $this->showForm( array('file-exists-sharedrepo') );
407 return;
408
409 }
410
411 if ( $user->isAllowed( 'suppressredirect' ) ) {
412 $createRedirect = $this->leaveRedirect;
413 } else {
414 $createRedirect = true;
415 }
416
417 # Do the actual move.
418 $error = $ot->moveTo( $nt, true, $this->reason, $createRedirect );
419 if ( $error !== true ) {
420 # @todo FIXME: Show all the errors in a list, not just the first one
421 $this->showForm( reset( $error ) );
422 return;
423 }
424
425 if ( $wgFixDoubleRedirects && $this->fixRedirects ) {
426 DoubleRedirectJob::fixRedirects( 'move', $ot, $nt );
427 }
428
429 wfRunHooks( 'SpecialMovepageAfterMove', array( &$this, &$ot, &$nt ) );
430
431 $out = $this->getOutput();
432 $out->setPagetitle( wfMsg( 'pagemovedsub' ) );
433
434 $oldLink = Linker::link(
435 $ot,
436 null,
437 array(),
438 array( 'redirect' => 'no' )
439 );
440 $newLink = Linker::linkKnown( $nt );
441 $oldText = $ot->getPrefixedText();
442 $newText = $nt->getPrefixedText();
443
444 $msgName = $createRedirect ? 'movepage-moved-redirect' : 'movepage-moved-noredirect';
445 $out->addHTML( wfMessage( 'movepage-moved' )->rawParams( $oldLink, $newLink, $oldText, $newText )->parseAsBlock() );
446 $out->addWikiMsg( $msgName );
447
448 # Now we move extra pages we've been asked to move: subpages and talk
449 # pages. First, if the old page or the new page is a talk page, we
450 # can't move any talk pages: cancel that.
451 if( $ot->isTalkPage() || $nt->isTalkPage() ) {
452 $this->moveTalk = false;
453 }
454
455 if ( count( $ot->getUserPermissionsErrors( 'move-subpages', $user ) ) ) {
456 $this->moveSubpages = false;
457 }
458
459 # Next make a list of id's. This might be marginally less efficient
460 # than a more direct method, but this is not a highly performance-cri-
461 # tical code path and readable code is more important here.
462 #
463 # Note: this query works nicely on MySQL 5, but the optimizer in MySQL
464 # 4 might get confused. If so, consider rewriting as a UNION.
465 #
466 # If the target namespace doesn't allow subpages, moving with subpages
467 # would mean that you couldn't move them back in one operation, which
468 # is bad.
469 # @todo FIXME: A specific error message should be given in this case.
470
471 // @todo FIXME: Use Title::moveSubpages() here
472 $dbr = wfGetDB( DB_MASTER );
473 if( $this->moveSubpages && (
474 MWNamespace::hasSubpages( $nt->getNamespace() ) || (
475 $this->moveTalk &&
476 MWNamespace::hasSubpages( $nt->getTalkPage()->getNamespace() )
477 )
478 ) ) {
479 $conds = array(
480 'page_title' . $dbr->buildLike( $ot->getDBkey() . '/', $dbr->anyString() )
481 .' OR page_title = ' . $dbr->addQuotes( $ot->getDBkey() )
482 );
483 $conds['page_namespace'] = array();
484 if( MWNamespace::hasSubpages( $nt->getNamespace() ) ) {
485 $conds['page_namespace'] []= $ot->getNamespace();
486 }
487 if( $this->moveTalk && MWNamespace::hasSubpages( $nt->getTalkPage()->getNamespace() ) ) {
488 $conds['page_namespace'] []= $ot->getTalkPage()->getNamespace();
489 }
490 } elseif( $this->moveTalk ) {
491 $conds = array(
492 'page_namespace' => $ot->getTalkPage()->getNamespace(),
493 'page_title' => $ot->getDBkey()
494 );
495 } else {
496 # Skip the query
497 $conds = null;
498 }
499
500 $extraPages = array();
501 if( !is_null( $conds ) ) {
502 $extraPages = TitleArray::newFromResult(
503 $dbr->select( 'page',
504 array( 'page_id', 'page_namespace', 'page_title' ),
505 $conds,
506 __METHOD__
507 )
508 );
509 }
510
511 $extraOutput = array();
512 $count = 1;
513 foreach( $extraPages as $oldSubpage ) {
514 if( $ot->equals( $oldSubpage ) ) {
515 # Already did this one.
516 continue;
517 }
518
519 $newPageName = preg_replace(
520 '#^'.preg_quote( $ot->getDBkey(), '#' ).'#',
521 StringUtils::escapeRegexReplacement( $nt->getDBkey() ), # bug 21234
522 $oldSubpage->getDBkey()
523 );
524 if( $oldSubpage->isTalkPage() ) {
525 $newNs = $nt->getTalkPage()->getNamespace();
526 } else {
527 $newNs = $nt->getSubjectPage()->getNamespace();
528 }
529 # Bug 14385: we need makeTitleSafe because the new page names may
530 # be longer than 255 characters.
531 $newSubpage = Title::makeTitleSafe( $newNs, $newPageName );
532 if( !$newSubpage ) {
533 $oldLink = Linker::linkKnown( $oldSubpage );
534 $extraOutput []= wfMsgHtml( 'movepage-page-unmoved', $oldLink,
535 htmlspecialchars(Title::makeName( $newNs, $newPageName )));
536 continue;
537 }
538
539 # This was copy-pasted from Renameuser, bleh.
540 if ( $newSubpage->exists() && !$oldSubpage->isValidMoveTarget( $newSubpage ) ) {
541 $link = Linker::linkKnown( $newSubpage );
542 $extraOutput []= wfMsgHtml( 'movepage-page-exists', $link );
543 } else {
544 $success = $oldSubpage->moveTo( $newSubpage, true, $this->reason, $createRedirect );
545 if( $success === true ) {
546 if ( $this->fixRedirects ) {
547 DoubleRedirectJob::fixRedirects( 'move', $oldSubpage, $newSubpage );
548 }
549 $oldLink = Linker::link(
550 $oldSubpage,
551 null,
552 array(),
553 array( 'redirect' => 'no' )
554 );
555 $newLink = Linker::linkKnown( $newSubpage );
556 $extraOutput []= wfMsgHtml( 'movepage-page-moved', $oldLink, $newLink );
557 ++$count;
558 if( $count >= $wgMaximumMovedPages ) {
559 $extraOutput []= wfMsgExt( 'movepage-max-pages', array( 'parsemag', 'escape' ), $this->getLang()->formatNum( $wgMaximumMovedPages ) );
560 break;
561 }
562 } else {
563 $oldLink = Linker::linkKnown( $oldSubpage );
564 $newLink = Linker::link( $newSubpage );
565 $extraOutput []= wfMsgHtml( 'movepage-page-unmoved', $oldLink, $newLink );
566 }
567 }
568
569 }
570
571 if( $extraOutput !== array() ) {
572 $out->addHTML( "<ul>\n<li>" . implode( "</li>\n<li>", $extraOutput ) . "</li>\n</ul>" );
573 }
574
575 # Deal with watches (we don't watch subpages)
576 if( $this->watch && $user->isLoggedIn() ) {
577 $user->addWatch( $ot );
578 $user->addWatch( $nt );
579 } else {
580 $user->removeWatch( $ot );
581 $user->removeWatch( $nt );
582 }
583
584 # Re-clear the file redirect cache, which may have been polluted by
585 # parsing in messages above. See CR r56745.
586 # @todo FIXME: Needs a more robust solution inside FileRepo.
587 if( $ot->getNamespace() == NS_FILE ) {
588 RepoGroup::singleton()->getLocalRepo()->invalidateImageRedirect( $ot );
589 }
590 }
591
592 function showLogFragment( $title ) {
593 $out = $this->getOutput();
594 $out->addHTML( Xml::element( 'h2', null, LogPage::logName( 'move' ) ) );
595 LogEventsList::showLogExtract( $out, 'move', $title );
596 }
597
598 function showSubpages( $title ) {
599 if( !MWNamespace::hasSubpages( $title->getNamespace() ) )
600 return;
601
602 $subpages = $title->getSubpages();
603 $count = $subpages instanceof TitleArray ? $subpages->count() : 0;
604
605 $out = $this->getOutput();
606 $out->wrapWikiMsg( '== $1 ==', array( 'movesubpage', $count ) );
607
608 # No subpages.
609 if ( $count == 0 ) {
610 $out->addWikiMsg( 'movenosubpage' );
611 return;
612 }
613
614 $out->addWikiMsg( 'movesubpagetext', $this->getLang()->formatNum( $count ) );
615 $out->addHTML( "<ul>\n" );
616
617 foreach( $subpages as $subpage ) {
618 $link = Linker::link( $subpage );
619 $out->addHTML( "<li>$link</li>\n" );
620 }
621 $out->addHTML( "</ul>\n" );
622 }
623 }
624