mediawiki-extensions-AbuseF.../includes/EditBox/PlainEditBoxBuilder.php
thiemowmde 71170d6db1 Fix typo "Builer" → "Builder"
This luckily doesn't appear anywhere else:
https://codesearch.wmcloud.org/search/?q=EditBoxBuiler

Change-Id: I8238015b10cc729a2df7b56be7e3eb5140f8a070
2023-11-16 20:00:41 +01:00

28 lines
642 B
PHP

<?php
namespace MediaWiki\Extension\AbuseFilter\EditBox;
use Xml;
/**
* Class responsible for building a plain text filter edit box
*/
class PlainEditBoxBuilder extends EditBoxBuilder {
/**
* @inheritDoc
*/
public function getEditBox( string $rules, bool $isUserAllowed, bool $externalForm ): string {
$rules = rtrim( $rules ) . "\n";
// Rules are in English
$editorAttribs = [ 'dir' => 'ltr' ];
if ( !$isUserAllowed ) {
$editorAttribs['readonly'] = 'readonly';
}
if ( $externalForm ) {
$editorAttribs['form'] = 'wpFilterForm';
}
return Xml::textarea( 'wpFilterRules', $rules, 40, 15, $editorAttribs );
}
}