Index: trunk/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccess.php |
— | — | @@ -33,6 +33,7 @@ |
34 | 34 | $autoloadClasses = array ( |
35 | 35 | 'ZeroRatedMobileAccessTemplate' => 'ZeroRatedMobileAccessTemplate', |
36 | 36 | 'ExtZeroRatedMobileAccess' => 'ZeroRatedMobileAccess.body', |
| 37 | + 'ZeroRatedMobileAccess' => 'ZeroRatedMobileAccess.body', |
37 | 38 | ); |
38 | 39 | |
39 | 40 | foreach ( $autoloadClasses as $className => $classFilename ) { |
— | — | @@ -42,3 +43,5 @@ |
43 | 44 | $wgEnableZeroRatedMobileAccessTesting = false; |
44 | 45 | |
45 | 46 | $wgHooks['BeforePageDisplay'][] = 'ExtZeroRatedMobileAccess::onBeforePageDisplay'; |
| 47 | +$wgSpecialPages['ZeroRatedMobileAccess'] = 'ZeroRatedMobileAccess'; |
| 48 | +$wgSpecialPageGroups['ZeroRatedMobileAccess'] = 'other'; |
Index: trunk/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccess.body.php |
— | — | @@ -1,5 +1,29 @@ |
2 | 2 | <?php |
3 | 3 | |
| 4 | +/** |
| 5 | + * Main class for ZeroRatedMobileAccess extension. |
| 6 | + * |
| 7 | + * @file |
| 8 | + * @ingroup Extensions |
| 9 | + */ |
| 10 | +class ZeroRatedMobileAccess extends SpecialPage { |
| 11 | + /** |
| 12 | + * Constructor — set up the ZeroRatedMobileAccess page |
| 13 | + */ |
| 14 | + public function __construct() { |
| 15 | + parent::__construct( 'ZeroRatedMobileAccess' ); |
| 16 | + } |
| 17 | + |
| 18 | + /** |
| 19 | + * Show the special page |
| 20 | + * |
| 21 | + * @param $par Mixed: parameter passed to the special page or null |
| 22 | + */ |
| 23 | + public function execute( $par ) { |
| 24 | + $this->setHeaders(); |
| 25 | + } |
| 26 | +} |
| 27 | + |
4 | 28 | class ExtZeroRatedMobileAccess { |
5 | 29 | const VERSION = '0.0.9'; |
6 | 30 | |
— | — | @@ -128,7 +152,7 @@ |
129 | 153 | $output .= $banner; |
130 | 154 | } |
131 | 155 | } |
132 | | - if ( $out->getPageTitle() === 'Special:ZeroRated' ) { |
| 156 | + if ( $out->getTitle()->isSpecial( 'ZeroRatedMobileAccess' ) ) { |
133 | 157 | $out->clearHTML(); |
134 | 158 | $out->setPageTitle( null ); |
135 | 159 | $output .= wfMsg( 'zero-rated-mobile-access-desc' ); |