r71130 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71129‎ | r71130 | r71131 >
Date:16:57, 15 August 2010
Author:ialex
Status:ok
Tags:
Comment:
Modified Special:Protectedpages and Special:Protectedtitles to subclass SpecialPage
Modified paths:
  • /trunk/phase3/includes/AutoLoader.php (modified) (history)
  • /trunk/phase3/includes/SpecialPage.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialProtectedpages.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialProtectedtitles.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/AutoLoader.php
@@ -609,6 +609,8 @@
610610 'SpecialMostlinkedtemplates' => 'includes/specials/SpecialMostlinkedtemplates.php',
611611 'SpecialPreferences' => 'includes/specials/SpecialPreferences.php',
612612 'SpecialPrefixindex' => 'includes/specials/SpecialPrefixindex.php',
 613+ 'SpecialProtectedpages' => 'includes/specials/SpecialProtectedpages.php',
 614+ 'SpecialProtectedtitles' => 'includes/specials/SpecialProtectedtitles.php',
613615 'SpecialRandomredirect' => 'includes/specials/SpecialRandomredirect.php',
614616 'SpecialRecentChanges' => 'includes/specials/SpecialRecentchanges.php',
615617 'SpecialRecentchangeslinked' => 'includes/specials/SpecialRecentchangeslinked.php',
Index: trunk/phase3/includes/specials/SpecialProtectedtitles.php
@@ -26,17 +26,20 @@
2727 *
2828 * @ingroup SpecialPage
2929 */
30 -class ProtectedTitlesForm {
 30+class SpecialProtectedtitles extends SpecialPage {
3131
3232 protected $IdLevel = 'level';
3333 protected $IdType = 'type';
3434
35 - function showList( $msg = '' ) {
 35+ public function __construct() {
 36+ parent::__construct( 'Protectedtitles' );
 37+ }
 38+
 39+ function execute( $par ) {
3640 global $wgOut, $wgRequest;
3741
38 - if ( $msg != "" ) {
39 - $wgOut->setSubtitle( $msg );
40 - }
 42+ $this->setHeaders();
 43+ $this->outputHeader();
4144
4245 // Purge expired entries on one in every 10 queries
4346 if ( !mt_rand( 0, 10 ) ) {
Index: trunk/phase3/includes/specials/SpecialProtectedpages.php
@@ -26,17 +26,20 @@
2727 *
2828 * @ingroup SpecialPage
2929 */
30 -class ProtectedPagesForm {
 30+class SpecialProtectedpages extends SpecialPage {
3131
3232 protected $IdLevel = 'level';
3333 protected $IdType = 'type';
3434
35 - public function showList( $msg = '' ) {
 35+ public function __construct() {
 36+ parent::__construct( 'Protectedpages' );
 37+ }
 38+
 39+ public function execute( $par ) {
3640 global $wgOut, $wgRequest;
3741
38 - if( $msg != "" ) {
39 - $wgOut->setSubtitle( $msg );
40 - }
 42+ $this->setHeaders();
 43+ $this->outputHeader();
4144
4245 // Purge expired entries on one in every 10 queries
4346 if( !mt_rand( 0, 10 ) ) {
@@ -352,11 +355,3 @@
353356 return 'pr_id';
354357 }
355358 }
356 -
357 -/**
358 - * Constructor
359 - */
360 -function wfSpecialProtectedpages() {
361 - $ppForm = new ProtectedPagesForm();
362 - $ppForm->showList();
363 -}
Index: trunk/phase3/includes/SpecialPage.php
@@ -92,8 +92,8 @@
9393 'Lonelypages' => array( 'SpecialPage', 'Lonelypages' ),
9494 'Fewestrevisions' => array( 'SpecialPage', 'Fewestrevisions' ),
9595 'Withoutinterwiki' => array( 'SpecialPage', 'Withoutinterwiki' ),
96 - 'Protectedpages' => array( 'SpecialPage', 'Protectedpages' ),
97 - 'Protectedtitles' => array( 'SpecialPage', 'Protectedtitles' ),
 96+ 'Protectedpages' => 'SpecialProtectedpages',
 97+ 'Protectedtitles' => 'SpecialProtectedtitles',
9898 'Shortpages' => array( 'SpecialPage', 'Shortpages' ),
9999 'Uncategorizedcategories' => array( 'SpecialPage', 'Uncategorizedcategories' ),
100100 'Uncategorizedimages' => array( 'SpecialPage', 'Uncategorizedimages' ),

Follow-up revisions

RevisionCommit summaryAuthorDate
r71398wfSpecialProtectedtitles() is no longer used. Follow up r71130.platonides13:58, 21 August 2010

Status & tagging log