2016-01-18 23:55:47 +00:00
|
|
|
<?php
|
|
|
|
|
2022-11-01 22:01:23 +00:00
|
|
|
namespace MediaWiki\Extension\Notifications\Formatters;
|
|
|
|
|
2016-01-18 23:55:47 +00:00
|
|
|
class EchoEditThresholdPresentationModel extends EchoEventPresentationModel {
|
|
|
|
|
|
|
|
public function getIconType() {
|
|
|
|
return 'edit';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getHeaderMessageKey() {
|
2023-11-02 19:02:16 +00:00
|
|
|
// 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
|
2016-01-18 23:55:47 +00:00
|
|
|
return 'notification-header-thank-you-' . $this->event->getExtraParam( 'editCount' ) . '-edit';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getPrimaryLink() {
|
2016-09-08 22:14:26 +00:00
|
|
|
if ( !$this->event->getTitle() ) {
|
|
|
|
return false;
|
|
|
|
}
|
2022-12-21 20:50:29 +00:00
|
|
|
|
|
|
|
if ( $this->event->getExtraParam( 'revid' ) ) {
|
|
|
|
$params = [
|
|
|
|
'oldid' => 'prev',
|
|
|
|
'diff' => $this->event->getExtraParam( 'revid' )
|
|
|
|
];
|
|
|
|
} else {
|
|
|
|
$params = [];
|
|
|
|
}
|
|
|
|
$url = $this->event->getTitle()->getLocalURL( $params );
|
|
|
|
|
2016-12-05 18:51:07 +00:00
|
|
|
return [
|
2022-12-21 20:50:29 +00:00
|
|
|
'url' => $url,
|
2016-01-18 23:55:47 +00:00
|
|
|
'label' => $this->msg( 'notification-link-thank-you-edit', $this->getViewingUserForGender() )->text()
|
2016-12-05 18:51:07 +00:00
|
|
|
];
|
2016-01-18 23:55:47 +00:00
|
|
|
}
|
|
|
|
}
|