Returns HTML for a details form element and its children.
$variables: An associative array containing:
function theme_details($variables) {
$element = $variables['element'];
element_set_attributes($element, array(
'id',
));
_form_set_attributes($element, array(
'form-wrapper',
));
$output = '<details' . new Attribute($element['#attributes']) . '>';
if (!empty($element['#title'])) {
$output .= '<summary>' . $element['#title'] . '</summary>';
}
$output .= '<div class="details-wrapper">';
if (!empty($element['#description'])) {
$output .= '<div class="details-description">' . $element['#description'] . '</div>';
}
$output .= $element['#children'];
if (isset($element['#value'])) {
$output .= $element['#value'];
}
$output .= '</div>';
$output .= "</details>\n";
return $output;
}