2009-01-23 19:23:19 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class AbuseFilterViewTools extends AbuseFilterView {
|
2009-10-07 13:57:06 +00:00
|
|
|
function show() {
|
2011-11-16 05:34:24 +00:00
|
|
|
$out = $this->getOutput();
|
|
|
|
$user = $this->getUser();
|
2009-01-23 19:23:19 +00:00
|
|
|
|
|
|
|
// Header
|
2011-11-16 05:34:24 +00:00
|
|
|
$out->addWikiMsg( 'abusefilter-tools-text' );
|
2009-01-23 19:23:19 +00:00
|
|
|
|
|
|
|
// Expression evaluator
|
|
|
|
$eval = '';
|
2009-01-23 22:49:13 +00:00
|
|
|
$eval .= AbuseFilter::buildEditBox( '', 'wpTestExpr' );
|
2009-10-07 13:57:06 +00:00
|
|
|
|
2009-04-01 04:34:21 +00:00
|
|
|
// Only let users with permission actually test it
|
2011-11-16 05:34:24 +00:00
|
|
|
if ( $user->isAllowed( 'abusefilter-modify' ) ) {
|
2009-10-07 13:57:06 +00:00
|
|
|
$eval .= Xml::tags( 'p', null,
|
|
|
|
Xml::element( 'input',
|
|
|
|
array(
|
|
|
|
'type' => 'button',
|
|
|
|
'id' => 'mw-abusefilter-submitexpr',
|
2012-09-02 11:07:02 +00:00
|
|
|
'value' => $this->msg( 'abusefilter-tools-submitexpr' )->text() )
|
2009-10-07 13:57:06 +00:00
|
|
|
)
|
2009-04-01 04:34:21 +00:00
|
|
|
);
|
|
|
|
$eval .= Xml::element( 'p', array( 'id' => 'mw-abusefilter-expr-result' ), ' ' );
|
|
|
|
}
|
2012-09-02 11:07:02 +00:00
|
|
|
$eval = Xml::fieldset( $this->msg( 'abusefilter-tools-expr' )->text(), $eval );
|
2011-11-16 05:34:24 +00:00
|
|
|
$out->addHTML( $eval );
|
2009-01-23 19:23:19 +00:00
|
|
|
|
2011-11-16 05:34:24 +00:00
|
|
|
$out->addModules( 'ext.abuseFilter.tools' );
|
2009-01-23 19:23:19 +00:00
|
|
|
|
2011-11-16 05:34:24 +00:00
|
|
|
if ( $user->isAllowed( 'abusefilter-modify' ) ) {
|
2009-01-23 19:23:19 +00:00
|
|
|
// Hacky little box to re-enable autoconfirmed if it got disabled
|
|
|
|
$rac = '';
|
2009-10-07 13:57:06 +00:00
|
|
|
$rac .= Xml::inputLabel(
|
2012-09-02 11:07:02 +00:00
|
|
|
$this->msg( 'abusefilter-tools-reautoconfirm-user' )->text(),
|
2009-10-07 13:57:06 +00:00
|
|
|
'wpReAutoconfirmUser',
|
2009-02-07 09:34:11 +00:00
|
|
|
'reautoconfirm-user',
|
2009-10-07 13:57:06 +00:00
|
|
|
45
|
|
|
|
);
|
2010-05-30 17:33:59 +00:00
|
|
|
$rac .= ' ';
|
2009-10-07 13:57:06 +00:00
|
|
|
$rac .= Xml::element(
|
|
|
|
'input',
|
|
|
|
array(
|
|
|
|
'type' => 'button',
|
|
|
|
'id' => 'mw-abusefilter-reautoconfirmsubmit',
|
2012-09-02 11:07:02 +00:00
|
|
|
'value' => $this->msg( 'abusefilter-tools-reautoconfirm-submit' )->text()
|
2009-10-07 13:57:06 +00:00
|
|
|
)
|
2009-02-07 09:34:11 +00:00
|
|
|
);
|
2012-09-02 11:07:02 +00:00
|
|
|
$rac = Xml::fieldset( $this->msg( 'abusefilter-tools-reautoconfirm' )->text(), $rac );
|
2011-11-16 05:34:24 +00:00
|
|
|
$out->addHTML( $rac );
|
2009-01-23 19:23:19 +00:00
|
|
|
}
|
|
|
|
}
|
2009-02-07 09:34:11 +00:00
|
|
|
}
|