Index: trunk/phase3/includes/SpecialImport.php |
— | — | @@ -55,8 +55,12 @@ |
56 | 56 | if( WikiError::isError( $source ) ) { |
57 | 57 | $wgOut->addWikiText( wfEscapeWikiText( $source->getMessage() ) ); |
58 | 58 | } else { |
| 59 | + $wgOut->addWikiText( wfMsg( "importstart" ) ); |
59 | 60 | $importer = new WikiImporter( $source ); |
| 61 | + $reporter = new ImportReporter( $importer ); |
| 62 | + $reporter->open(); |
60 | 63 | $result = $importer->doImport(); |
| 64 | + $reporter->close(); |
61 | 65 | if( WikiError::isError( $result ) ) { |
62 | 66 | $wgOut->addWikiText( wfMsg( "importfailed", |
63 | 67 | wfEscapeWikiText( $result->getMessage() ) ) ); |
— | — | @@ -113,6 +117,37 @@ |
114 | 118 | } |
115 | 119 | |
116 | 120 | /** |
| 121 | + * Reporting callback |
| 122 | + */ |
| 123 | +class ImportReporter { |
| 124 | + function __construct( $importer ) { |
| 125 | + $importer->setPageCallback( array( $this, 'reportPage' ) ); |
| 126 | + $this->pageCount = 0; |
| 127 | + } |
| 128 | + |
| 129 | + function open() { |
| 130 | + global $wgOut; |
| 131 | + $wgOut->addHtml( "<ul>\n" ); |
| 132 | + } |
| 133 | + |
| 134 | + function reportPage( $pageName ) { |
| 135 | + global $wgOut, $wgUser; |
| 136 | + $skin = $wgUser->getSkin(); |
| 137 | + $title = Title::newFromText( $pageName ); |
| 138 | + $wgOut->addHtml( "<li>" . $skin->makeKnownLinkObj( $title ) . "</li>\n" ); |
| 139 | + $this->pageCount++; |
| 140 | + } |
| 141 | + |
| 142 | + function close() { |
| 143 | + global $wgOut; |
| 144 | + if( $this->pageCount == 0 ) { |
| 145 | + $wgOut->addHtml( "<li>" . wfMsgHtml( 'importnopages' ) . "</li>\n" ); |
| 146 | + } |
| 147 | + $wgOut->addHtml( "</ul>\n" ); |
| 148 | + } |
| 149 | +} |
| 150 | + |
| 151 | +/** |
117 | 152 | * |
118 | 153 | * @package MediaWiki |
119 | 154 | * @subpackage SpecialPage |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -574,6 +574,7 @@ |
575 | 575 | * Update to Piedmontese localization (pms) |
576 | 576 | * dumpBackup can optionally compress via dbzip2 |
577 | 577 | * (bug 2483) Run link updates on change via XML import |
| 578 | +* (bug 2481) List imported pages during Special:Import |
578 | 579 | |
579 | 580 | |
580 | 581 | == Compatibility == |
Index: trunk/phase3/languages/Messages.php |
— | — | @@ -1458,6 +1458,8 @@ |
1459 | 1459 | 'import' => 'Import pages', |
1460 | 1460 | 'importinterwiki' => 'Transwiki import', |
1461 | 1461 | 'importtext' => 'Please export the file from the source wiki using the Special:Export utility, save it to your disk and upload it here.', |
| 1462 | +'importstart' => "Importing pages...", |
| 1463 | +'importnopages' => "No pages to import.", |
1462 | 1464 | 'importfailed' => "Import failed: $1", |
1463 | 1465 | 'importnotext' => 'Empty or no text', |
1464 | 1466 | 'importsuccess' => 'Import succeeded!', |