X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fhtmlform%2FHTMLSelectField.php;h=b6ad46c5ae483e176a5f8f751474c2f9a272dee7;hp=6ba69666e2ab14515bd5170ba27330dd304c4e07;hb=03d1d295b99713bbe4657d26448bb7fc2b57d013;hpb=8a7e518da017e9345f86851e7c141276f5aa2693 diff --git a/includes/htmlform/HTMLSelectField.php b/includes/htmlform/HTMLSelectField.php index 6ba69666e2..b6ad46c5ae 100644 --- a/includes/htmlform/HTMLSelectField.php +++ b/includes/htmlform/HTMLSelectField.php @@ -27,7 +27,7 @@ class HTMLSelectField extends HTMLFormField { $select->setAttribute( 'disabled', 'disabled' ); } - $allowedParams = array( 'tabindex', 'size' ); + $allowedParams = [ 'tabindex', 'size' ]; $customParams = $this->getAttributes( $allowedParams ); foreach ( $customParams as $name => $value ) { $select->setAttribute( $name, $value ); @@ -44,23 +44,25 @@ class HTMLSelectField extends HTMLFormField { function getInputOOUI( $value ) { $disabled = false; - $allowedParams = array( 'tabindex' ); - $attribs = $this->getAttributes( $allowedParams, array( 'tabindex' => 'tabIndex' ) ); + $allowedParams = [ 'tabindex' ]; + $attribs = OOUI\Element::configFromHtmlAttributes( + $this->getAttributes( $allowedParams ) + ); if ( $this->mClass !== '' ) { - $attribs['classes'] = array( $this->mClass ); + $attribs['classes'] = [ $this->mClass ]; } if ( !empty( $this->mParams['disabled'] ) ) { $disabled = true; } - return new OOUI\DropdownInputWidget( array( + return new OOUI\DropdownInputWidget( [ 'name' => $this->mName, 'id' => $this->mID, 'options' => $this->getOptionsOOUI(), 'value' => strval( $value ), 'disabled' => $disabled, - ) + $attribs ); + ] + $attribs ); } }