lbFactory = $lbFactory; $this->hideIDs = array_keys( $this->getRequest()->getArray( 'hideids', [] ) ); } /** * Shows the page */ public function show(): void { $output = $this->getOutput(); $output->enableOOUI(); if ( !$this->afPermManager->canHideAbuseLog( $this->getAuthority() ) ) { $output->addWikiMsg( 'abusefilter-log-hide-forbidden' ); return; } if ( !$this->hideIDs ) { $output->addWikiMsg( 'abusefilter-log-hide-no-selected' ); return; } // TODO DI $pager = new AbuseLogPager( $this->getContext(), MediaWikiServices::getInstance()->getLinkRenderer(), [ 'afl_id' => $this->hideIDs ], MediaWikiServices::getInstance()->getLinkBatchFactory(), MediaWikiServices::getInstance()->getPermissionManager(), $this->afPermManager, $this->basePageName, array_fill_keys( $this->hideIDs, $this->getRequest()->getVal( 'wpshoworhide' ) ) ); $pager->doQuery(); if ( $pager->getResult()->numRows() === 0 ) { $output->addWikiMsg( 'abusefilter-log-hide-no-selected' ); return; } $output->addModuleStyles( 'mediawiki.interface.helpers.styles' ); $output->wrapWikiMsg( "$1", [ 'abusefilter-log-hide-selected', $this->getLanguage()->formatNum( count( $this->hideIDs ) ) ] ); $output->addHTML( Xml::tags( 'ul', [ 'class' => 'plainlinks' ], $pager->getBody() ) ); $hideReasonsOther = $this->msg( 'revdelete-reasonotherlist' )->text(); $hideReasons = $this->msg( 'revdelete-reason-dropdown-suppress' )->inContentLanguage()->text(); $hideReasons = Html::listDropdownOptions( $hideReasons, [ 'other' => $hideReasonsOther ] ); $formInfo = [ 'showorhide' => [ 'type' => 'radio', 'label-message' => 'abusefilter-log-hide-set-visibility', 'options-messages' => [ 'abusefilter-log-hide-show' => 'show', 'abusefilter-log-hide-hide' => 'hide' ], 'default' => 'hide', 'flatlist' => true ], 'dropdownreason' => [ 'type' => 'select', 'options' => $hideReasons, 'label-message' => 'abusefilter-log-hide-reason' ], 'reason' => [ 'type' => 'text', 'label-message' => 'abusefilter-log-hide-reason-other', ], ]; $actionURL = $this->getTitle( 'hide' )->getLocalURL( [ 'hideids' => array_fill_keys( $this->hideIDs, 1 ) ] ); HTMLForm::factory( 'ooui', $formInfo, $this->getContext() ) ->setAction( $actionURL ) ->setWrapperLegend( $this->msg( 'abusefilter-log-hide-legend' )->text() ) ->setSubmitCallback( [ $this, 'saveHideForm' ] ) ->showAlways(); // Show suppress log for this entry. Hack: since every suppression is performed on a // totally different page (i.e. Special:AbuseLog/xxx), we use showLogExtract without // specifying a title and then adding it in conds. // This isn't shown if the request was posted because we update visibility in a DeferredUpdate, so it would // display outdated info that might confuse the user. // TODO Can we improve this somehow? if ( !$this->getRequest()->wasPosted() ) { $suppressLogPage = new LogPage( 'suppress' ); $output->addHTML( "