From 34b282564b534654ffd36a94fbc5607fd5225094 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Mon, 16 Jul 2007 11:21:21 +0000 Subject: [PATCH] Rename 'SpecialContribSubEnd' hook to more appropriate 'ContributionsToolLinks', pass user identifier as first parameter, correct misleading documentation ($nt is a Title, not a User), use standard language in release notes as for other hooks --- RELEASE-NOTES | 4 ++-- docs/hooks.txt | 11 +++++------ includes/SpecialContributions.php | 4 ++-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index cf22f4fd45..6ef808cd64 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -140,8 +140,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN $wgAjaxLicencePreview) * New Parser::setTransparentTagHook for parser extension and template compatibility -* Hook point 'SpecialContribsSubEnd' added to allow extensions to add to - the links displayed above Special:Contributions. +* Introduced 'ContributionsToolLinks' hook; see docs/hooks.txt for more + information == Bugfixes since 1.10 == diff --git a/docs/hooks.txt b/docs/hooks.txt index 63d6aafd4a..82fda74554 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -355,6 +355,11 @@ $user: the user who did the block (not the one being blocked) $isbn: ISBN to show information for $output: OutputPage object in use +'ContributionsToolLinks': Change tool links above Special:Contributions +$id: User identifier +$title: User page title +&$tools: Array of tool links + 'CustomEditor': When invoking the page editor $article: Article being edited $user: User performing the edit @@ -556,12 +561,6 @@ Alter the contents of $siteNotice to add to/alter the sitenotice/anonnotice. &$sktemplate: SkinTemplate object &$tpl: Template engine object -'SpecialContribsSubEnd': Right before the contribsub (the talk, log, etc. -links) are added above Special:Contributions. Return not evaluated, audit only. -$nt: The user whose contributions are being accessed. -&$tools: An array of links that will be added above Special:Contributions, -delimited by '|'. - 'SpecialContributionsBeforeMainOutput': Before the contributions form. Return not evaluated, audit only. $id: The id of the user whose contributions are being accessed. diff --git a/includes/SpecialContributions.php b/includes/SpecialContributions.php index 2e7890f047..d245144455 100644 --- a/includes/SpecialContributions.php +++ b/includes/SpecialContributions.php @@ -362,8 +362,8 @@ function contributionsSub( $nt, $id ) { # Other logs link $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ), wfMsgHtml( 'log' ), 'user=' . $nt->getPartialUrl() ); - # Let extensions add to this list as they need. - wfRunHooks( 'SpecialContribsSubEnd', array( $nt, &$tools ) ); + wfRunHooks( 'ContributionsToolLinks', array( $id, $nt, &$tools ) ); + $links = implode( ' | ', $tools ); } -- 2.20.1