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() {
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|