mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-24 07:54:13 +00:00
53c38fe3df
It would be nice for editors to be able to see the particular edit that was their 100th, 1000th, etc. This patch changes the link of the edit count thanks notification to the diff of the edit, rather than the page the edit was on. Note that this link will only work for newly created notfications. Past edit count notification database entries do not store what revision id the edit was on in the 'echo_events' table, so there is no way to link to them unless the table is updated. Bug: T326998 Change-Id: If81fd71ce6f99ad3883a3bfbfbd798270f762d37
36 lines
818 B
PHP
36 lines
818 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Extension\Notifications\Formatters;
|
|
|
|
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() {
|
|
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()
|
|
];
|
|
}
|
|
}
|