2018-07-16 12:10:36 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class AbuseFilterRightsLogFormatter extends LogFormatter {
|
|
|
|
|
|
|
|
/**
|
2019-08-11 18:34:50 +00:00
|
|
|
* This method is identical to the parent, but it's redeclared to give grep a chance
|
|
|
|
* to find the messages.
|
|
|
|
* @inheritDoc
|
2018-07-16 12:10:36 +00:00
|
|
|
*/
|
|
|
|
protected function getMessageKey() {
|
|
|
|
$subtype = $this->entry->getSubtype();
|
|
|
|
// Messages that can be used here:
|
|
|
|
// * logentry-rights-blockautopromote
|
|
|
|
// * logentry-rights-restoreautopromote
|
|
|
|
return "logentry-rights-$subtype";
|
|
|
|
}
|
2019-08-24 09:34:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritDoc
|
|
|
|
*/
|
|
|
|
protected function extractParameters() {
|
|
|
|
$ret = [];
|
|
|
|
$ret[3] = $this->entry->getTarget()->getText();
|
|
|
|
if ( $this->entry->getSubType() === 'blockautopromote' ) {
|
|
|
|
$parameters = $this->entry->getParameters();
|
|
|
|
$duration = $parameters['7::duration'];
|
2019-09-09 11:56:56 +00:00
|
|
|
$ret[4] = $this->context->getLanguage()->formatDuration( $duration );
|
2019-08-24 09:34:11 +00:00
|
|
|
}
|
|
|
|
return $ret;
|
|
|
|
}
|
2020-09-16 09:21:14 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritDoc
|
|
|
|
*/
|
|
|
|
protected function getMessageParameters() {
|
|
|
|
$params = parent::getMessageParameters();
|
|
|
|
// remove "User:" prefix
|
|
|
|
$params[2] = $this->formatParameterValue( 'user-link', $this->entry->getTarget()->getText() );
|
|
|
|
return $params;
|
|
|
|
}
|
|
|
|
|
2018-07-16 12:10:36 +00:00
|
|
|
}
|