Merge "shell: annotate return types"
[lhc/web/wiklou.git] / includes / logging / LogEventsList.php
index f032efc..3fd52af 100644 (file)
@@ -130,10 +130,13 @@ class LogEventsList extends ContextSource {
                        !empty( $extraInputsDescriptor )
                ) {
                        $formDescriptor[ 'extra' ] = $extraInputsDescriptor;
-               } elseif ( is_string( $extraInputsDescriptor ) ) {
+               } elseif (
+                       is_string( $extraInputsDescriptor ) &&
+                       $extraInputsDescriptor !== ''
+               ) {
                        // We'll add this to the footer of the form later
                        $extraInputsString = $extraInputsDescriptor;
-                       wfDeprecated( 'Using $input in LogEventsListGetExtraInputs hook', '1.32' );
+                       wfDeprecated( '$input in LogEventsListGetExtraInputs hook', '1.32' );
                }
 
                // Title pattern, if allowed
@@ -145,7 +148,7 @@ class LogEventsList extends ContextSource {
                $formDescriptor['date'] = [
                        'type' => 'date',
                        'label-message' => 'date',
-                       'default' => sprintf( "%04d-%02d-%02d", $year, $month, $day ),
+                       'default' => $year && $month && $day ? sprintf( "%04d-%02d-%02d", $year, $month, $day ) : '',
                ];
 
                // Tag filter
@@ -171,7 +174,7 @@ class LogEventsList extends ContextSource {
 
                $context = new DerivativeContext( $this->getContext() );
                $context->setTitle( SpecialPage::getTitleFor( 'Log' ) ); // Remove subpage
-               $htmlForm = new HTMLForm( $formDescriptor, $context );
+               $htmlForm = HTMLForm::factory( 'ooui', $formDescriptor, $context );
                $htmlForm
                        ->setSubmitText( $this->msg( 'logeventslist-submit' )->text() )
                        ->setMethod( 'get' )
@@ -689,6 +692,8 @@ class LogEventsList extends ContextSource {
                        $s .= $loglist->beginLogEventsList() .
                                $logBody .
                                $loglist->endLogEventsList();
+                       // add styles for change tags
+                       $context->getOutput()->addModuleStyles( 'mediawiki.interface.helpers.styles' );
                } elseif ( $showIfEmpty ) {
                        $s = Html::rawElement( 'div', [ 'class' => 'mw-warning-logempty' ],
                                $context->msg( 'logempty' )->parse() );