r113399 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113398‎ | r113399 | r113400 >
Date:20:38, 8 March 2012
Author:preilly
Status:ok (Comments)
Tags:
Comment:
move landing page to special page
Modified paths:
  • /trunk/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccess.body.php (modified) (history)
  • /trunk/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccess.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccess.php
@@ -33,6 +33,7 @@
3434 $autoloadClasses = array (
3535 'ZeroRatedMobileAccessTemplate' => 'ZeroRatedMobileAccessTemplate',
3636 'ExtZeroRatedMobileAccess' => 'ZeroRatedMobileAccess.body',
 37+ 'ZeroRatedMobileAccess' => 'ZeroRatedMobileAccess.body',
3738 );
3839
3940 foreach ( $autoloadClasses as $className => $classFilename ) {
@@ -42,3 +43,5 @@
4344 $wgEnableZeroRatedMobileAccessTesting = false;
4445
4546 $wgHooks['BeforePageDisplay'][] = 'ExtZeroRatedMobileAccess::onBeforePageDisplay';
 47+$wgSpecialPages['ZeroRatedMobileAccess'] = 'ZeroRatedMobileAccess';
 48+$wgSpecialPageGroups['ZeroRatedMobileAccess'] = 'other';
Index: trunk/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccess.body.php
@@ -1,5 +1,29 @@
22 <?php
33
 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+
428 class ExtZeroRatedMobileAccess {
529 const VERSION = '0.0.9';
630
@@ -128,7 +152,7 @@
129153 $output .= $banner;
130154 }
131155 }
132 - if ( $out->getPageTitle() === 'Special:ZeroRated' ) {
 156+ if ( $out->getTitle()->isSpecial( 'ZeroRatedMobileAccess' ) ) {
133157 $out->clearHTML();
134158 $out->setPageTitle( null );
135159 $output .= wfMsg( 'zero-rated-mobile-access-desc' );

Follow-up revisions

RevisionCommit summaryAuthorDate
r1134001.19wmf: MFT r113399preilly20:39, 8 March 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r113379render zero rated landing pagepreilly18:50, 8 March 2012

Comments

#Comment by Nikerabbit (talk | contribs)   07:02, 9 March 2012

Special page classes are usually prefixed with Special.

Status & tagging log