? fieldsets_legends_504962.patch ? tmp ? sites/all/modules/my_module ? sites/default/files ? sites/default/modules ? sites/default/settings.php ? sites/default/themes Index: includes/form.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/form.inc,v retrieving revision 1.466 diff -u -p -r1.466 form.inc --- includes/form.inc 3 Jun 2010 13:48:04 -0000 1.466 +++ includes/form.inc 4 Jun 2010 01:25:50 -0000 @@ -2099,7 +2099,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, #collapsible, - * #description, #id, #title, #value. + * #description, #id, #title, #value, #required. * * @ingroup themeable */ @@ -2108,8 +2108,10 @@ function theme_fieldset($variables) { $output = ''; if (!empty($element['#title'])) { + // If the fieldset is required, a required marker is appended to the legend. + $required = !empty($element['#required']) ? theme('form_required_marker', array('element' => $element)) : ''; // Always wrap fieldset legends in a SPAN for CSS positioning. - $output .= '' . $element['#title'] . ''; + $output .= '' . $element['#title'] . ' ' . $required . ''; } $output .= '
'; if (!empty($element['#description'])) { @@ -2160,16 +2162,19 @@ function theme_radio($variables) { * @ingroup themeable */ function theme_radios($variables) { - $element = $variables['element']; - $attributes = array(); + $element =& $variables['element']; if (!empty($element['#id'])) { - $attributes['id'] = $element['#id']; + $element['#attributes']['id'] = $element['#id']; } - $attributes['class'] = 'form-radios'; if (!empty($element['#attributes']['class'])) { - $attributes['class'] .= ' ' . implode(' ', $element['#attributes']['class']); + $element['#attributes']['class'] .= ' ' . implode(' ', 'form-radios'); + } + else { + $element['#attributes']['class'] = 'form-radios'; } - return '' . (!empty($element['#children']) ? $element['#children'] : '') . '
'; + // Theme_fieldset prints #value out under #children, so unsetting it. + unset($variables['element']['#value']); + return theme('fieldset', $variables); } /** @@ -2237,8 +2242,21 @@ function password_confirm_validate($elem * @ingroup themeable */ function theme_date($variables) { - $element = $variables['element']; - return '
' . drupal_render_children($element) . '
'; + $element =& $variables['element']; + if (!empty($element['#id'])) { + $element['#attributes']['id'] = $element['#id']; + } + if (!empty($element['#attributes']['class'])) { + $element['#attributes']['class'] .= ' ' . implode(' ', 'container-inline'); + } + else { + $element['#attributes']['class'] = 'container-inline'; + } + // theme_fieldset does not expect #children to be an array. + $element['#children'] = drupal_render_children($element); + // theme_fieldset prints #value out under #children, so unsetting it. + unset($variables['element']['#value']); + return theme('fieldset', $variables); } /** @@ -2268,12 +2286,15 @@ function form_process_date($element) { switch ($type) { case 'day': $options = drupal_map_assoc(range(1, 31)); + $current_type = t('Day'); break; case 'month': $options = drupal_map_assoc(range(1, 12), 'map_month'); + $current_type = t('Month'); break; case 'year': $options = drupal_map_assoc(range(1900, 2050)); + $current_type = t('Year'); break; } @@ -2282,6 +2303,7 @@ function form_process_date($element) { '#value' => $element['#value'][$type], '#attributes' => $element['#attributes'], '#options' => $options, + '#title' => $current_type, ); } @@ -2401,16 +2423,20 @@ function theme_checkbox($variables) { * @ingroup themeable */ function theme_checkboxes($variables) { - $element = $variables['element']; - $attributes = array(); + $element =& $variables['element']; + if (!empty($element['#id'])) { - $attributes['id'] = $element['#id']; + $element['#attributes']['id'] = $element['#id']; } - $attributes['class'] = 'form-checkboxes'; if (!empty($element['#attributes']['class'])) { - $attributes['class'] .= ' ' . implode(' ', $element['#attributes']['class']); + $element['#attributes']['class'] .= ' ' . implode(' ', 'form-checkboxes'); + } + else { + $element['#attributes']['class'] = 'form-checkboxes'; } - return '' . (!empty($element['#children']) ? $element['#children'] : '') . ''; + // theme_fieldset prints #value out under #children, so unsetting it. + unset($variables['element']['#value']); + return theme('fieldset', $variables); } /** @@ -2427,10 +2453,6 @@ function form_pre_render_conditional_for $element['#attributes']['title'] .= ' (' . $t('Required') . ')'; } } - - if (isset($element['#title']) || isset($element['#description'])) { - $element['#theme_wrappers'][] = 'form_element'; - } return $element; } Index: modules/system/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.module,v retrieving revision 1.933 diff -u -p -r1.933 system.module --- modules/system/system.module 20 May 2010 08:47:00 -0000 1.933 +++ modules/system/system.module 4 Jun 2010 01:25:53 -0000 @@ -415,7 +415,6 @@ function system_element_info() { '#element_validate' => array('date_validate'), '#process' => array('form_process_date'), '#theme' => 'date', - '#theme_wrappers' => array('form_element'), ); $types['file'] = array( '#input' => TRUE,