From 929cffee0fabd70c68827e5ff83f75435ae7274f Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 27 Jun 2006 19:32:32 +0000 Subject: [PATCH] * (bug 2481) List imported pages during Special:Import --- RELEASE-NOTES | 1 + includes/SpecialImport.php | 35 +++++++++++++++++++++++++++++++++++ languages/Messages.php | 2 ++ 3 files changed, 38 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 21053b67bc..fce55fe2a6 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -574,6 +574,7 @@ Some default configuration options have changed: * Update to Piedmontese localization (pms) * dumpBackup can optionally compress via dbzip2 * (bug 2483) Run link updates on change via XML import +* (bug 2481) List imported pages during Special:Import == Compatibility == diff --git a/includes/SpecialImport.php b/includes/SpecialImport.php index 37d6e5de79..f19e0f4f8b 100644 --- a/includes/SpecialImport.php +++ b/includes/SpecialImport.php @@ -55,8 +55,12 @@ function wfSpecialImport( $page = '' ) { if( WikiError::isError( $source ) ) { $wgOut->addWikiText( wfEscapeWikiText( $source->getMessage() ) ); } else { + $wgOut->addWikiText( wfMsg( "importstart" ) ); $importer = new WikiImporter( $source ); + $reporter = new ImportReporter( $importer ); + $reporter->open(); $result = $importer->doImport(); + $reporter->close(); if( WikiError::isError( $result ) ) { $wgOut->addWikiText( wfMsg( "importfailed", wfEscapeWikiText( $result->getMessage() ) ) ); @@ -112,6 +116,37 @@ function wfSpecialImport( $page = '' ) { } } +/** + * Reporting callback + */ +class ImportReporter { + function __construct( $importer ) { + $importer->setPageCallback( array( $this, 'reportPage' ) ); + $this->pageCount = 0; + } + + function open() { + global $wgOut; + $wgOut->addHtml( "\n" ); + } +} + /** * * @package MediaWiki diff --git a/languages/Messages.php b/languages/Messages.php index a8db0f299b..dd12c83839 100644 --- a/languages/Messages.php +++ b/languages/Messages.php @@ -1458,6 +1458,8 @@ In the latter case you can also use a link, e.g. [[{{ns:Special}}:Export/{{int:m 'import' => 'Import pages', 'importinterwiki' => 'Transwiki import', 'importtext' => 'Please export the file from the source wiki using the Special:Export utility, save it to your disk and upload it here.', +'importstart' => "Importing pages...", +'importnopages' => "No pages to import.", 'importfailed' => "Import failed: $1", 'importnotext' => 'Empty or no text', 'importsuccess' => 'Import succeeded!', -- 2.20.1