Let EnhancedChangesListModifyLineData Hook change classes as well
authoramir <ladsgroup@gmail.com>
Mon, 28 Mar 2016 04:58:11 +0000 (09:28 +0430)
committerAmir Sarabadani <Ladsgroup@gmail.com>
Wed, 15 Jun 2016 09:39:27 +0000 (11:39 +0200)
Change-Id: I7c2ae57bd3b18c26b12dd36e331deb6af5fa36c2

docs/hooks.txt
includes/changes/EnhancedChangesList.php

index 5c69d2a..1d11893 100644 (file)
@@ -1350,6 +1350,7 @@ $changesList: EnhancedChangesList object
 &$data: An array with all the components that will be joined in order to create the line
 $block: An array of RecentChange objects in that block
 $rc: The RecentChange object for this line
+&$classes: An array of classes to change
 
 'EnhancedChangesListModifyBlockLineData': to alter data used to build
 a non-grouped recent change line in EnhancedChangesList.
index 099a295..4a0f566 100644 (file)
@@ -369,6 +369,7 @@ class EnhancedChangesList extends ChangesList {
                ) {
                        $lineParams['classes'] = [ 'mw-enhanced-watched' ];
                }
+
                $separator = ' <span class="mw-changeslist-separator">. .</span> ';
 
                $data['recentChangesFlags'] = [
@@ -442,7 +443,7 @@ class EnhancedChangesList extends ChangesList {
 
                // give the hook a chance to modify the data
                $success = Hooks::run( 'EnhancedChangesListModifyLineData',
-                       [ $this, &$data, $block, $rcObj ] );
+                       [ $this, &$data, $block, $rcObj, &$classes ] );
                if ( !$success ) {
                        // skip entry if hook aborted it
                        return [];