Merge "Allow preloading text areas using URL parameter"

This commit is contained in:
jenkins-bot 2018-03-05 16:08:56 +00:00 committed by Gerrit Code Review
commit 0afe787935
4 changed files with 20 additions and 6 deletions

View file

@ -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(

View file

@ -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;

View file

@ -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 );

View file

@ -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',