X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Flogging%2FLogEventsList.php;h=1463499874c452c51223483aad666a59ab4e7e87;hp=43829109cb616f1c57d8cf17857a20ecf4d2797d;hb=c6d1ceb90a9684fa0da758d88ba1e994fad4cffc;hpb=ef1f66b2351ce726ba8da21c3c7db290c31e0b37 diff --git a/includes/logging/LogEventsList.php b/includes/logging/LogEventsList.php index 43829109cb..1463499874 100644 --- a/includes/logging/LogEventsList.php +++ b/includes/logging/LogEventsList.php @@ -2,7 +2,7 @@ /** * Contain classes to list log entries * - * Copyright © 2004 Brion Vibber , 2008 Aaron Schulz + * Copyright © 2004 Brion Vibber * https://www.mediawiki.org/ * * This program is free software; you can redistribute it and/or modify @@ -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"; } /**