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