Debian Codegraph @

extensions/Echo/includes/Formatters/EchoEditThresholdPresentationModel.php

raw symbols SCIP
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 // The following messages are used here:
13 // * notification-header-thank-you-1-edit
14 // * notification-header-thank-you-10-edit
15 // * notification-header-thank-you-100-edit
16 // * notification-header-thank-you-1000-edit
17 // * notification-header-thank-you-10000-edit
18 // * notification-header-thank-you-100000-edit
19 // * notification-header-thank-you-1000000-edit
20 // * notification-header-thank-you-10000000-edit
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 }