X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fhtmlform%2FHTMLRadioField.php;h=19b45bea17af72e7573902da686262bc7a1d3126;hb=02f609e06889a172c64a863481cc5f692f86e64a;hp=8765407b05373ee91abe7ea27eaff10b67a04423;hpb=bc4147866e27965ca67bf88aac21c4ccfb061776;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/htmlform/HTMLRadioField.php b/includes/htmlform/HTMLRadioField.php index 8765407b05..19b45bea17 100644 --- a/includes/htmlform/HTMLRadioField.php +++ b/includes/htmlform/HTMLRadioField.php @@ -38,6 +38,23 @@ class HTMLRadioField extends HTMLFormField { return $html; } + function getInputOOUI( $value ) { + $options = array(); + foreach ( $this->getOptions() as $label => $value ) { + $options[] = array( + 'data' => $value, + 'label' => $this->mOptionsLabelsNotFromMessage ? new OOUI\HtmlSnippet( $label ) : $label, + ); + } + + return new OOUI\RadioSelectInputWidget( array( + 'name' => $this->mName, + 'value' => $value, + 'options' => $options, + 'classes' => 'mw-htmlform-flatlist-item', + ) + $this->getAttributes( array( 'disabled', 'tabindex' ), array( 'tabindex' => 'tabIndex' ) ) ); + } + function formatOptions( $options, $value ) { $html = ''; @@ -56,7 +73,7 @@ class HTMLRadioField extends HTMLFormField { $html .= ' ' . Html::rawElement( 'div', - array( 'class' => 'mw-htmlform-flatlist-item' ), + array( 'class' => 'mw-htmlform-flatlist-item mw-ui-radio' ), $radio ); }