* 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 ==
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() ) ) );
}
}
+/**
+ * Reporting callback
+ */
+class ImportReporter {
+ function __construct( $importer ) {
+ $importer->setPageCallback( array( $this, 'reportPage' ) );
+ $this->pageCount = 0;
+ }
+
+ function open() {
+ global $wgOut;
+ $wgOut->addHtml( "<ul>\n" );
+ }
+
+ function reportPage( $pageName ) {
+ global $wgOut, $wgUser;
+ $skin = $wgUser->getSkin();
+ $title = Title::newFromText( $pageName );
+ $wgOut->addHtml( "<li>" . $skin->makeKnownLinkObj( $title ) . "</li>\n" );
+ $this->pageCount++;
+ }
+
+ function close() {
+ global $wgOut;
+ if( $this->pageCount == 0 ) {
+ $wgOut->addHtml( "<li>" . wfMsgHtml( 'importnopages' ) . "</li>\n" );
+ }
+ $wgOut->addHtml( "</ul>\n" );
+ }
+}
+
/**
*
* @package MediaWiki
'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!',