diff --git a/core/includes/form.inc b/core/includes/form.inc
index e5433f5..de96b83 100644
--- a/core/includes/form.inc
+++ b/core/includes/form.inc
@@ -2859,7 +2859,7 @@ function form_get_options($element, $key) {
* An associative array containing:
* - element: An associative array containing the properties of the element.
* Properties used: #attributes, #children, #collapsed, #description, #id,
- * #title, #value.
+ * #title,#title_display, #value.
*
* @ingroup themeable
*/
@@ -4707,14 +4707,32 @@ function theme_form_element($variables) {
if (!empty($element['#attributes']['disabled'])) {
$attributes['class'][] = 'form-disabled';
}
+ $prefix = isset($element['#field_prefix']) ? '' . $element['#field_prefix'] . ' ' : '';
+ $suffix = isset($element['#field_suffix']) ? ' ' . $element['#field_suffix'] . '' : '';
+
+ // Composite elements consist of more than one HTML form control. These must
+ // be grouped by a fieldset.
+ if (isset($element['#composite']) && $element['#composite'] === TRUE) {
+ $fieldset_variables = array('element' => array());
+ $fieldset_variables['element']['#children'] = $prefix . $element['#children'] . $suffix;
+ foreach (array('#attributes', '#description', '#id', '#title', '#title_display') as $property) {
+ if (empty($element[$property])) {
+ $fieldset_variables['element'][$property] = NULL;
+ }
+ else {
+ $fieldset_variables['element'][$property] = $element[$property];
+ }
+ }
+ unset($fieldset_variables['element']['#attributes']['disabled']);
+ $fieldset_variables['element']['#title'] .= !empty($element['#required']) ? ' ' . theme('form_required_marker', array('element' => $element)) : '';
+ return theme('fieldset', $fieldset_variables);
+ }
$output = '
' . "\n";
// If #title is not set, we don't display any label or required marker.
if (!isset($element['#title'])) {
$element['#title_display'] = 'none';
}
- $prefix = isset($element['#field_prefix']) ? '
' . $element['#field_prefix'] . ' ' : '';
- $suffix = isset($element['#field_suffix']) ? '
' . $element['#field_suffix'] . '' : '';
switch ($element['#title_display']) {
case 'before':
diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/FormTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/FormTest.php
index f402395..eca06a9 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Form/FormTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Form/FormTest.php
@@ -94,7 +94,7 @@ function testRequiredFields() {
$elements['file']['empty_values'] = $empty_strings;
// Regular expression to find the expected marker on required elements.
- $required_marker_preg = '@
\*@';
+ $required_marker_preg = '@<(label|legend).*\*.*\1>@';
// Go through all the elements and all the empty values for them.
foreach ($elements as $type => $data) {
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index 0d472e5..24b62b0 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -445,6 +445,7 @@ function system_element_info() {
'#theme_wrappers' => array('form_element'),
);
$types['radios'] = array(
+ '#composite' => TRUE,
'#input' => TRUE,
'#process' => array('form_process_radios'),
'#theme_wrappers' => array('radios'),
@@ -460,6 +461,7 @@ function system_element_info() {
'#title_display' => 'after',
);
$types['checkboxes'] = array(
+ '#composite' => TRUE,
'#input' => TRUE,
'#process' => array('form_process_checkboxes'),
'#pre_render' => array('form_pre_render_conditional_form_element'),
@@ -493,6 +495,7 @@ function system_element_info() {
'#process' => array('form_process_weight', 'ajax_process_form'),
);
$types['date'] = array(
+ '#composite' => TRUE,
'#input' => TRUE,
'#theme' => 'date',
'#theme_wrappers' => array('form_element'),
@@ -3008,6 +3011,8 @@ function _system_rebuild_theme_data() {
$defaults = array(
'engine' => 'phptemplate',
'regions' => array(
+ 'account' => 'Account links',
+ 'main_menu' => 'Main navigation',
'sidebar_first' => 'Left sidebar',
'sidebar_second' => 'Right sidebar',
'content' => 'Content',
diff --git a/core/modules/system/system.theme.css b/core/modules/system/system.theme.css
index a3c770a..0101fc5 100644
--- a/core/modules/system/system.theme.css
+++ b/core/modules/system/system.theme.css
@@ -7,7 +7,7 @@
* HTML elements.
*/
fieldset {
- border: 1px solid #ccc;
+ border: 0;
margin: 1em 0;
padding: 0.5em;
}
diff --git a/core/themes/seven/style.css b/core/themes/seven/style.css
index 52db095..ba9bffd 100644
--- a/core/themes/seven/style.css
+++ b/core/themes/seven/style.css
@@ -25,6 +25,8 @@ hr {
summary,
legend {
font-weight: bold;
+}
+summary {
text-transform: uppercase;
}
h1,