? .buildpath ? .project ? .settings ? fieldsets_legends_504962-3.patch ? tmp ? sites/all/modules/my_module ? sites/all/themes/zen ? sites/all/themes/zensub ? 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.467 diff -u -p -r1.467 form.inc --- includes/form.inc 5 Jun 2010 13:18:09 -0000 1.467 +++ includes/form.inc 25 Jun 2010 01:55:39 -0000 @@ -2096,18 +2096,23 @@ 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 */ function theme_fieldset($variables) { $element = $variables['element']; + $prefix = isset($element['#field_prefix']) ? '' . $element['#field_prefix'] . ' ' : ''; + $suffix = isset($element['#field_suffix']) ? ' ' . $element['#field_suffix'] . '' : ''; $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 .= $prefix; $output .= '
'; if (!empty($element['#description'])) { $output .= '
' . $element['#description'] . '
'; @@ -2117,6 +2122,7 @@ function theme_fieldset($variables) { $output .= $element['#value']; } $output .= '
'; + $output .= $suffix; $output .= "\n"; return $output; } @@ -2157,16 +2163,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'); } - return '' . (!empty($element['#children']) ? $element['#children'] : '') . ''; + else { + $element['#attributes']['class'] = 'form-radios'; + } + // Theme_fieldset prints #value out under #children, so unsetting it. + unset($variables['element']['#value']); + return theme('fieldset', $variables); } /** @@ -2234,8 +2243,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(' ', 'form-date'); + } + else { + $element['#attributes']['class'] = 'form-date'; + } + $element['#children'] = '
' . drupal_render_children($element) + . '
'; + // theme_fieldset prints #value out under #children, so unsetting it. + unset($variables['element']['#value']); + return theme('fieldset', $variables); } /** @@ -2265,12 +2287,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; } @@ -2279,6 +2304,7 @@ function form_process_date($element) { '#value' => $element['#value'][$type], '#attributes' => $element['#attributes'], '#options' => $options, + '#title' => $current_type, ); } @@ -2398,16 +2424,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); } /** @@ -2424,10 +2454,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/simpletest/tests/form.test =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/form.test,v retrieving revision 1.52 diff -u -p -r1.52 form.test --- modules/simpletest/tests/form.test 5 Jun 2010 13:18:09 -0000 1.52 +++ modules/simpletest/tests/form.test 25 Jun 2010 01:55:42 -0000 @@ -63,7 +63,7 @@ class FormsTestCase extends DrupalWebTes $elements['file']['empty_values'] = $empty_strings; // Regular expression to find the expected marker on required elements. - $required_marker_preg = '@\*@'; + $required_marker_preg = '@<(label|legend).*\*.*@'; // Go through all the elements and all the empty values for them. foreach ($elements as $type => $data) { @@ -390,10 +390,10 @@ class FormsElementsLabelsTestCase extend $this->assertFalse(isset($elements[0]), t("No label tag when title set not to display.")); // Check #field_prefix and #field_suffix placement. - $elements = $this->xpath('//span[@class="field-prefix"]/following-sibling::div[@id="edit-form-radios-test"]'); + $elements = $this->xpath('//span[@class="field-prefix"]/following-sibling::div[@class="fieldset-wrapper"]'); $this->assertTrue(isset($elements[0]), t("Properly placed the #field_prefix element after the label and before the field.")); - $elements = $this->xpath('//span[@class="field-suffix"]/preceding-sibling::div[@id="edit-form-radios-test"]'); + $elements = $this->xpath('//span[@class="field-suffix"]/preceding-sibling::div[@class="fieldset-wrapper"]'); $this->assertTrue(isset($elements[0]), t("Properly places the #field_suffix element immediately after the form field.")); // Check #prefix and #suffix placement. 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 25 Jun 2010 01:55:47 -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, Index: themes/seven/style.css =================================================================== RCS file: /cvs/drupal/drupal/themes/seven/style.css,v retrieving revision 1.57 diff -u -p -r1.57 style.css --- themes/seven/style.css 5 May 2010 16:41:57 -0000 1.57 +++ themes/seven/style.css 25 Jun 2010 01:55:48 -0000 @@ -627,6 +627,18 @@ div.teaser-checkbox .form-item, .form-item label.option input { vertical-align: middle; } +.form-checkboxes, +.form-radios { + margin: 1em 0; + padding: 2.5em 0 0 0; + border: 1px solid #ccc; +} +.form-checkboxes, +.form-radios { + margin: 1em 0; + padding: 2.5em 0 0 0; + border: 1px solid #ccc; +} /* Filter */ .filter-wrapper { @@ -959,3 +971,8 @@ div.add-or-remove-shortcuts { #user-login-form .openid-links .user-link { margin-left: 1.5em; /* LTR */ } + +/* User permissions */ +#user-admin-permissions .form-checkboxes { + display: none; +} \ No newline at end of file Index: themes/seven/vertical-tabs.css =================================================================== RCS file: /cvs/drupal/drupal/themes/seven/vertical-tabs.css,v retrieving revision 1.5 diff -u -p -r1.5 vertical-tabs.css --- themes/seven/vertical-tabs.css 20 Mar 2010 14:45:05 -0000 1.5 +++ themes/seven/vertical-tabs.css 25 Jun 2010 01:55:48 -0000 @@ -67,3 +67,15 @@ div.vertical-tabs .vertical-tabs-panes { div.vertical-tabs .vertical-tabs-panes legend { display: none; } + +div.vertical-tabs .vertical-tabs-panes .form-checkboxes, +div.vertical-tabs .vertical-tabs-panes .form-radios { + padding: 2.5em 0 0 0; + border: 1px solid #ccc; +} + + +div.vertical-tabs .vertical-tabs-panes .form-checkboxes legend, +div.vertical-tabs .vertical-tabs-panes .form-radios legend { + display: inherit; +} \ No newline at end of file