| 1 |
<?php |
| 2 |
|
| 3 |
namespace MediaWiki\Extension\Notifications\Formatters; |
| 4 |
|
| 5 |
class EchoEditThresholdPresentationModel extends EchoEventPresentationModel { |
| 6 |
|
| 7 |
public function getIconType() { |
| 8 |
return 'edit'; |
| 9 |
} |
| 10 |
|
| 11 |
public function getHeaderMessageKey() { |
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
return 'notification-header-thank-you-' . $this->event->getExtraParam( 'editCount' ) . '-edit'; |
| 22 |
} |
| 23 |
|
| 24 |
public function getPrimaryLink() { |
| 25 |
if ( !$this->event->getTitle() ) { |
| 26 |
return false; |
| 27 |
} |
| 28 |
|
| 29 |
if ( $this->event->getExtraParam( 'revid' ) ) { |
| 30 |
$params = [ |
| 31 |
'oldid' => 'prev', |
| 32 |
'diff' => $this->event->getExtraParam( 'revid' ) |
| 33 |
]; |
| 34 |
} else { |
| 35 |
$params = []; |
| 36 |
} |
| 37 |
$url = $this->event->getTitle()->getLocalURL( $params ); |
| 38 |
|
| 39 |
return [ |
| 40 |
'url' => $url, |
| 41 |
'label' => $this->msg( 'notification-link-thank-you-edit', $this->getViewingUserForGender() )->text() |
| 42 |
]; |
| 43 |
} |
| 44 |
} |