X-Git-Url: https://git.cyclocoop.org/%242?a=blobdiff_plain;f=includes%2Fhtmlform%2Ffields%2FHTMLSelectOrOtherField.php;h=47c1f18faef3d0a547ea0fbc85027aa76943a1d3;hb=4d75fbf3571c765a3d84140cb77b45a86aab3184;hp=fb133f20e5d06e7c4f5d0441464197e4764511a6;hpb=236488d398046838059f758b0915341648b64c7b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/htmlform/fields/HTMLSelectOrOtherField.php b/includes/htmlform/fields/HTMLSelectOrOtherField.php index fb133f20e5..47c1f18fae 100644 --- a/includes/htmlform/fields/HTMLSelectOrOtherField.php +++ b/includes/htmlform/fields/HTMLSelectOrOtherField.php @@ -12,9 +12,7 @@ class HTMLSelectOrOtherField extends HTMLTextField { $this->getOptions(); if ( !in_array( 'other', $this->mOptions, true ) ) { $msg = - isset( $params['other'] ) - ? $params['other'] - : wfMessage( 'htmlform-selectorother-other' )->text(); + $params['other'] ?? wfMessage( 'htmlform-selectorother-other' )->text(); // Have 'other' always as first element $this->mOptions = [ $msg => 'other' ] + $this->mOptions; } @@ -127,8 +125,14 @@ class HTMLSelectOrOtherField extends HTMLTextField { $textAttribs['placeholder'] = $this->mPlaceholder; } + $disabled = false; + if ( isset( $this->mParams[ 'disabled' ] ) && $this->mParams[ 'disabled' ] ) { + $disabled = true; + } + return $this->getInputWidget( [ 'id' => $this->mID, + 'disabled' => $disabled, 'textinput' => $textAttribs, 'dropdowninput' => $dropdownAttribs, 'or' => true,