'protect/modify' => 'modifiedarticleprotection',
'protect/unprotect' => 'unprotectedarticle',
'protect/move_prot' => 'movedarticleprotection',
- 'import/upload' => 'import-logentry-upload',
- 'import/interwiki' => 'import-logentry-interwiki',
);
/**
'block/reblock' => 'BlockLogFormatter',
'suppress/block' => 'BlockLogFormatter',
'suppress/reblock' => 'BlockLogFormatter',
+ 'import/upload' => 'LogFormatter',
+ 'import/interwiki' => 'LogFormatter',
);
/**
break;
}
break;
+
+ case 'import':
+ switch ( $entry->getSubtype() ) {
+ case 'upload':
+ $text = wfMessage( 'import-logentry-upload' )
+ ->rawParams( $target )->inContentLanguage()->escaped();
+ break;
+ case 'interwiki':
+ $text = wfMessage( 'import-logentry-interwiki' )
+ ->rawParams( $target )->inContentLanguage()->escaped();
+ break;
+ }
+ break;
// case 'suppress' --private log -- aaron (so we know who to blame in a few years :-D)
// default:
}
"</li>\n"
);
- $log = new LogPage( 'import' );
if ( $this->mIsUpload ) {
$detail = $this->msg( 'import-logentry-upload-detail' )->numParams(
$successCount )->inContentLanguage()->text();
$detail .= $this->msg( 'colon-separator' )->inContentLanguage()->text()
. $this->reason;
}
- $log->addEntry( 'upload', $title, $detail, array(), $this->getUser() );
+ $action = 'upload';
} else {
$interwiki = '[[:' . $this->mInterwiki . ':' .
$foreignTitle->getFullText() . ']]';
$detail .= $this->msg( 'colon-separator' )->inContentLanguage()->text()
. $this->reason;
}
- $log->addEntry( 'interwiki', $title, $detail, array(), $this->getUser() );
+ $action = 'interwiki';
}
+ $logEntry = new ManualLogEntry( 'import', $action );
+ $logEntry->setTarget( $title );
+ $logEntry->setComment( $detail );
+ $logEntry->setPerformer( $this->getUser() );
+ $logid = $logEntry->insert();
+ $logEntry->publish( $logid );
+
$comment = $detail; // quick
$dbw = wfGetDB( DB_MASTER );
$latest = $title->getLatestRevID();
"logentry-block-reblock": "$1 {{GENDER:$2|changed}} block settings for {{GENDER:$4|$3}} with an expiry time of $5 $6",
"logentry-suppress-block": "$1 {{GENDER:$2|blocked}} {{GENDER:$4|$3}} with an expiry time of $5 $6",
"logentry-suppress-reblock": "$1 {{GENDER:$2|changed}} block settings for {{GENDER:$4|$3}} with an expiry time of $5 $6",
+ "logentry-import-upload": "$1 {{GENDER:$2|imported}} $3 by file upload",
+ "logentry-import-interwiki": "$1 {{GENDER:$2|imported}} $3 from another wiki",
"logentry-merge-merge": "$1 {{GENDER:$2|merged}} $3 into $4 (revisions up to $5)",
"logentry-move-move": "$1 {{GENDER:$2|moved}} page $3 to $4",
"logentry-move-move-noredirect": "$1 {{GENDER:$2|moved}} page $3 to $4 without leaving a redirect",
"import-rootpage-nosubpage": "Used on [[Special:Import]], when the import namespace does not support subpages. Parameters:\n* $1 is a namespace name.",
"importlogpage": "{{doc-logpage}}",
"importlogpagetext": "This text appears at the top of the [{{canonicalurl:Special:Log|type=import}} import log] special page.",
- "import-logentry-upload": "This is the text of an entry in the Import log (and Recent Changes), after hour (and date, only in the Import log) and sysop name:\n* $1 is the name of the imported file",
+ "import-logentry-upload": "{{ignored}}This is ''logentry'' message only used on IRC.\n* $1 is the name of the imported file",
"import-logentry-upload-detail": "Used as success message and log entry. Parameters:\n* $1 - number of succeeded revisions\nSee also:\n* {{msg-mw|Import-logentry-interwiki-detail}}",
- "import-logentry-interwiki": "Used as action listed in the log. Parameters:\n* $1 - page title",
+ "import-logentry-interwiki": "{{ignored}}This is ''logentry'' message only used on IRC. Parameters:\n* $1 - page title",
"import-logentry-interwiki-detail": "Used as success message and log entry. Parameters:\n* $1 - number of succeeded revisions\n* $2 - interwiki name\nSee also:\n* {{msg-mw|Import-logentry-upload-detail}}",
"javascripttest": "Title of the special page [[Special:JavaScriptTest]].\n\nSee also:\n* {{msg-mw|Javascripttest|title}}\n* {{msg-mw|Javascripttest-pagetext-noframework|summary}}\n* {{msg-mw|Javascripttest-pagetext-unknownframework|error message}}",
"javascripttest-backlink": "{{optional}}\nUsed as subtitle in [[Special:JavaScriptTest]]. Parameters:\n* $1 - page title",
"logentry-block-reblock": "{{Logentry|[[Special:Log/block]]}}\n* $4 - user name for gender or empty string for autoblocks\n* $5 - the block duration, localized and formatted with the english tooltip\n* $6 - block detail flags or empty string\n\nCf. {{msg-mw|Reblock-logentry}}",
"logentry-suppress-block": "{{Logentry}}\n* $4 - user name for gender or empty string for autoblocks\n* $5 - the block duration, localized and formatted with the english tooltip\n* $6 - block detail flags or empty string",
"logentry-suppress-reblock": "{{Logentry}}\n* $4 - user name for gender or empty string for autoblocks\n* $5 - the block duration, localized and formatted with the english tooltip\n* $6 - block detail flags or empty string",
+ "logentry-import-upload": "{{Logentry|[[Special:Log/import]]}}",
+ "logentry-import-interwiki": "{{Logentry|[[Special:Log/import]]}}",
"logentry-merge-merge": "{{Logentry|[[Special:Log/merge]]}}\n* $4 - the page into which the content is merged\n* $5 - a timestamp of limit\n\nThe log and its associated special page 'MergeHistory' is not enabled by default.\n\nPlease note that the parameters in a log entry will appear in the log only in the default language of the wiki. View [[Special:Log]] for examples on translatewiki.net with English default language.",
"logentry-move-move": "{{Logentry|[[Special:Log/move]]}}\nParameter $4, the target page, is also not visible to parser functions.",
"logentry-move-move-noredirect": "{{Logentry|[[Special:Log/move]]}}\nParameter $4, the target page, is also not visible to parser functions.",
* - protect/unprotect
* - upload/upload
* - merge/merge
+ * - import/upload
+ * - import/interwiki
*
* As well as the following Auto Edit Summaries:
* - blank
);
}
+ /**
+ * @covers LogFormatter::getIRCActionText
+ */
+ public function testIrcMsgForLogTypeImport() {
+ $sep = $this->context->msg( 'colon-separator' )->text();
+
+ # import/upload
+ $this->assertIRCComment(
+ $this->context->msg( 'import-logentry-upload', 'SomeTitle' )->plain() . $sep . $this->user_comment,
+ 'import', 'upload',
+ array(),
+ $this->user_comment
+ );
+
+ # import/interwiki
+ $this->assertIRCComment(
+ $this->context->msg( 'import-logentry-interwiki', 'SomeTitle' )->plain() . $sep . $this->user_comment,
+ 'import', 'interwiki',
+ array(),
+ $this->user_comment
+ );
+ }
+
/**
* @todo Emulate these edits somehow and extract
* raw edit summary from RecentChange object