function getInputHTML( $value ) {
$attribs = array(
'id' => $this->mID,
- 'name' => $this->mName,
'cols' => $this->getCols(),
'rows' => $this->getRows(),
) + $this->getTooltipAndAccessKey();
$attribs['class'] = $this->mClass;
}
- if ( !empty( $this->mParams['disabled'] ) ) {
- $attribs['disabled'] = 'disabled';
- }
+ $allowedParams = array(
+ 'placeholder',
+ 'tabindex',
+ 'disabled',
+ 'readonly',
+ 'required',
+ 'autofocus'
+ );
- if ( !empty( $this->mParams['readonly'] ) ) {
- $attribs['readonly'] = 'readonly';
- }
+ $attribs += $this->getAttributes( $allowedParams );
+ return Html::textarea( $this->mName, $value, $attribs );
+ }
- if ( isset( $this->mParams['placeholder'] ) ) {
- $attribs['placeholder'] = $this->mParams['placeholder'];
- }
+ function getInputOOUI( $value ) {
+ $attribs = $this->getTooltipAndAccessKey();
- foreach ( array( 'required', 'autofocus' ) as $param ) {
- if ( isset( $this->mParams[$param] ) ) {
- $attribs[$param] = '';
- }
+ if ( $this->mClass !== '' ) {
+ $attribs['classes'] = array( $this->mClass );
}
- return Html::element( 'textarea', $attribs, $value );
+ $allowedParams = array(
+ 'placeholder',
+ 'tabindex',
+ 'disabled',
+ 'readonly',
+ 'required',
+ 'autofocus',
+ );
+
+ $attribs += $this->getAttributes( $allowedParams, array(
+ 'tabindex' => 'tabIndex',
+ 'readonly' => 'readOnly',
+ ) );
+
+ return new OOUI\TextInputWidget( array(
+ 'id' => $this->mID,
+ 'name' => $this->mName,
+ 'multiline' => true,
+ 'value' => $value,
+ ) + $attribs );
}
}