Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 17 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
MentionStatusPresentationModel | |
0.00% |
0 / 17 |
|
0.00% |
0 / 2 |
12 | |
0.00% |
0 / 1 |
getPrimaryLink | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |||
getTopicOrPostUrl | |
0.00% |
0 / 13 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | namespace Flow\Notifications; |
4 | |
5 | use MediaWiki\Title\Title; |
6 | |
7 | class MentionStatusPresentationModel extends \EchoMentionStatusPresentationModel { |
8 | |
9 | /** @inheritDoc */ |
10 | public function getPrimaryLink() { |
11 | return array_merge( |
12 | parent::getPrimaryLink(), |
13 | [ 'url' => $this->getTopicOrPostUrl() ] |
14 | ); |
15 | } |
16 | |
17 | /** |
18 | * @return string |
19 | */ |
20 | private function getTopicOrPostUrl() { |
21 | $workflowId = $this->event->getExtraParam( 'topic-workflow' ); |
22 | $postId = $this->event->getExtraParam( 'post-id' ); |
23 | $fragment = ''; |
24 | $query = [ 'fromnotif' => 1 ]; |
25 | if ( $postId ) { |
26 | $fragment = 'flow-post-' . $postId->getAlphadecimal(); |
27 | $query[ 'topic_showPostId' ] = $postId->getAlphadecimal(); |
28 | } |
29 | $topicTitle = Title::makeTitleSafe( |
30 | NS_TOPIC, |
31 | $workflowId->getAlphadecimal(), |
32 | $fragment |
33 | ); |
34 | return $topicTitle->getFullURL( $query ); |
35 | } |
36 | } |