Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 6 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
| EditAction | |
0.00% |
0 / 6 |
|
0.00% |
0 / 3 |
20 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| show | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 | |||
| doesWrites | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace Flow\Actions; |
| 4 | |
| 5 | use MediaWiki\Context\IContextSource; |
| 6 | use MediaWiki\Page\Article; |
| 7 | use MediaWiki\Title\Title; |
| 8 | |
| 9 | class EditAction extends FlowAction { |
| 10 | |
| 11 | public function __construct( Article $article, IContextSource $context ) { |
| 12 | parent::__construct( $article, $context, 'edit' ); |
| 13 | } |
| 14 | |
| 15 | /** |
| 16 | * Flow doesn't support edit action, redirect to the title instead |
| 17 | */ |
| 18 | public function show() { |
| 19 | $title = $this->context->getTitle(); |
| 20 | |
| 21 | // There should always be a title since Flow page |
| 22 | // is detected by title or namespace, adding this |
| 23 | // to prevent some werid cases |
| 24 | if ( !$title ) { |
| 25 | $title = Title::newMainPage(); |
| 26 | } |
| 27 | |
| 28 | $this->context->getOutput()->redirect( $title->getFullURL() ); |
| 29 | } |
| 30 | |
| 31 | public function doesWrites() { |
| 32 | return false; |
| 33 | } |
| 34 | } |