From 9897c06a8ba3007631317f26f012b1bd0c52bdf0 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 17 Jul 2008 14:55:30 +0000 Subject: [PATCH] * Highlight flagged user contribs (bug 14814) * Necessary hooks added --- docs/hooks.txt | 10 ++++++++++ includes/specials/SpecialContributions.php | 9 +++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/docs/hooks.txt b/docs/hooks.txt index 2217a5ea58..10352322de 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -513,6 +513,11 @@ $catpage: CategoryPage instance $unpatrolled: Whether or not we are showing unpatrolled changes. $watched: Whether or not the change is watched by the user. +'ContribsPager::getQueryInfo': Before the contributions query is about to run +&$this: Pager object for contributions +&queryInfo: The query for the contribs Pager + + 'ContributionsToolLinks': Change tool links above Special:Contributions $id: User identifier $title: User page title @@ -1225,6 +1230,11 @@ string &$error: output: HTML error to show if upload canceled by returning false 'UploadComplete': Upon completion of a file upload $uploadForm: Upload form object. File can be accessed by $uploadForm->mLocalFile. +'ContributionsLineEnding': Called before a contributions HTML line is finished +$this: SpecialPage object for contributions +$ret: the HTML line +$row: the DB row for this line + 'UserArrayFromResult': called when creating an UserArray object from a database result &$userArray: set this to an object to override the default object returned $res: database result used to create the object diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index c9cbc180fa..4a131f15b8 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -43,7 +43,7 @@ class ContribsPager extends ReverseChronologicalPager { function getQueryInfo() { list( $index, $userCond ) = $this->getUserCond(); $conds = array_merge( array('page_id=rev_page'), $userCond, $this->getNamespaceCond() ); - return array( + $queryInfo = array( 'tables' => array( 'page', 'revision' ), 'fields' => array( 'page_namespace', 'page_title', 'page_is_new', 'page_latest', 'rev_id', 'rev_page', @@ -51,8 +51,10 @@ class ContribsPager extends ReverseChronologicalPager { 'rev_user_text', 'rev_parent_id', 'rev_deleted' ), 'conds' => $conds, - 'options' => array( 'USE INDEX' => $index ) + 'options' => array( 'USE INDEX' => array('revision' => $index) ) ); + wfRunHooks( 'ContribsPager::getQueryInfo', array( &$this, &$queryInfo ) ); + return $queryInfo; } function getUserCond() { @@ -209,6 +211,9 @@ class ContribsPager extends ReverseChronologicalPager { if( $rev->isDeleted( Revision::DELETED_TEXT ) ) { $ret .= ' ' . wfMsgHtml( 'deletedrev' ); } + // Let extensions add data + wfRunHooks( 'ContributionsLineEnding', array( &$this, &$ret, $row ) ); + $ret = "
  • $ret
  • \n"; wfProfileOut( __METHOD__ ); return $ret; -- 2.20.1