X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialImport.php;h=0574dbc11588ca2655cd2cf0ca9eb2d707d976fc;hb=280f07725e43b85033eba73d166ae80d717620db;hp=e2bc62903c25eaf88b09604fb59295e18f1de184;hpb=70e760ee4e37edad1be0573b37c17fe6899e4806;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialImport.php b/includes/specials/SpecialImport.php index e2bc62903c..0574dbc115 100644 --- a/includes/specials/SpecialImport.php +++ b/includes/specials/SpecialImport.php @@ -51,6 +51,10 @@ class SpecialImport extends SpecialPage { parent::__construct( 'Import', 'import' ); } + public function doesWrites() { + return true; + } + /** * Execute * @param string|null $par @@ -596,30 +600,33 @@ class ImportReporter extends ContextSource { "\n" ); + $logParams = array( '4:number:count' => $successCount ); if ( $this->mIsUpload ) { $detail = $this->msg( 'import-logentry-upload-detail' )->numParams( $successCount )->inContentLanguage()->text(); - if ( $this->reason ) { - $detail .= $this->msg( 'colon-separator' )->inContentLanguage()->text() - . $this->reason; - } $action = 'upload'; } else { - $interwiki = '[[:' . $this->mInterwiki . ':' . - $foreignTitle->getFullText() . ']]'; + $pageTitle = $foreignTitle->getFullText(); + $fullInterwikiPrefix = $this->mInterwiki; + Hooks::run( 'ImportLogInterwikiLink', array( &$fullInterwikiPrefix, &$pageTitle ) ); + + $interwikiTitleStr = $fullInterwikiPrefix . ':' . $pageTitle; + $interwiki = '[[:' . $interwikiTitleStr . ']]'; $detail = $this->msg( 'import-logentry-interwiki-detail' )->numParams( $successCount )->params( $interwiki )->inContentLanguage()->text(); - if ( $this->reason ) { - $detail .= $this->msg( 'colon-separator' )->inContentLanguage()->text() - . $this->reason; - } $action = 'interwiki'; + $logParams['5:title-link:interwiki'] = $interwikiTitleStr; + } + if ( $this->reason ) { + $detail .= $this->msg( 'colon-separator' )->inContentLanguage()->text() + . $this->reason; } $logEntry = new ManualLogEntry( 'import', $action ); $logEntry->setTarget( $title ); - $logEntry->setComment( $detail ); + $logEntry->setComment( $this->reason ); $logEntry->setPerformer( $this->getUser() ); + $logEntry->setParameters( $logParams ); $logid = $logEntry->insert(); $logEntry->publish( $logid );