Merge "Made LoadBalancer debug log entries use "localhost" placeholder"
[lhc/web/wiklou.git] / includes / htmlform / HTMLTextAreaField.php
index 89e7be2..22e96f6 100644 (file)
@@ -15,7 +15,6 @@ class HTMLTextAreaField extends HTMLFormField {
        function getInputHTML( $value ) {
                $attribs = array(
                                'id' => $this->mID,
-                               'name' => $this->mName,
                                'cols' => $this->getCols(),
                                'rows' => $this->getRows(),
                        ) + $this->getTooltipAndAccessKey();
@@ -24,24 +23,45 @@ class HTMLTextAreaField extends HTMLFormField {
                        $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 );
        }
 }