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