Commit ce9dc746 authored by webchick's avatar webchick

Revert "Issue #2152221 by IshaDakota, joelpittet, InternetDevels, rteijeiro |...

Revert "Issue #2152221 by IshaDakota, joelpittet, InternetDevels, rteijeiro | Cottser: Convert theme_radios() to Twig."

Oops. Bad commit credit. Re-committing.

This reverts commit 3b8d35aa.
parent 3b8d35aa
......@@ -1116,30 +1116,30 @@ function form_pre_render_radio($element) {
}
/**
* Prepares variables for radios templates.
* Returns HTML for a set of radio button form elements.
*
* Default template: radios.html.twig.
*
* @param array $variables
* @param $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 template_preprocess_radios(&$variables) {
function theme_radios($variables) {
$element = $variables['element'];
$variables['attributes'] = array();
$attributes = array();
if (isset($element['#id'])) {
$variables['attributes']['id'] = $element['#id'];
$attributes['id'] = $element['#id'];
}
$variables['attributes']['class'][] = 'form-radios';
$attributes['class'] = 'form-radios';
if (!empty($element['#attributes']['class'])) {
$variables['attributes']['class'] = array_merge($variables['attributes']['class'], $element['#attributes']['class']);
$attributes['class'] .= ' ' . implode(' ', $element['#attributes']['class']);
}
if (isset($element['#attributes']['title'])) {
$variables['attributes']['title'] = $element['#attributes']['title'];
$attributes['title'] = $element['#attributes']['title'];
}
$variables['children'] = $element['#children'];
return '<div' . new Attribute($attributes) . '>' . (!empty($element['#children']) ? $element['#children'] : '') . '</div>';
}
/**
......
......@@ -2877,7 +2877,6 @@ function drupal_common_theme() {
),
'radios' => array(
'render element' => 'element',
'template' => 'radios',
),
'date' => array(
'render element' => 'element',
......
{#
/**
* @file
* Default theme implementation for a 'radios' #type form element.
*
* Available variables
* - attributes: A list of HTML attributes for the wrapper element.
* - children: The rendered radios.
*
* @see template_preprocess_radios()
*
* @ingroup themeable
*/
#}
<div{{ attributes }}>{{ children }}</div>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment