From: Alexandre Emsenhuber Date: Wed, 6 Jul 2011 14:10:24 +0000 (+0000) Subject: Override Pager::getTitle() in core subclasses of ReverseChronologicalPager that don... X-Git-Tag: 1.31.0-rc.0~29047 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=925a2201ff237523afaaea4ceb5c66c6d862e1fa;p=lhc%2Fweb%2Fwiklou.git Override Pager::getTitle() in core subclasses of ReverseChronologicalPager that don't have it --- diff --git a/includes/HistoryPage.php b/includes/HistoryPage.php index 340c1520dd..a5508ce63e 100644 --- a/includes/HistoryPage.php +++ b/includes/HistoryPage.php @@ -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' ) ), diff --git a/includes/LogEventsList.php b/includes/LogEventsList.php index 8dc7e45527..0f57966e19 100644 --- a/includes/LogEventsList.php +++ b/includes/LogEventsList.php @@ -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; diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index 6a0ff31b3f..7c7089ca06 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -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(); diff --git a/includes/specials/SpecialMergeHistory.php b/includes/specials/SpecialMergeHistory.php index f9c4a2c2a7..88e90ee5d7 100644 --- a/includes/specials/SpecialMergeHistory.php +++ b/includes/specials/SpecialMergeHistory.php @@ -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 diff --git a/includes/specials/SpecialNewimages.php b/includes/specials/SpecialNewimages.php index 52dfef1e2e..ea20c2f722 100644 --- a/includes/specials/SpecialNewimages.php +++ b/includes/specials/SpecialNewimages.php @@ -60,6 +60,10 @@ class NewFilesPager extends ReverseChronologicalPager { parent::__construct(); } + function getTitle() { + return SpecialPage::getTitleFor( 'Newimages' ); + } + function getQueryInfo() { global $wgMiserMode; $conds = $jconds = array();