mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-12 08:49:28 +00:00
39 lines
1.5 KiB
PHP
39 lines
1.5 KiB
PHP
<?php
|
|
|
|
if (!defined( 'MEDIAWIKI' ))
|
|
die();
|
|
|
|
class AbuseFilterViewTools extends AbuseFilterView {
|
|
function show( ) {
|
|
global $wgRequest,$wgOut;
|
|
|
|
// Header
|
|
$wgOut->setSubTitle( wfMsg( 'abusefilter-tools-subtitle' ) );
|
|
$wgOut->addWikiMsg( 'abusefilter-tools-text' );
|
|
|
|
// Expression evaluator
|
|
$eval = '';
|
|
$eval .= AbuseFilter::buildEditBox( '', 'wpTestExpr' );
|
|
$eval .= Xml::tags( 'p', null, Xml::element( 'input', array( 'type' => 'button', 'id' => 'mw-abusefilter-submitexpr', 'onclick' => 'doExprSubmit();', 'value' => wfMsg( 'abusefilter-tools-submitexpr' ) ) ) );
|
|
$eval .= Xml::element( 'p', array( 'id' => 'mw-abusefilter-expr-result' ), ' ' );
|
|
$eval = Xml::fieldset( wfMsg( 'abusefilter-tools-expr' ), $eval );
|
|
$wgOut->addHTML( $eval );
|
|
|
|
// Associated script
|
|
$exprScript = file_get_contents( dirname( __FILE__ ) . '/tools.js' );
|
|
|
|
$wgOut->addInlineScript( $exprScript );
|
|
|
|
global $wgUser;
|
|
|
|
if ($wgUser->isAllowed( 'abusefilter-modify' )) {
|
|
// Hacky little box to re-enable autoconfirmed if it got disabled
|
|
$rac = '';
|
|
$rac .= Xml::inputLabel( wfMsg( 'abusefilter-tools-reautoconfirm-user' ), 'wpReAutoconfirmUser', 'reautoconfirm-user', 45 );
|
|
$rac .= ' ';
|
|
$rac .= Xml::element( 'input', array( 'type' => 'button', 'id' => 'mw-abusefilter-reautoconfirmsubmit', 'onclick' => 'doReautoSubmit();', 'value' => wfMsg( 'abusefilter-tools-reautoconfirm-submit' ) ) );
|
|
$rac = Xml::fieldset( wfMsg( 'abusefilter-tools-reautoconfirm' ), $rac );
|
|
$wgOut->addHTML( $rac );
|
|
}
|
|
}
|
|
} |