X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Flogging%2FLogEventsList.php;h=43829109cb616f1c57d8cf17857a20ecf4d2797d;hb=5049af1048c77b1ea6ab3193688d23a48ddf8df0;hp=6665336aa77ab26ec23b76ca0fed827007d21d5f;hpb=9ac29c74edda2f457814a1ed634a19f9a44fd0a5;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/logging/LogEventsList.php b/includes/logging/LogEventsList.php index 6665336aa7..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"; } /** @@ -544,7 +554,8 @@ class LogEventsList extends ContextSource { * @param string $user The user who made the log entries * @param array $param Associative Array with the following additional options: * - lim Integer Limit of items to show, default is 50 - * - conds Array Extra conditions for the query (e.g. "log_action != 'revision'") + * - conds Array Extra conditions for the query + * (e.g. 'log_action != ' . $dbr->addQuotes( 'revision' )) * - showIfEmpty boolean Set to false if you don't want any output in case the loglist is empty * if set to true (default), "No matching items in log" is displayed if loglist is empty * - msgKey Array If you want a nice box with a message, set this to the key of the message.