Modified Special:Protectedpages and Special:Protectedtitles to subclass SpecialPage
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sun, 15 Aug 2010 16:57:07 +0000 (16:57 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sun, 15 Aug 2010 16:57:07 +0000 (16:57 +0000)
includes/AutoLoader.php
includes/SpecialPage.php
includes/specials/SpecialProtectedpages.php
includes/specials/SpecialProtectedtitles.php

index 6d70863..cc06c99 100644 (file)
@@ -609,6 +609,8 @@ $wgAutoloadLocalClasses = array(
        'SpecialMostlinkedtemplates' => 'includes/specials/SpecialMostlinkedtemplates.php',
        'SpecialPreferences' => 'includes/specials/SpecialPreferences.php',
        'SpecialPrefixindex' => 'includes/specials/SpecialPrefixindex.php',
+       'SpecialProtectedpages' => 'includes/specials/SpecialProtectedpages.php',
+       'SpecialProtectedtitles' => 'includes/specials/SpecialProtectedtitles.php',
        'SpecialRandomredirect' => 'includes/specials/SpecialRandomredirect.php',
        'SpecialRecentChanges' => 'includes/specials/SpecialRecentchanges.php',
        'SpecialRecentchangeslinked' => 'includes/specials/SpecialRecentchangeslinked.php',
index 81a9052..97b3c05 100644 (file)
@@ -92,8 +92,8 @@ class SpecialPage {
                'Lonelypages'               => array( 'SpecialPage', 'Lonelypages' ),
                'Fewestrevisions'           => array( 'SpecialPage', 'Fewestrevisions' ),
                'Withoutinterwiki'          => array( 'SpecialPage', 'Withoutinterwiki' ),
-               'Protectedpages'            => array( 'SpecialPage', 'Protectedpages' ),
-               'Protectedtitles'           => array( 'SpecialPage', 'Protectedtitles' ),
+               'Protectedpages'            => 'SpecialProtectedpages',
+               'Protectedtitles'           => 'SpecialProtectedtitles',
                'Shortpages'                => array( 'SpecialPage', 'Shortpages' ),
                'Uncategorizedcategories'   => array( 'SpecialPage', 'Uncategorizedcategories' ),
                'Uncategorizedimages'       => array( 'SpecialPage', 'Uncategorizedimages' ),
index 7c6999b..2b01412 100644 (file)
  *
  * @ingroup SpecialPage
  */
-class ProtectedPagesForm {
+class SpecialProtectedpages extends SpecialPage {
 
        protected $IdLevel = 'level';
        protected $IdType  = 'type';
 
-       public function showList( $msg = '' ) {
+       public function __construct() {
+               parent::__construct( 'Protectedpages' );
+       }
+
+       public function execute( $par ) {
                global $wgOut, $wgRequest;
 
-               if( $msg != "" ) {
-                       $wgOut->setSubtitle( $msg );
-               }
+               $this->setHeaders();
+               $this->outputHeader();
 
                // Purge expired entries on one in every 10 queries
                if( !mt_rand( 0, 10 ) ) {
@@ -352,11 +355,3 @@ class ProtectedPagesPager extends AlphabeticPager {
                return 'pr_id';
        }
 }
-
-/**
- * Constructor
- */
-function wfSpecialProtectedpages() {
-       $ppForm = new ProtectedPagesForm();
-       $ppForm->showList();
-}
index 2fab586..dde169d 100644 (file)
  *
  * @ingroup SpecialPage
  */
-class ProtectedTitlesForm {
+class SpecialProtectedtitles extends SpecialPage {
 
        protected $IdLevel = 'level';
        protected $IdType  = 'type';
 
-       function showList( $msg = '' ) {
+       public function __construct() {
+               parent::__construct( 'Protectedtitles' );
+       }
+
+       function execute( $par ) {
                global $wgOut, $wgRequest;
 
-               if ( $msg != "" ) {
-                       $wgOut->setSubtitle( $msg );
-               }
+               $this->setHeaders();
+               $this->outputHeader();
 
                // Purge expired entries on one in every 10 queries
                if ( !mt_rand( 0, 10 ) ) {