Show redirect fragments on Special:BrokenRedirects
[lhc/web/wiklou.git] / includes / specials / SpecialImport.php
1 <?php
2 /**
3 * Implements Special:Import
4 *
5 * Copyright © 2003,2005 Brion Vibber <brion@pobox.com>
6 * https://www.mediawiki.org/
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 * http://www.gnu.org/copyleft/gpl.html
22 *
23 * @file
24 * @ingroup SpecialPage
25 */
26
27 use MediaWiki\MediaWikiServices;
28
29 /**
30 * MediaWiki page data importer
31 *
32 * @ingroup SpecialPage
33 */
34 class SpecialImport extends SpecialPage {
35 private $sourceName = false;
36 private $interwiki = false;
37 private $subproject;
38 private $fullInterwikiPrefix;
39 private $mapping = 'default';
40 private $namespace;
41 private $rootpage = '';
42 private $frompage = '';
43 private $logcomment = false;
44 private $history = true;
45 private $includeTemplates = false;
46 private $pageLinkDepth;
47 private $importSources;
48
49 public function __construct() {
50 parent::__construct( 'Import', 'import' );
51 }
52
53 public function doesWrites() {
54 return true;
55 }
56
57 /**
58 * Execute
59 * @param string|null $par
60 * @throws PermissionsError
61 * @throws ReadOnlyError
62 */
63 function execute( $par ) {
64 $this->useTransactionalTimeLimit();
65
66 $this->setHeaders();
67 $this->outputHeader();
68
69 $this->namespace = $this->getConfig()->get( 'ImportTargetNamespace' );
70
71 $this->getOutput()->addModules( 'mediawiki.special.import' );
72
73 $this->importSources = $this->getConfig()->get( 'ImportSources' );
74 Hooks::run( 'ImportSources', [ &$this->importSources ] );
75
76 $user = $this->getUser();
77 if ( !$user->isAllowedAny( 'import', 'importupload' ) ) {
78 throw new PermissionsError( 'import' );
79 }
80
81 # @todo Allow Title::getUserPermissionsErrors() to take an array
82 # @todo FIXME: Title::checkSpecialsAndNSPermissions() has a very wierd expectation of what
83 # getUserPermissionsErrors() might actually be used for, hence the 'ns-specialprotected'
84 $errors = wfMergeErrorArrays(
85 $this->getPageTitle()->getUserPermissionsErrors(
86 'import', $user, true,
87 [ 'ns-specialprotected', 'badaccess-group0', 'badaccess-groups' ]
88 ),
89 $this->getPageTitle()->getUserPermissionsErrors(
90 'importupload', $user, true,
91 [ 'ns-specialprotected', 'badaccess-group0', 'badaccess-groups' ]
92 )
93 );
94
95 if ( $errors ) {
96 throw new PermissionsError( 'import', $errors );
97 }
98
99 $this->checkReadOnly();
100
101 $request = $this->getRequest();
102 if ( $request->wasPosted() && $request->getVal( 'action' ) == 'submit' ) {
103 $this->doImport();
104 }
105 $this->showForm();
106 }
107
108 /**
109 * Do the actual import
110 */
111 private function doImport() {
112 $isUpload = false;
113 $request = $this->getRequest();
114 $this->sourceName = $request->getVal( "source" );
115
116 $this->logcomment = $request->getText( 'log-comment' );
117 $this->pageLinkDepth = $this->getConfig()->get( 'ExportMaxLinkDepth' ) == 0
118 ? 0
119 : $request->getIntOrNull( 'pagelink-depth' );
120
121 $this->mapping = $request->getVal( 'mapping' );
122 if ( $this->mapping === 'namespace' ) {
123 $this->namespace = $request->getIntOrNull( 'namespace' );
124 } elseif ( $this->mapping === 'subpage' ) {
125 $this->rootpage = $request->getText( 'rootpage' );
126 } else {
127 $this->mapping = 'default';
128 }
129
130 $user = $this->getUser();
131 if ( !$user->matchEditToken( $request->getVal( 'editToken' ) ) ) {
132 $source = Status::newFatal( 'import-token-mismatch' );
133 } elseif ( $this->sourceName === 'upload' ) {
134 $isUpload = true;
135 if ( $user->isAllowed( 'importupload' ) ) {
136 $source = ImportStreamSource::newFromUpload( "xmlimport" );
137 } else {
138 throw new PermissionsError( 'importupload' );
139 }
140 } elseif ( $this->sourceName === 'interwiki' ) {
141 if ( !$user->isAllowed( 'import' ) ) {
142 throw new PermissionsError( 'import' );
143 }
144 $this->interwiki = $this->fullInterwikiPrefix = $request->getVal( 'interwiki' );
145 // does this interwiki have subprojects?
146 $hasSubprojects = array_key_exists( $this->interwiki, $this->importSources );
147 if ( !$hasSubprojects && !in_array( $this->interwiki, $this->importSources ) ) {
148 $source = Status::newFatal( "import-invalid-interwiki" );
149 } else {
150 if ( $hasSubprojects ) {
151 $this->subproject = $request->getVal( 'subproject' );
152 $this->fullInterwikiPrefix .= ':' . $request->getVal( 'subproject' );
153 }
154 if ( $hasSubprojects &&
155 !in_array( $this->subproject, $this->importSources[$this->interwiki] )
156 ) {
157 $source = Status::newFatal( "import-invalid-interwiki" );
158 } else {
159 $this->history = $request->getCheck( 'interwikiHistory' );
160 $this->frompage = $request->getText( "frompage" );
161 $this->includeTemplates = $request->getCheck( 'interwikiTemplates' );
162 $source = ImportStreamSource::newFromInterwiki(
163 $this->fullInterwikiPrefix,
164 $this->frompage,
165 $this->history,
166 $this->includeTemplates,
167 $this->pageLinkDepth );
168 }
169 }
170 } else {
171 $source = Status::newFatal( "importunknownsource" );
172 }
173
174 $out = $this->getOutput();
175 if ( !$source->isGood() ) {
176 $out->wrapWikiMsg(
177 "<p class=\"error\">\n$1\n</p>",
178 [ 'importfailed', $source->getWikiText() ]
179 );
180 } else {
181 $importer = new WikiImporter( $source->value, $this->getConfig() );
182 if ( !is_null( $this->namespace ) ) {
183 $importer->setTargetNamespace( $this->namespace );
184 } elseif ( !is_null( $this->rootpage ) ) {
185 $statusRootPage = $importer->setTargetRootPage( $this->rootpage );
186 if ( !$statusRootPage->isGood() ) {
187 $out->wrapWikiMsg(
188 "<p class=\"error\">\n$1\n</p>",
189 [
190 'import-options-wrong',
191 $statusRootPage->getWikiText(),
192 count( $statusRootPage->getErrorsArray() )
193 ]
194 );
195
196 return;
197 }
198 }
199
200 $out->addWikiMsg( "importstart" );
201
202 $reporter = new ImportReporter(
203 $importer,
204 $isUpload,
205 $this->fullInterwikiPrefix,
206 $this->logcomment
207 );
208 $reporter->setContext( $this->getContext() );
209 $exception = false;
210
211 $reporter->open();
212 try {
213 $importer->doImport();
214 } catch ( Exception $e ) {
215 $exception = $e;
216 }
217 $result = $reporter->close();
218
219 if ( $exception ) {
220 # No source or XML parse error
221 $out->wrapWikiMsg(
222 "<p class=\"error\">\n$1\n</p>",
223 [ 'importfailed', $exception->getMessage() ]
224 );
225 } elseif ( !$result->isGood() ) {
226 # Zero revisions
227 $out->wrapWikiMsg(
228 "<p class=\"error\">\n$1\n</p>",
229 [ 'importfailed', $result->getWikiText() ]
230 );
231 } else {
232 # Success!
233 $out->addWikiMsg( 'importsuccess' );
234 }
235 $out->addHTML( '<hr />' );
236 }
237 }
238
239 private function getMappingFormPart( $sourceName ) {
240 $isSameSourceAsBefore = ( $this->sourceName === $sourceName );
241 $defaultNamespace = $this->getConfig()->get( 'ImportTargetNamespace' );
242 return "<tr>
243 <td>
244 </td>
245 <td class='mw-input'>" .
246 Xml::radioLabel(
247 $this->msg( 'import-mapping-default' )->text(),
248 'mapping',
249 'default',
250 // mw-import-mapping-interwiki-default, mw-import-mapping-upload-default
251 "mw-import-mapping-$sourceName-default",
252 ( $isSameSourceAsBefore ?
253 ( $this->mapping === 'default' ) :
254 is_null( $defaultNamespace ) )
255 ) .
256 "</td>
257 </tr>
258 <tr>
259 <td>
260 </td>
261 <td class='mw-input'>" .
262 Xml::radioLabel(
263 $this->msg( 'import-mapping-namespace' )->text(),
264 'mapping',
265 'namespace',
266 // mw-import-mapping-interwiki-namespace, mw-import-mapping-upload-namespace
267 "mw-import-mapping-$sourceName-namespace",
268 ( $isSameSourceAsBefore ?
269 ( $this->mapping === 'namespace' ) :
270 !is_null( $defaultNamespace ) )
271 ) . ' ' .
272 Html::namespaceSelector(
273 [
274 'selected' => ( $isSameSourceAsBefore ?
275 $this->namespace :
276 ( $defaultNamespace || '' ) ),
277 ], [
278 'name' => "namespace",
279 // mw-import-namespace-interwiki, mw-import-namespace-upload
280 'id' => "mw-import-namespace-$sourceName",
281 'class' => 'namespaceselector',
282 ]
283 ) .
284 "</td>
285 </tr>
286 <tr>
287 <td>
288 </td>
289 <td class='mw-input'>" .
290 Xml::radioLabel(
291 $this->msg( 'import-mapping-subpage' )->text(),
292 'mapping',
293 'subpage',
294 // mw-import-mapping-interwiki-subpage, mw-import-mapping-upload-subpage
295 "mw-import-mapping-$sourceName-subpage",
296 ( $isSameSourceAsBefore ? ( $this->mapping === 'subpage' ) : '' )
297 ) . ' ' .
298 Xml::input( 'rootpage', 50,
299 ( $isSameSourceAsBefore ? $this->rootpage : '' ),
300 [
301 // Should be "mw-import-rootpage-...", but we keep this inaccurate
302 // ID for legacy reasons
303 // mw-interwiki-rootpage-interwiki, mw-interwiki-rootpage-upload
304 'id' => "mw-interwiki-rootpage-$sourceName",
305 'type' => 'text'
306 ]
307 ) . ' ' .
308 "</td>
309 </tr>";
310 }
311
312 private function showForm() {
313 $action = $this->getPageTitle()->getLocalURL( [ 'action' => 'submit' ] );
314 $user = $this->getUser();
315 $out = $this->getOutput();
316 $this->addHelpLink( '//meta.wikimedia.org/wiki/Special:MyLanguage/Help:Import', true );
317
318 if ( $user->isAllowed( 'importupload' ) ) {
319 $mappingSelection = $this->getMappingFormPart( 'upload' );
320 $out->addHTML(
321 Xml::fieldset( $this->msg( 'import-upload' )->text() ) .
322 Xml::openElement(
323 'form',
324 [
325 'enctype' => 'multipart/form-data',
326 'method' => 'post',
327 'action' => $action,
328 'id' => 'mw-import-upload-form'
329 ]
330 ) .
331 $this->msg( 'importtext' )->parseAsBlock() .
332 Html::hidden( 'action', 'submit' ) .
333 Html::hidden( 'source', 'upload' ) .
334 Xml::openElement( 'table', [ 'id' => 'mw-import-table-upload' ] ) .
335 "<tr>
336 <td class='mw-label'>" .
337 Xml::label( $this->msg( 'import-upload-filename' )->text(), 'xmlimport' ) .
338 "</td>
339 <td class='mw-input'>" .
340 Html::input( 'xmlimport', '', 'file', [ 'id' => 'xmlimport' ] ) . ' ' .
341 "</td>
342 </tr>
343 <tr>
344 <td class='mw-label'>" .
345 Xml::label( $this->msg( 'import-comment' )->text(), 'mw-import-comment' ) .
346 "</td>
347 <td class='mw-input'>" .
348 Xml::input( 'log-comment', 50,
349 ( $this->sourceName === 'upload' ? $this->logcomment : '' ),
350 [ 'id' => 'mw-import-comment', 'type' => 'text' ] ) . ' ' .
351 "</td>
352 </tr>
353 $mappingSelection
354 <tr>
355 <td></td>
356 <td class='mw-submit'>" .
357 Xml::submitButton( $this->msg( 'uploadbtn' )->text() ) .
358 "</td>
359 </tr>" .
360 Xml::closeElement( 'table' ) .
361 Html::hidden( 'editToken', $user->getEditToken() ) .
362 Xml::closeElement( 'form' ) .
363 Xml::closeElement( 'fieldset' )
364 );
365 } else {
366 if ( empty( $this->importSources ) ) {
367 $out->addWikiMsg( 'importnosources' );
368 }
369 }
370
371 if ( $user->isAllowed( 'import' ) && !empty( $this->importSources ) ) {
372 # Show input field for import depth only if $wgExportMaxLinkDepth > 0
373 $importDepth = '';
374 if ( $this->getConfig()->get( 'ExportMaxLinkDepth' ) > 0 ) {
375 $importDepth = "<tr>
376 <td class='mw-label'>" .
377 $this->msg( 'export-pagelinks' )->parse() .
378 "</td>
379 <td class='mw-input'>" .
380 Xml::input( 'pagelink-depth', 3, 0 ) .
381 "</td>
382 </tr>";
383 }
384 $mappingSelection = $this->getMappingFormPart( 'interwiki' );
385
386 $out->addHTML(
387 Xml::fieldset( $this->msg( 'importinterwiki' )->text() ) .
388 Xml::openElement(
389 'form',
390 [
391 'method' => 'post',
392 'action' => $action,
393 'id' => 'mw-import-interwiki-form'
394 ]
395 ) .
396 $this->msg( 'import-interwiki-text' )->parseAsBlock() .
397 Html::hidden( 'action', 'submit' ) .
398 Html::hidden( 'source', 'interwiki' ) .
399 Html::hidden( 'editToken', $user->getEditToken() ) .
400 Xml::openElement( 'table', [ 'id' => 'mw-import-table-interwiki' ] ) .
401 "<tr>
402 <td class='mw-label'>" .
403 Xml::label( $this->msg( 'import-interwiki-sourcewiki' )->text(), 'interwiki' ) .
404 "</td>
405 <td class='mw-input'>" .
406 Xml::openElement(
407 'select',
408 [ 'name' => 'interwiki', 'id' => 'interwiki' ]
409 )
410 );
411
412 $needSubprojectField = false;
413 foreach ( $this->importSources as $key => $value ) {
414 if ( is_int( $key ) ) {
415 $key = $value;
416 } elseif ( $value !== $key ) {
417 $needSubprojectField = true;
418 }
419
420 $attribs = [
421 'value' => $key,
422 ];
423 if ( is_array( $value ) ) {
424 $attribs['data-subprojects'] = implode( ' ', $value );
425 }
426 if ( $this->interwiki === $key ) {
427 $attribs['selected'] = 'selected';
428 }
429 $out->addHTML( Html::element( 'option', $attribs, $key ) );
430 }
431
432 $out->addHTML(
433 Xml::closeElement( 'select' )
434 );
435
436 if ( $needSubprojectField ) {
437 $out->addHTML(
438 Xml::openElement(
439 'select',
440 [ 'name' => 'subproject', 'id' => 'subproject' ]
441 )
442 );
443
444 $subprojectsToAdd = [];
445 foreach ( $this->importSources as $key => $value ) {
446 if ( is_array( $value ) ) {
447 $subprojectsToAdd = array_merge( $subprojectsToAdd, $value );
448 }
449 }
450 $subprojectsToAdd = array_unique( $subprojectsToAdd );
451 sort( $subprojectsToAdd );
452 foreach ( $subprojectsToAdd as $subproject ) {
453 $out->addHTML( Xml::option( $subproject, $subproject, $this->subproject === $subproject ) );
454 }
455
456 $out->addHTML(
457 Xml::closeElement( 'select' )
458 );
459 }
460
461 $out->addHTML(
462 "</td>
463 </tr>
464 <tr>
465 <td class='mw-label'>" .
466 Xml::label( $this->msg( 'import-interwiki-sourcepage' )->text(), 'frompage' ) .
467 "</td>
468 <td class='mw-input'>" .
469 Xml::input( 'frompage', 50, $this->frompage, [ 'id' => 'frompage' ] ) .
470 "</td>
471 </tr>
472 <tr>
473 <td>
474 </td>
475 <td class='mw-input'>" .
476 Xml::checkLabel(
477 $this->msg( 'import-interwiki-history' )->text(),
478 'interwikiHistory',
479 'interwikiHistory',
480 $this->history
481 ) .
482 "</td>
483 </tr>
484 <tr>
485 <td>
486 </td>
487 <td class='mw-input'>" .
488 Xml::checkLabel(
489 $this->msg( 'import-interwiki-templates' )->text(),
490 'interwikiTemplates',
491 'interwikiTemplates',
492 $this->includeTemplates
493 ) .
494 "</td>
495 </tr>
496 $importDepth
497 <tr>
498 <td class='mw-label'>" .
499 Xml::label( $this->msg( 'import-comment' )->text(), 'mw-interwiki-comment' ) .
500 "</td>
501 <td class='mw-input'>" .
502 Xml::input( 'log-comment', 50,
503 ( $this->sourceName === 'interwiki' ? $this->logcomment : '' ),
504 [ 'id' => 'mw-interwiki-comment', 'type' => 'text' ] ) . ' ' .
505 "</td>
506 </tr>
507 $mappingSelection
508 <tr>
509 <td>
510 </td>
511 <td class='mw-submit'>" .
512 Xml::submitButton(
513 $this->msg( 'import-interwiki-submit' )->text(),
514 Linker::tooltipAndAccesskeyAttribs( 'import' )
515 ) .
516 "</td>
517 </tr>" .
518 Xml::closeElement( 'table' ) .
519 Xml::closeElement( 'form' ) .
520 Xml::closeElement( 'fieldset' )
521 );
522 }
523 }
524
525 protected function getGroupName() {
526 return 'pagetools';
527 }
528 }
529
530 /**
531 * Reporting callback
532 * @ingroup SpecialPage
533 */
534 class ImportReporter extends ContextSource {
535 private $reason = false;
536 private $logTags = [];
537 private $mOriginalLogCallback = null;
538 private $mOriginalPageOutCallback = null;
539 private $mLogItemCount = 0;
540
541 /**
542 * @param WikiImporter $importer
543 * @param bool $upload
544 * @param string $interwiki
545 * @param string|bool $reason
546 */
547 function __construct( $importer, $upload, $interwiki, $reason = false ) {
548 $this->mOriginalPageOutCallback =
549 $importer->setPageOutCallback( [ $this, 'reportPage' ] );
550 $this->mOriginalLogCallback =
551 $importer->setLogItemCallback( [ $this, 'reportLogItem' ] );
552 $importer->setNoticeCallback( [ $this, 'reportNotice' ] );
553 $this->mPageCount = 0;
554 $this->mIsUpload = $upload;
555 $this->mInterwiki = $interwiki;
556 $this->reason = $reason;
557 }
558
559 /**
560 * Sets change tags to apply to the import log entry and null revision.
561 *
562 * @param array $tags
563 * @since 1.29
564 */
565 public function setChangeTags( array $tags ) {
566 $this->logTags = $tags;
567 }
568
569 function open() {
570 $this->getOutput()->addHTML( "<ul>\n" );
571 }
572
573 function reportNotice( $msg, array $params ) {
574 $this->getOutput()->addHTML(
575 Html::element( 'li', [], $this->msg( $msg, $params )->text() )
576 );
577 }
578
579 function reportLogItem( /* ... */ ) {
580 $this->mLogItemCount++;
581 if ( is_callable( $this->mOriginalLogCallback ) ) {
582 call_user_func_array( $this->mOriginalLogCallback, func_get_args() );
583 }
584 }
585
586 /**
587 * @param Title $title
588 * @param ForeignTitle $foreignTitle
589 * @param int $revisionCount
590 * @param int $successCount
591 * @param array $pageInfo
592 * @return void
593 */
594 public function reportPage( $title, $foreignTitle, $revisionCount,
595 $successCount, $pageInfo ) {
596 $args = func_get_args();
597 call_user_func_array( $this->mOriginalPageOutCallback, $args );
598
599 if ( $title === null ) {
600 # Invalid or non-importable title; a notice is already displayed
601 return;
602 }
603
604 $this->mPageCount++;
605 $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
606 if ( $successCount > 0 ) {
607 // <bdi> prevents jumbling of the versions count
608 // in RTL wikis in case the page title is LTR
609 $this->getOutput()->addHTML(
610 "<li>" . $linkRenderer->makeLink( $title ) . " " .
611 "<bdi>" .
612 $this->msg( 'import-revision-count' )->numParams( $successCount )->escaped() .
613 "</bdi>" .
614 "</li>\n"
615 );
616
617 $logParams = [ '4:number:count' => $successCount ];
618 if ( $this->mIsUpload ) {
619 $detail = $this->msg( 'import-logentry-upload-detail' )->numParams(
620 $successCount )->inContentLanguage()->text();
621 $action = 'upload';
622 } else {
623 $pageTitle = $foreignTitle->getFullText();
624 $fullInterwikiPrefix = $this->mInterwiki;
625 Hooks::run( 'ImportLogInterwikiLink', [ &$fullInterwikiPrefix, &$pageTitle ] );
626
627 $interwikiTitleStr = $fullInterwikiPrefix . ':' . $pageTitle;
628 $interwiki = '[[:' . $interwikiTitleStr . ']]';
629 $detail = $this->msg( 'import-logentry-interwiki-detail' )->numParams(
630 $successCount )->params( $interwiki )->inContentLanguage()->text();
631 $action = 'interwiki';
632 $logParams['5:title-link:interwiki'] = $interwikiTitleStr;
633 }
634 if ( $this->reason ) {
635 $detail .= $this->msg( 'colon-separator' )->inContentLanguage()->text()
636 . $this->reason;
637 }
638
639 $comment = $detail; // quick
640 $dbw = wfGetDB( DB_MASTER );
641 $latest = $title->getLatestRevID();
642 $nullRevision = Revision::newNullRevision(
643 $dbw,
644 $title->getArticleID(),
645 $comment,
646 true,
647 $this->getUser()
648 );
649
650 $nullRevId = null;
651 if ( !is_null( $nullRevision ) ) {
652 $nullRevId = $nullRevision->insertOn( $dbw );
653 $page = WikiPage::factory( $title );
654 # Update page record
655 $page->updateRevisionOn( $dbw, $nullRevision );
656 Hooks::run(
657 'NewRevisionFromEditComplete',
658 [ $page, $nullRevision, $latest, $this->getUser() ]
659 );
660 }
661
662 // Create the import log entry
663 $logEntry = new ManualLogEntry( 'import', $action );
664 $logEntry->setTarget( $title );
665 $logEntry->setComment( $this->reason );
666 $logEntry->setPerformer( $this->getUser() );
667 $logEntry->setParameters( $logParams );
668 $logid = $logEntry->insert();
669 if ( count( $this->logTags ) ) {
670 $logEntry->setTags( $this->logTags );
671 }
672 // Make sure the null revision will be tagged as well
673 $logEntry->setAssociatedRevId( $nullRevId );
674
675 $logEntry->publish( $logid );
676
677 } else {
678 $this->getOutput()->addHTML( "<li>" . $linkRenderer->makeKnownLink( $title ) . " " .
679 $this->msg( 'import-nonewrevisions' )->escaped() . "</li>\n" );
680 }
681 }
682
683 function close() {
684 $out = $this->getOutput();
685 if ( $this->mLogItemCount > 0 ) {
686 $msg = $this->msg( 'imported-log-entries' )->numParams( $this->mLogItemCount )->parse();
687 $out->addHTML( Xml::tags( 'li', null, $msg ) );
688 } elseif ( $this->mPageCount == 0 && $this->mLogItemCount == 0 ) {
689 $out->addHTML( "</ul>\n" );
690
691 return Status::newFatal( 'importnopages' );
692 }
693 $out->addHTML( "</ul>\n" );
694
695 return Status::newGood( $this->mPageCount );
696 }
697 }