Skip to content
Snippets Groups Projects
Commit bda8b0fd authored by Steven Wittens's avatar Steven Wittens
Browse files

#40871: Allow class on checkboxes/radios group container.

parent f865087d
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -996,7 +996,11 @@ function theme_radio($element) { ...@@ -996,7 +996,11 @@ function theme_radio($element) {
* A themed HTML string representing the radio button set. * A themed HTML string representing the radio button set.
*/ */
function theme_radios($element) { function theme_radios($element) {
$element['#children'] = '<div class="form-radios">'. $element['#children'] .'</div>'; $class = 'form-radios';
if (isset($element['#attributes']['class'])) {
$class .= ' '. $element['#attributes']['class'];
}
$element['#children'] = '<div class="'. $class .'">'. $element['#children'] .'</div>';
if ($element['#title'] || $element['#description']) { if ($element['#title'] || $element['#description']) {
unset($element['#id']); unset($element['#id']);
return theme('form_element', $element, $element['#children']); return theme('form_element', $element, $element['#children']);
...@@ -1227,7 +1231,11 @@ function theme_checkbox($element) { ...@@ -1227,7 +1231,11 @@ function theme_checkbox($element) {
* A themed HTML string representing the checkbox set. * A themed HTML string representing the checkbox set.
*/ */
function theme_checkboxes($element) { function theme_checkboxes($element) {
$element['#children'] = '<div class="form-checkboxes">'. $element['#children'] .'</div>'; $class = 'form-checkboxes';
if (isset($element['#attributes']['class'])) {
$class .= ' '. $element['#attributes']['class'];
}
$element['#children'] = '<div class="'. $class .'">'. $element['#children'] .'</div>';
if ($element['#title'] || $element['#description']) { if ($element['#title'] || $element['#description']) {
unset($element['#id']); unset($element['#id']);
return theme('form_element', $element, $element['#children']); return theme('form_element', $element, $element['#children']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment