X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fhtmlform%2FHTMLRadioField.php;h=2d057042ef48c04bb3cfb11334186421d508a5e9;hb=e5361a6a6d1c1786c8dc2e8e7e69fb1a1d7a310b;hp=8765407b05373ee91abe7ea27eaff10b67a04423;hpb=f0edb3e368a5fc69218d20f76f1538b68f37db42;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 ); }