X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Flogging%2FLogEventsList.php;h=c5501cbf9bcbaba95e940435cee9d9f94e717a5a;hp=43829109cb616f1c57d8cf17857a20ecf4d2797d;hb=7f3d6713e7191c476adb3d3c30344a0327b853d3;hpb=d17eeb742a26c2567de96872c0419b39b97cde56 diff --git a/includes/logging/LogEventsList.php b/includes/logging/LogEventsList.php index 43829109cb..c5501cbf9b 100644 --- a/includes/logging/LogEventsList.php +++ b/includes/logging/LogEventsList.php @@ -24,6 +24,7 @@ */ use MediaWiki\MediaWikiServices; +use Wikimedia\Rdbms\IDatabase; class LogEventsList extends ContextSource { const NO_ACTION_LINK = 1; @@ -389,9 +390,18 @@ class LogEventsList extends ContextSource { [ 'mw-logline-' . $entry->getType() ], $newClasses ); + $attribs = [ + 'data-mw-logid' => $entry->getId(), + 'data-mw-logaction' => $entry->getFullType(), + ]; + $ret = "$del $time $action $comment $revert $tagDisplay"; + + // Let extensions add data + Hooks::run( 'LogEventsListLineEnding', [ $this, &$ret, $entry, &$classes, &$attribs ] ); + $attribs = wfArrayFilterByKey( $attribs, [ Sanitizer::class, 'isReservedDataAttribute' ] ); + $attribs['class'] = implode( ' ', $classes ); - return Html::rawElement( 'li', [ 'class' => $classes ], - "$del $time $action $comment $revert $tagDisplay" ) . "\n"; + return Html::rawElement( 'li', $attribs, $ret ) . "\n"; } /**