mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-24 06:03:49 +00:00
176227e721
* Replace deprecated methods. * Remove no longer needed function fnmatch(). * Remove superfluous newlines. * Remove unused and redundant local variables and globals. * Deglobalization. * Update documentation. * Fix incorrect return values or add FIXMEs when in doubt. * Escape output in a few places where needed. * Remove unneeded MEDIAWIKI constant checks. * Fix various JSHint/JSLint issues. Patch Set 11: Merged https://gerrit.wikimedia.org/r/24701 into this one per Siebrand's request Change-Id: I02ba4ce31b6aca5b7324114093f8ece143abc295
55 lines
1.5 KiB
PHP
55 lines
1.5 KiB
PHP
<?php
|
|
|
|
class AbuseFilterViewTools extends AbuseFilterView {
|
|
function show() {
|
|
$out = $this->getOutput();
|
|
$user = $this->getUser();
|
|
|
|
// Header
|
|
$out->addWikiMsg( 'abusefilter-tools-text' );
|
|
|
|
// Expression evaluator
|
|
$eval = '';
|
|
$eval .= AbuseFilter::buildEditBox( '', 'wpTestExpr' );
|
|
|
|
// Only let users with permission actually test it
|
|
if ( $user->isAllowed( 'abusefilter-modify' ) ) {
|
|
$eval .= Xml::tags( 'p', null,
|
|
Xml::element( 'input',
|
|
array(
|
|
'type' => 'button',
|
|
'id' => 'mw-abusefilter-submitexpr',
|
|
'value' => $this->msg( 'abusefilter-tools-submitexpr' )->text() )
|
|
)
|
|
);
|
|
$eval .= Xml::element( 'p', array( 'id' => 'mw-abusefilter-expr-result' ), ' ' );
|
|
}
|
|
$eval = Xml::fieldset( $this->msg( 'abusefilter-tools-expr' )->text(), $eval );
|
|
$out->addHTML( $eval );
|
|
|
|
$out->addModules( 'ext.abuseFilter.tools' );
|
|
|
|
if ( $user->isAllowed( 'abusefilter-modify' ) ) {
|
|
// 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',
|
|
array(
|
|
'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 );
|
|
}
|
|
}
|
|
}
|