Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 19 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
CodeStatusListView | |
0.00% |
0 / 19 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
execute | |
0.00% |
0 / 19 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | namespace MediaWiki\Extension\CodeReview\UI; |
4 | |
5 | use MediaWiki\Extension\CodeReview\Backend\CodeRevision; |
6 | use MediaWiki\MediaWikiServices; |
7 | use SpecialPage; |
8 | |
9 | /** |
10 | * Special:Code/MediaWiki/status |
11 | */ |
12 | class CodeStatusListView extends CodeView { |
13 | public function execute() { |
14 | global $wgOut; |
15 | |
16 | $name = $this->mRepo->getName(); |
17 | $states = CodeRevision::getPossibleStates(); |
18 | $wgOut->wrapWikiMsg( "== $1 ==", 'code-field-status' ); |
19 | |
20 | $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer(); |
21 | $tableRows = ''; |
22 | foreach ( $states as $state ) { |
23 | // Give grep a chance to find the usages: |
24 | // code-status-new, code-status-fixme, code-status-reverted, code-status-resolved, |
25 | // code-status-ok, code-status-deferred, code-status-old |
26 | $link = $linkRenderer->makeLink( |
27 | SpecialPage::getTitleFor( 'Code', $name . "/status/$state" ), |
28 | wfMessage( 'code-status-' . $state )->text() |
29 | ); |
30 | // Give grep a chance to find the usages: |
31 | // code-status-desc-new, code-status-desc-fixme, code-status-desc-reverted, |
32 | // code-status-desc-resolved, code-status-desc-ok, code-status-desc-deferred, |
33 | // code-status-desc-old |
34 | $tableRows .= "<tr><td class=\"mw-codereview-status-$state\">$link</td>" |
35 | . '<td>' . wfMessage( 'code-status-desc-' . $state )->escaped() . "</td></tr>\n"; |
36 | } |
37 | $wgOut->addHTML( '<table class="wikitable">' |
38 | . '<tr><th>' . wfMessage( 'code-field-status' )->escaped() . '</th>' |
39 | . '<th>' . wfMessage( 'code-field-status-description' )->escaped() . '</th></tr>' |
40 | . $tableRows |
41 | . '</table>' |
42 | ); |
43 | } |
44 | } |