hideID = $this->getRequest()->getIntOrNull( 'id' ); } /** * Shows the page */ public function show() : void { $output = $this->getOutput(); $output->enableOOUI(); if ( !$this->afPermManager->canHideAbuseLog( $this->getUser() ) ) { $output->addWikiMsg( 'abusefilter-log-hide-forbidden' ); return; } $dbr = wfGetDB( DB_REPLICA ); $deleted = $dbr->selectField( 'abuse_filter_log', 'afl_deleted', [ 'afl_id' => $this->hideID ], __METHOD__ ); if ( $deleted === false ) { $output->addWikiMsg( 'abusefilter-log-nonexistent' ); return; } $hideReasonsOther = $this->msg( 'revdelete-reasonotherlist' )->text(); $hideReasons = $this->msg( 'revdelete-reason-dropdown-suppress' )->inContentLanguage()->text(); $hideReasons = Xml::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' => (int)$deleted === 0 ? 'show' : 'hide', 'flatlist' => true ], 'logid' => [ 'type' => 'info', 'default' => (string)$this->hideID, 'label-message' => 'abusefilter-log-hide-id', ], 'dropdownreason' => [ 'type' => 'select', 'options' => $hideReasons, 'label-message' => 'abusefilter-log-hide-reason' ], 'reason' => [ 'type' => 'text', 'label-message' => 'abusefilter-log-hide-reason-other', ], ]; HTMLForm::factory( 'ooui', $formInfo, $this->getContext() ) ->setAction( $this->getTitle( 'hide' )->getFullURL( [ 'id' => $this->hideID ] ) ) ->setWrapperLegend( $this->msg( 'abusefilter-log-hide-legend' )->text() ) ->addHiddenField( 'hide', $this->hideID ) ->setSubmitCallback( [ $this, 'saveHideForm' ] ) ->showAlways(); // Show suppress log for this entry $suppressLogPage = new LogPage( 'suppress' ); $output->addHTML( "