mediawiki-extensions-AbuseF.../includes/EditBox/EditBoxField.php
Daimona Eaytoy bf9142a644 Partial integration of EditBoxBuilder with HTMLForm
This patch adds a transparent HTMLForm field that can be used to insert
the edit box inside an HTMLForm, and updates /test and /tools to use
that. The field class, together with the other editbox-related classes,
is now in a dedicated namespace. A future TODO is making it a real
HTMLForm field.

Also improve a bit the form in /test: add section labels and
avoid reusing the same label message used on Special:AbuseFilter.

Bug: T261584
Change-Id: Ib74bb5fdba4f8476169b754030fce6d4f72ce65a
2021-02-01 16:23:42 +00:00

31 lines
649 B
PHP

<?php
namespace MediaWiki\Extension\AbuseFilter\EditBox;
use HTMLFormField;
/**
* This class is used to easily wrap a filter editor box inside an HTMLForm. For now it's just a transparent
* wrapper around the given HTML string. In the future, some of the actual logic might be moved here.
* @unstable
*/
class EditBoxField extends HTMLFormField {
/** @var string */
private $html;
/**
* @param array $params
*/
public function __construct( array $params ) {
parent::__construct( $params );
$this->html = $params['html'];
}
/**
* @inheritDoc
*/
public function getInputHTML( $value ) : string {
return $this->html;
}
}