Merge "WebInstallerOutput: Apply wfBCP47() to lang attribute"
[lhc/web/wiklou.git] / includes / htmlform / HTMLTextAreaField.php
index 89e7be2..21173d2 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,16 @@ class HTMLTextAreaField extends HTMLFormField {
                        $attribs['class'] = $this->mClass;
                }
 
-               if ( !empty( $this->mParams['disabled'] ) ) {
-                       $attribs['disabled'] = 'disabled';
-               }
-
-               if ( !empty( $this->mParams['readonly'] ) ) {
-                       $attribs['readonly'] = 'readonly';
-               }
-
-               if ( isset( $this->mParams['placeholder'] ) ) {
-                       $attribs['placeholder'] = $this->mParams['placeholder'];
-               }
-
-               foreach ( array( 'required', 'autofocus' ) as $param ) {
-                       if ( isset( $this->mParams[$param] ) ) {
-                               $attribs[$param] = '';
-                       }
-               }
-
-               return Html::element( 'textarea', $attribs, $value );
+               $allowedParams = array(
+                       'placeholder',
+                       'tabindex',
+                       'disabled',
+                       'readonly',
+                       'required',
+                       'autofocus'
+               );
+
+               $attribs += $this->getAttributes( $allowedParams );
+               return Html::textarea( $this->mName, $value, $attribs );
        }
 }