Add hook to modify Special:Contributions lines
authoramir <Ladsgroup@gmail.com>
Wed, 8 Jun 2016 22:05:00 +0000 (22:05 +0000)
committerAmir Sarabadani <Ladsgroup@gmail.com>
Thu, 16 Jun 2016 10:47:38 +0000 (12:47 +0200)
This gives finer-grained extensibility than the current ContributionsLineEnding
hook.

Bug: T122537
Change-Id: Ifca9f3f3b838a2915152f0200624ef40ee3f8a19

docs/hooks.txt
includes/specials/pagers/ContribsPager.php

index 5c69d2a..72b63d8 100644 (file)
@@ -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
index 8620eb1..f4f2748 100644 (file)
@@ -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,