mediawiki-extensions-AbuseF.../includes/ThrottleFilterPresentationModel.php
Matěj Suchánek dc7509811a Notify of a throttled filter
Use Echo for delivering the notification to the last
user who edited the filter.

Much boilerplate.

Change-Id: I7a46a03b4f15de20902ec70c62fb4fe750096842
Depends-On: If585b14a6dd6fb8c7d2c3bee1f20d9d08eaac706
2020-12-19 10:31:29 +01:00

45 lines
934 B
PHP

<?php
namespace MediaWiki\Extension\AbuseFilter;
use EchoEventPresentationModel;
class ThrottleFilterPresentationModel extends EchoEventPresentationModel {
/**
* @inheritDoc
*/
public function getIconType() {
return 'placeholder';
}
/**
* @inheritDoc
*/
public function getHeaderMessage() {
$text = $this->event->getTitle()->getText();
list( , $filter ) = explode( '/', $text, 2 );
return $this->msg( 'notification-header-throttle-filter' )
->params( $this->getViewingUserForGender() )
->numParams( $filter );
}
/**
* @inheritDoc
*/
public function getSubjectMessage() {
return $this->msg( 'notification-subject-throttle-filter' )
->params( $this->getViewingUserForGender() );
}
/**
* @inheritDoc
*/
public function getPrimaryLink() {
return [
'url' => $this->event->getTitle()->getFullURL(),
'label' => $this->msg( 'notification-link-text-show-filter' )->text()
];
}
}