Override Pager::getTitle() in core subclasses of ReverseChronologicalPager that don...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 6 Jul 2011 14:10:24 +0000 (14:10 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 6 Jul 2011 14:10:24 +0000 (14:10 +0000)
includes/HistoryPage.php
includes/LogEventsList.php
includes/specials/SpecialContributions.php
includes/specials/SpecialMergeHistory.php
includes/specials/SpecialNewimages.php

index 340c152..a5508ce 100644 (file)
@@ -326,6 +326,10 @@ class HistoryPager extends ReverseChronologicalPager {
                return $this->historyPage->getArticle();
        }
 
+       function getTitle() {
+               return $this->title;
+       }
+
        function getSqlComment() {
                if ( $this->conds ) {
                        return 'history page filtered'; // potentially slow, see CR r58153
@@ -339,7 +343,7 @@ class HistoryPager extends ReverseChronologicalPager {
                        'tables'  => array( 'revision' ),
                        'fields'  => Revision::selectFields(),
                        'conds'   => array_merge(
-                               array( 'rev_page' => $this->historyPage->getTitle()->getArticleID() ),
+                               array( 'rev_page' => $this->title->getArticleID() ),
                                $this->conds ),
                        'options' => array( 'USE INDEX' => array( 'revision' => 'page_timestamp' ) ),
                        'join_conds' => array( 'tag_summary' => array( 'LEFT JOIN', 'ts_rev_id=rev_id' ) ),
index 8dc7e45..0f57966 100644 (file)
@@ -170,7 +170,7 @@ class LogEventsList {
                        $query[$queryKey] = $hideVal;
 
                        $link = $this->skin->link(
-                               $this->out->getTitle(),
+                               $this->getDisplayTitle(),
                                $messages[$hideVal],
                                array(),
                                $query,
@@ -200,6 +200,16 @@ class LogEventsList {
                return $this->mDefaultQuery;
        }
 
+       /**
+        * Get the Title object of the page the links should point to.
+        * This is NOT the Title of the page the entries should be restricted to.
+        *
+        * @return Title object
+        */
+       public function getDisplayTitle() {
+               return $this->out->getTitle();
+       }
+
        /**
         * @param $queryTypes Array
         * @return String: Formatted HTML
@@ -801,6 +811,10 @@ class LogPager extends ReverseChronologicalPager {
                return $query;
        }
 
+       function getTitle() {
+               return $this->mLogEventsList->getDisplayTitle();
+       }
+
        // Call ONLY after calling $this->limitType() already!
        public function getFilterParams() {
                global $wgFilterLogTypes, $wgUser, $wgRequest;
index 6a0ff31..7c7089c 100644 (file)
@@ -476,6 +476,10 @@ class ContribsPager extends ReverseChronologicalPager {
                return $query;
        }
 
+       function getTitle() {
+               return SpecialPage::getTitleFor( 'Contributions' );
+       }
+
        function getQueryInfo() {
                global $wgUser, $wgMiserMode;
                list( $tables, $index, $userCond, $join_cond ) = $this->getUserCond();
index f9c4a2c..88e90ee 100644 (file)
@@ -481,6 +481,10 @@ class MergeHistoryPager extends ReverseChronologicalPager {
                parent::__construct();
        }
 
+       function getTitle() {
+               return SpecialPage::getTitleFor( 'Contributions' );
+       }
+
        function getStartBody() {
                wfProfileIn( __METHOD__ );
                # Do a link batch query
index 52dfef1..ea20c2f 100644 (file)
@@ -60,6 +60,10 @@ class NewFilesPager extends ReverseChronologicalPager {
                parent::__construct();
        }
 
+       function getTitle() {
+               return SpecialPage::getTitleFor( 'Newimages' );
+       }
+
        function getQueryInfo() {
                global $wgMiserMode;
                $conds = $jconds = array();