diff --git a/core/includes/form.inc b/core/includes/form.inc index 5d4a943..b5c6de3 100644 --- a/core/includes/form.inc +++ b/core/includes/form.inc @@ -1047,30 +1047,34 @@ function form_pre_render_radio($element) { } /** - * Returns HTML for a set of radio button form elements. + * Prepares variables for radios templates. * - * @param $variables + * Default template: radios.html.twig. + * + * @param array $variables * An associative array containing: * - element: An associative array containing the properties of the element. * Properties used: #title, #value, #options, #description, #required, * #attributes, #children. * - * @ingroup themeable */ -function theme_radios($variables) { +function template_preprocess_radios(&$variables) { $element = $variables['element']; - $attributes = array(); if (isset($element['#id'])) { - $attributes['id'] = $element['#id']; + $variables['attributes']['id'] = $element['#id']; } - $attributes['class'] = 'form-radios'; + $variables['attributes']['class'] = array(); + $variables['attributes']['class'][] = 'form-radios'; if (!empty($element['#attributes']['class'])) { - $attributes['class'] .= ' ' . implode(' ', $element['#attributes']['class']); + $variables['attributes']['class'] = array_merge($variables['attributes']['class'], $element['#attributes']['class']); } if (isset($element['#attributes']['title'])) { - $attributes['title'] = $element['#attributes']['title']; + $variables['attributes']['title'] = $element['#attributes']['title']; } - return '' . (!empty($element['#children']) ? $element['#children'] : '') . ''; + $variables['children'] = isset($element['#children']) ? $element['#children'] : ''; + + // Remove the disabled attibute on the wrapper. + unset($variables['attributes']['disabled']); } /** diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 144882b..1514073 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -2713,6 +2713,7 @@ function drupal_common_theme() { ), 'radios' => array( 'render element' => 'element', + 'template' => 'radios', ), 'date' => array( 'render element' => 'element',