From 66bf91c71e075c560968b894a2fa5527ce81bf47 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sun, 15 Aug 2010 16:57:07 +0000 Subject: [PATCH] Modified Special:Protectedpages and Special:Protectedtitles to subclass SpecialPage --- includes/AutoLoader.php | 2 ++ includes/SpecialPage.php | 4 ++-- includes/specials/SpecialProtectedpages.php | 21 ++++++++------------ includes/specials/SpecialProtectedtitles.php | 13 +++++++----- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php index 6d70863ecf..cc06c99c41 100644 --- a/includes/AutoLoader.php +++ b/includes/AutoLoader.php @@ -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', diff --git a/includes/SpecialPage.php b/includes/SpecialPage.php index 81a9052bd8..97b3c055c3 100644 --- a/includes/SpecialPage.php +++ b/includes/SpecialPage.php @@ -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' ), diff --git a/includes/specials/SpecialProtectedpages.php b/includes/specials/SpecialProtectedpages.php index 7c6999b080..2b01412128 100644 --- a/includes/specials/SpecialProtectedpages.php +++ b/includes/specials/SpecialProtectedpages.php @@ -26,17 +26,20 @@ * * @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(); -} diff --git a/includes/specials/SpecialProtectedtitles.php b/includes/specials/SpecialProtectedtitles.php index 2fab586ef2..dde169db43 100644 --- a/includes/specials/SpecialProtectedtitles.php +++ b/includes/specials/SpecialProtectedtitles.php @@ -26,17 +26,20 @@ * * @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 ) ) { -- 2.20.1