Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 21 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| LqtImportFormatter | |
0.00% |
0 / 21 |
|
0.00% |
0 / 2 |
30 | |
0.00% |
0 / 1 |
| getPreloadTitles | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
6 | |||
| getActionMessage | |
0.00% |
0 / 13 |
|
0.00% |
0 / 1 |
12 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace Flow\Log; |
| 4 | |
| 5 | use MediaWiki\Logging\LogFormatter; |
| 6 | use MediaWiki\Message\Message; |
| 7 | use MediaWiki\Title\Title; |
| 8 | |
| 9 | class LqtImportFormatter extends LogFormatter { |
| 10 | |
| 11 | public function getPreloadTitles() { |
| 12 | $titles = [ $this->entry->getTarget() ]; |
| 13 | $params = $this->entry->getParameters() + [ |
| 14 | 'topic' => '', |
| 15 | ]; |
| 16 | $topic = Title::newFromText( $params['topic'] ); |
| 17 | if ( $topic ) { |
| 18 | $titles[] = $topic; |
| 19 | } |
| 20 | |
| 21 | return $titles; |
| 22 | } |
| 23 | |
| 24 | /** |
| 25 | * Formats an activity log entry. |
| 26 | * |
| 27 | * @return string The log entry |
| 28 | */ |
| 29 | protected function getActionMessage() { |
| 30 | $board = $this->entry->getTarget(); |
| 31 | $params = $this->entry->getParameters() + [ |
| 32 | 'topic' => '', |
| 33 | 'lqt_subject' => '', |
| 34 | ]; |
| 35 | $topic = Title::newFromText( $params['topic'] ); |
| 36 | |
| 37 | $message = $this->msg( "logentry-import-lqt-to-flow-topic" ) |
| 38 | ->params( |
| 39 | $topic ? $topic->getPrefixedText() : '', |
| 40 | Message::plaintextParam( $params['lqt_subject'] ), |
| 41 | $board->getPrefixedText() |
| 42 | ); |
| 43 | |
| 44 | return $this->plaintext ? $message->text() : $message->parse(); |
| 45 | } |
| 46 | } |