Merge "LogPager: Add backwards-compatibility for hide_[type]_log URL params"
[lhc/web/wiklou.git] / includes / logging / LogEventsList.php
index 7462dbf..382e246 100644 (file)
@@ -170,7 +170,9 @@ class LogEventsList extends ContextSource {
                        $formDescriptor['subtype'] = $this->getActionSelectorDesc( $types, $action );
                }
 
-               $htmlForm = new HTMLForm( $formDescriptor, $this->getContext() );
+               $context = new DerivativeContext( $this->getContext() );
+               $context->setTitle( $title ); // Remove subpage
+               $htmlForm = new HTMLForm( $formDescriptor, $context );
                $htmlForm
                        ->setSubmitText( $this->msg( 'logeventslist-submit' )->text() )
                        ->setMethod( 'get' )
@@ -196,7 +198,12 @@ class LogEventsList extends ContextSource {
                $options = [];
                $default = [];
                foreach ( $filter as $type => $val ) {
-                       $options[ $this->msg( "logeventslist-{$type}-log" )->text() ] = $type;
+                       $message = $this->msg( "logeventslist-{$type}-log" );
+                       // FIXME: Remove this check once T199657 is fully resolved.
+                       if ( !$message->exists() ) {
+                               $message = $this->msg( "log-show-hide-{$type}" )->params( $this->msg( 'show' )->text() );
+                       }
+                       $options[ $message->text() ] = $type;
 
                        if ( $val === false ) {
                                $default[] = $type;
@@ -418,7 +425,10 @@ class LogEventsList extends ContextSource {
 
                // Let extensions add data
                Hooks::run( 'LogEventsListLineEnding', [ $this, &$ret, $entry, &$classes, &$attribs ] );
-               $attribs = wfArrayFilterByKey( $attribs, [ Sanitizer::class, 'isReservedDataAttribute' ] );
+               $attribs = array_filter( $attribs,
+                       [ Sanitizer::class, 'isReservedDataAttribute' ],
+                       ARRAY_FILTER_USE_KEY
+               );
                $attribs['class'] = implode( ' ', $classes );
 
                return Html::rawElement( 'li', $attribs, $ret ) . "\n";