From: Kunal Mehta Date: Sat, 21 Dec 2013 07:50:57 +0000 (-0800) Subject: Make SpecialContributionsBeforeMainOutput hook more useful X-Git-Tag: 1.31.0-rc.0~17549^2 X-Git-Url: http://git.cyclocoop.org//%22%22._DIR_PLUGIN_FULLCALENDAR.%22prive/themes/spip/images/event_edit.png/%22?a=commitdiff_plain;h=55869c8871c9a7e27d662ce6941a57bdac7b2334;p=lhc%2Fweb%2Fwiklou.git Make SpecialContributionsBeforeMainOutput hook more useful The current id number is useless for IP addresses, so it now passes a proper User object. For context, the SpecialPage instance is also provided. Change-Id: Ie196611d504b3969bcdfb5c589716af2f3c54e14 --- diff --git a/docs/hooks.txt b/docs/hooks.txt index 53382f4d67..ebc412b655 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -2208,7 +2208,9 @@ $sp: SpecialPage object, for context &$fields: Current HTMLForm fields 'SpecialContributionsBeforeMainOutput': Before the form on Special:Contributions -$id: User identifier +$id: User id number, only provided for backwards-compatability +$user: User object representing user contributions are being fetched for +$sp: SpecialPage instance, providing context 'SpecialListusersDefaultQuery': Called right before the end of UsersPager::getDefaultQuery(). diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index af6a35bc19..551b9727e8 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -168,7 +168,7 @@ class SpecialContributions extends SpecialPage { // Add RSS/atom links $this->addFeedLinks( array( 'action' => 'feedcontributions', 'user' => $target ) ); - if ( wfRunHooks( 'SpecialContributionsBeforeMainOutput', array( $id ) ) ) { + if ( wfRunHooks( 'SpecialContributionsBeforeMainOutput', array( $id, $userObj, $this ) ) ) { $out->addHTML( $this->getForm() ); $pager = new ContribsPager( $this->getContext(), array(