mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-12 08:49:28 +00:00
d9fc90c281
Make it non static, plus a couple of minor stylistic fixes to such method. Bug: T190180 Change-Id: I54dd1f785d33908a0481aa2db997aa085776fc2d
60 lines
1.5 KiB
PHP
60 lines
1.5 KiB
PHP
<?php
|
|
|
|
class AbuseFilterViewTools extends AbuseFilterView {
|
|
/**
|
|
* Shows the page
|
|
*/
|
|
public function show() {
|
|
$out = $this->getOutput();
|
|
$user = $this->getUser();
|
|
$request = $this->getRequest();
|
|
|
|
if ( !$user->isAllowed( 'abusefilter-modify' ) ) {
|
|
$out->addWikiMsg( 'abusefilter-mustbeeditor' );
|
|
return;
|
|
}
|
|
|
|
// Header
|
|
$out->addWikiMsg( 'abusefilter-tools-text' );
|
|
|
|
// Expression evaluator
|
|
$eval = '';
|
|
$eval .= $this->buildEditBox( $request->getText( 'wpTestExpr' ), 'wpTestExpr' );
|
|
|
|
$eval .= Xml::tags( 'p', null,
|
|
Xml::element( 'input',
|
|
[
|
|
'type' => 'button',
|
|
'id' => 'mw-abusefilter-submitexpr',
|
|
'value' => $this->msg( 'abusefilter-tools-submitexpr' )->text() ]
|
|
)
|
|
);
|
|
$eval .= Xml::element( 'p', [ 'id' => 'mw-abusefilter-expr-result' ], ' ' );
|
|
|
|
$eval = Xml::fieldset( $this->msg( 'abusefilter-tools-expr' )->text(), $eval );
|
|
$out->addHTML( $eval );
|
|
|
|
$out->addModules( 'ext.abuseFilter.tools' );
|
|
|
|
// Hacky little box to re-enable autoconfirmed if it got disabled
|
|
$rac = '';
|
|
$rac .= Xml::inputLabel(
|
|
$this->msg( 'abusefilter-tools-reautoconfirm-user' )->text(),
|
|
'wpReAutoconfirmUser',
|
|
'reautoconfirm-user',
|
|
45
|
|
);
|
|
$rac .= ' ';
|
|
$rac .= Xml::element(
|
|
'input',
|
|
[
|
|
'type' => 'button',
|
|
'id' => 'mw-abusefilter-reautoconfirmsubmit',
|
|
'value' => $this->msg( 'abusefilter-tools-reautoconfirm-submit' )->text()
|
|
]
|
|
);
|
|
$rac = Xml::fieldset( $this->msg( 'abusefilter-tools-reautoconfirm' )->text(), $rac );
|
|
$out->addHTML( $rac );
|
|
}
|
|
}
|