Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 9 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
SpecialNoticeTemplate | |
0.00% |
0 / 9 |
|
0.00% |
0 / 2 |
12 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
execute | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | class SpecialNoticeTemplate extends CentralNotice { |
4 | public function __construct() { |
5 | // Register special page |
6 | SpecialPage::__construct( 'NoticeTemplate' ); |
7 | } |
8 | |
9 | /** |
10 | * Handle different types of page requests |
11 | * @param string|null $sub |
12 | */ |
13 | public function execute( $sub ) { |
14 | if ( $sub == 'view' ) { |
15 | // Trying to view a banner -- so redirect to edit form |
16 | $banner = $this->getRequest()->getText( 'template' ); |
17 | $title = SpecialPage::getTitleFor( 'CentralNoticeBanners', "edit/$banner" ); |
18 | } else { |
19 | // don't know where they were trying to go, redirect them to the new list form |
20 | $title = SpecialPage::getTitleFor( 'CentralNoticeBanners' ); |
21 | } |
22 | $this->getOutput()->redirect( |
23 | $title->getFullUrlForRedirect(), |
24 | 301 |
25 | ); |
26 | } |
27 | } |