X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fhtmlform%2FHTMLRadioField.php;h=2d057042ef48c04bb3cfb11334186421d508a5e9;hb=ca5c234d189fbbf348e3e5a74d0070ac4ee1db4b;hp=8765407b05373ee91abe7ea27eaff10b67a04423;hpb=1a8daf2c07e31337d83ee39b42873373023c8d40;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/htmlform/HTMLRadioField.php b/includes/htmlform/HTMLRadioField.php index 8765407b05..2d057042ef 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 => $data ) { + $options[] = array( + 'data' => $data, + '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 ); }