Make SpecialWatchlist extend SpecialRecentChanges (temporarily)
authorBartosz Dziewoński <matma.rex@gmail.com>
Wed, 9 Oct 2013 20:07:14 +0000 (22:07 +0200)
committerOri.livneh <ori@wikimedia.org>
Fri, 20 Dec 2013 22:50:55 +0000 (22:50 +0000)
Later both will be made to inherit from a base class, but this
makes some things simpler for now.

* `class SpecialWatchlist extends SpecialRecentChanges { … }`
* Fixes to both classes to ensure nothing breaks
* Remove redundant SpecialWatchlist#getGroupName()

No functional changes yet; just the framework change. Refactoring
follows in subsequent commits, with a base class for both of
these being introduced in I5855074deed52fd7492f033c8a8fced8af647602.

Bug: 48641
Change-Id: I394ab71bae876684e8f78236843861c7dd2ae22d

includes/specials/SpecialRecentchanges.php
includes/specials/SpecialWatchlist.php

index f866158..81ef7ed 100644 (file)
@@ -26,7 +26,7 @@
  *
  * @ingroup SpecialPage
  */
-class SpecialRecentChanges extends IncludableSpecialPage {
+class SpecialRecentChanges extends SpecialPage {
        var $rcOptions, $rcSubpage;
        protected $customFilters;
 
@@ -38,8 +38,12 @@ class SpecialRecentChanges extends IncludableSpecialPage {
         */
        protected $feedFormat;
 
-       public function __construct( $name = 'Recentchanges' ) {
-               parent::__construct( $name );
+       public function __construct( $name = 'Recentchanges', $restriction = '' ) {
+               parent::__construct( $name, $restriction );
+       }
+
+       public function isIncludable() {
+               return true;
        }
 
        /**
index 4d86744..19d2540 100644 (file)
@@ -20,7 +20,7 @@
  * @file
  * @ingroup SpecialPage Watchlist
  */
-class SpecialWatchlist extends SpecialPage {
+class SpecialWatchlist extends SpecialRecentChanges {
        protected $customFilters;
 
        /**
@@ -30,6 +30,10 @@ class SpecialWatchlist extends SpecialPage {
                parent::__construct( $page, $restriction );
        }
 
+       public function isIncludable() {
+               return false;
+       }
+
        /**
         * Execute
         * @param $par Parameter passed to the page
@@ -502,8 +506,4 @@ class SpecialWatchlist extends SpecialPage {
 
                return floor( $count / 2 );
        }
-
-       protected function getGroupName() {
-               return 'changes';
-       }
 }