2 class HTMLTextAreaField
extends HTMLFormField
{
3 const DEFAULT_COLS
= 80;
4 const DEFAULT_ROWS
= 25;
7 return isset( $this->mParams
[ 'cols' ] ) ?
$this->mParams
[ 'cols' ] : static::DEFAULT_COLS
;
11 return isset( $this->mParams
[ 'rows' ] ) ?
$this->mParams
[ 'rows' ] : static::DEFAULT_ROWS
;
14 function getInputHTML( $value ) {
17 'name' => $this->mName
,
18 'cols' => $this->getCols(),
19 'rows' => $this->getRows(),
20 ) +
$this->getTooltipAndAccessKey();
22 if ( $this->mClass
!== '' ) {
23 $attribs[ 'class' ] = $this->mClass
;
26 if ( ! empty( $this->mParams
[ 'disabled' ] ) ) {
27 $attribs[ 'disabled' ] = 'disabled';
30 if ( ! empty( $this->mParams
[ 'readonly' ] ) ) {
31 $attribs[ 'readonly' ] = 'readonly';
34 if ( isset( $this->mParams
[ 'placeholder' ] ) ) {
35 $attribs[ 'placeholder' ] = $this->mParams
[ 'placeholder' ];
38 foreach ( array( 'required', 'autofocus' ) as $param ) {
39 if ( isset( $this->mParams
[ $param ] ) ) {
40 $attribs[ $param ] = '';
44 return Html
::element( 'textarea', $attribs, $value );