$input_id, 'tabindex' => $wgPageFormsTabIndex, ); $itemAttrs = array( 'class' => $itemClass, 'for' => $input_id); if ( array_key_exists( 'origName', $other_args ) ) { $radiobutton_attrs['origname'] = $other_args['origName']; } $isChecked = false; if ( $cur_value == $possible_value ) { $isChecked = true; // $radiobutton_attrs['checked'] = true; } if ( $is_disabled ) { $radiobutton_attrs['disabled'] = true; } if ( $possible_value === '' ) { // blank/"None" value $label = wfMessage( 'pf_formedit_none' )->text(); } elseif ( array_key_exists( 'value_labels', $other_args ) && is_array( $other_args['value_labels'] ) && array_key_exists( $possible_value, $other_args['value_labels'] ) ) { $label = htmlspecialchars( $other_args['value_labels'][$possible_value] ); } else { $label = $possible_value; } $text .= "\t" . Html::rawElement( 'label', $itemAttrs, // Using Xml::radio() here because Html::input() // unfortunately doesn't include the "value=" // attribute if the value is blank - which // somehow leads to the string "on" being passed // to the page. // Html::input( $input_name, $possible_value, 'radio', $radiobutton_attrs ) . " $label" ) . "\n"; Xml::radio( $input_name, $possible_value, $isChecked, $radiobutton_attrs ) . " $label" ) . "\n"; } $spanClass = 'radioButtonSpan'; if ( array_key_exists( 'class', $other_args ) ) { $spanClass .= ' ' . $other_args['class']; } if ( $is_mandatory ) { $spanClass .= ' mandatoryFieldSpan'; } $spanID = "span_$wgPageFormsFieldNum"; // Do the 'show on select' handling. if ( array_key_exists( 'show on select', $other_args ) ) { $spanClass .= ' pfShowIfChecked'; foreach ( $other_args['show on select'] as $div_id => $options ) { if ( array_key_exists( $spanID, $wgPageFormsShowOnSelect ) ) { $wgPageFormsShowOnSelect[$spanID][] = array( $options, $div_id ); } else { $wgPageFormsShowOnSelect[$spanID] = array( array( $options, $div_id ) ); } } } $spanAttrs = array( 'id' => $spanID, 'class' => $spanClass ); $text = Html::rawElement( 'span', $spanAttrs, $text ); return $text; } /** * Returns the HTML code to be included in the output page for this input. * @return string */ public function getHtmlText() { return self::getHTML( $this->mCurrentValue, $this->mInputName, $this->mIsMandatory, $this->mIsDisabled, $this->mOtherArgs ); } }