From 4d4f1f8bbc14fa4ade9ce4ee69e96b90d161caf2 Mon Sep 17 00:00:00 2001 From: amir Date: Wed, 8 Jun 2016 22:05:00 +0000 Subject: [PATCH] Add hook to modify Special:Contributions lines This gives finer-grained extensibility than the current ContributionsLineEnding hook. Bug: T122537 Change-Id: Ifca9f3f3b838a2915152f0200624ef40ee3f8a19 --- docs/hooks.txt | 6 ++++++ includes/specials/pagers/ContribsPager.php | 2 ++ 2 files changed, 8 insertions(+) diff --git a/docs/hooks.txt b/docs/hooks.txt index 5c69d2aac0..72b63d8fb7 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -2865,6 +2865,12 @@ $id: User id number, only provided for backwards-compatibility $user: User object representing user contributions are being fetched for $sp: SpecialPage instance, providing context +'SpecialContributions::formatRow::flags': Called before rendering a +Special:Contributions row. +$context: IContextSource object +$row: Revision information from the database +&$flags: List of flags on this row + 'SpecialContributions::getForm::filters': Called with a list of filters to render on Special:Contributions. $sp: SpecialContributions object, for context diff --git a/includes/specials/pagers/ContribsPager.php b/includes/specials/pagers/ContribsPager.php index 8620eb1b3d..f4f27487d4 100644 --- a/includes/specials/pagers/ContribsPager.php +++ b/includes/specials/pagers/ContribsPager.php @@ -478,6 +478,8 @@ class ContribsPager extends ReverseChronologicalPager { ); $classes = array_merge( $classes, $newClasses ); + Hooks::run( 'SpecialContributions::formatRow::flags', [ $this->getContext(), $row, &$flags ] ); + $templateParams = [ 'del' => $del, 'timestamp' => $d, -- 2.20.1