mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-23 23:44:53 +00:00
2e6c50a963
Change-Id: I75571da5943bb94f6d997ebdb8e33fae8b62e812
45 lines
1.2 KiB
PHP
45 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace MediaWiki\Extension\Notifications\Formatters;
|
|
|
|
class EchoEditThresholdPresentationModel extends EchoEventPresentationModel {
|
|
|
|
public function getIconType() {
|
|
return 'edit';
|
|
}
|
|
|
|
public function getHeaderMessageKey() {
|
|
// The following messages are used here:
|
|
// * notification-header-thank-you-1-edit
|
|
// * notification-header-thank-you-10-edit
|
|
// * notification-header-thank-you-100-edit
|
|
// * notification-header-thank-you-1000-edit
|
|
// * notification-header-thank-you-10000-edit
|
|
// * notification-header-thank-you-100000-edit
|
|
// * notification-header-thank-you-1000000-edit
|
|
// * notification-header-thank-you-10000000-edit
|
|
return 'notification-header-thank-you-' . $this->event->getExtraParam( 'editCount' ) . '-edit';
|
|
}
|
|
|
|
public function getPrimaryLink() {
|
|
if ( !$this->event->getTitle() ) {
|
|
return false;
|
|
}
|
|
|
|
if ( $this->event->getExtraParam( 'revid' ) ) {
|
|
$params = [
|
|
'oldid' => 'prev',
|
|
'diff' => $this->event->getExtraParam( 'revid' )
|
|
];
|
|
} else {
|
|
$params = [];
|
|
}
|
|
$url = $this->event->getTitle()->getLocalURL( $params );
|
|
|
|
return [
|
|
'url' => $url,
|
|
'label' => $this->msg( 'notification-link-thank-you-edit', $this->getViewingUserForGender() )->text()
|
|
];
|
|
}
|
|
}
|