From: amir Date: Wed, 8 Jun 2016 22:05:00 +0000 (+0000) Subject: Add hook to modify Special:Contributions lines X-Git-Tag: 1.31.0-rc.0~6593^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/ajouter.php?a=commitdiff_plain;h=4d4f1f8bbc14fa4ade9ce4ee69e96b90d161caf2;p=lhc%2Fweb%2Fwiklou.git Add hook to modify Special:Contributions lines This gives finer-grained extensibility than the current ContributionsLineEnding hook. Bug: T122537 Change-Id: Ifca9f3f3b838a2915152f0200624ef40ee3f8a19 --- 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,