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