mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-12 00:38:23 +00:00
Merge "Allow preloading text areas using URL parameter"
This commit is contained in:
commit
0afe787935
|
@ -1,13 +1,27 @@
|
|||
<?php
|
||||
|
||||
class AbuseFilterChangesList extends OldChangesList {
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $testFilter;
|
||||
|
||||
public function __construct( Skin $skin, $testFilter ) {
|
||||
parent::__construct( $skin );
|
||||
$this->testFilter = $testFilter;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string &$s
|
||||
* @param RecentChange &$rc
|
||||
* @param array &$classes
|
||||
* @param string[] &$classes
|
||||
*/
|
||||
public function insertExtra( &$s, &$rc, &$classes ) {
|
||||
$examineParams = empty( $rc->examineParams ) ? [] : $rc->examineParams;
|
||||
$examineParams = [];
|
||||
if ( $this->testFilter ) {
|
||||
$examineParams['testfilter'] = $this->testFilter;
|
||||
}
|
||||
|
||||
$title = SpecialPage::getTitleFor( 'AbuseFilter', 'examine/' . $rc->mAttribs['rc_id'] );
|
||||
$examineLink = $this->linkRenderer->makeLink(
|
||||
|
|
|
@ -59,7 +59,7 @@ class AbuseFilterViewExamine extends AbuseFilterView {
|
|||
}
|
||||
|
||||
function showResults() {
|
||||
$changesList = new AbuseFilterChangesList( $this->getSkin() );
|
||||
$changesList = new AbuseFilterChangesList( $this->getSkin(), $this->mTestFilter );
|
||||
$output = $changesList->beginRecentChangesList();
|
||||
$this->mCounter = 1;
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ class AbuseFilterViewTestBatch extends AbuseFilterView {
|
|||
$conds[] = $this->buildTestConditions( $dbr );
|
||||
|
||||
// Get our ChangesList
|
||||
$changesList = new AbuseFilterChangesList( $this->getSkin() );
|
||||
$changesList = new AbuseFilterChangesList( $this->getSkin(), $this->mFilter );
|
||||
$output = $changesList->beginRecentChangesList();
|
||||
|
||||
$rcQuery = RecentChange::getQueryInfo();
|
||||
|
@ -143,7 +143,6 @@ class AbuseFilterViewTestBatch extends AbuseFilterView {
|
|||
if ( $result || $this->mShowNegative ) {
|
||||
// Stash result in RC item
|
||||
$rc = RecentChange::newFromRow( $row );
|
||||
$rc->examineParams['testfilter'] = $this->mFilter;
|
||||
$rc->filterResult = $result;
|
||||
$rc->counter = $counter++;
|
||||
$output .= $changesList->recentChangesLine( $rc, false );
|
||||
|
|
|
@ -4,6 +4,7 @@ class AbuseFilterViewTools extends AbuseFilterView {
|
|||
function show() {
|
||||
$out = $this->getOutput();
|
||||
$user = $this->getUser();
|
||||
$request = $this->getRequest();
|
||||
|
||||
if ( !$user->isAllowed( 'abusefilter-modify' ) ) {
|
||||
$out->addWikiMsg( 'abusefilter-mustbeeditor' );
|
||||
|
@ -15,7 +16,7 @@ class AbuseFilterViewTools extends AbuseFilterView {
|
|||
|
||||
// Expression evaluator
|
||||
$eval = '';
|
||||
$eval .= AbuseFilter::buildEditBox( '', 'wpTestExpr' );
|
||||
$eval .= AbuseFilter::buildEditBox( $request->getText( 'wpTestExpr' ), 'wpTestExpr' );
|
||||
|
||||
$eval .= Xml::tags( 'p', null,
|
||||
Xml::element( 'input',
|
||||
|
|
Loading…
Reference in a new issue