mediawiki-extensions-AbuseF.../Views/AbuseFilterViewTools.php
Umherirrender 24e4e85603 Use short array syntax - Views / api
Done by phpcbf over composer fix

Change-Id: I83ab556c8400354ecd09f33e1eb28caa17aa803d
2017-06-15 14:40:55 +00:00

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',
[
'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' );
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 .= '&#160;';
$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 );
}
}
}