Index: webform.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/webform/webform.module,v
retrieving revision 1.224
diff -u -r1.224 webform.module
--- webform.module	23 Apr 2010 16:57:13 -0000	1.224
+++ webform.module	26 Apr 2010 01:27:25 -0000
@@ -2141,11 +2141,21 @@
   $element = $variables['element'];
   $value = $variables['element']['#children'];
 
+  // All elements using this for display only are given the "display" type.
+  if (isset($element['#format']) && $element['#format'] == 'html') {
+    $type = 'display';
+  }
+  else {
+    $type = (isset($element['#type']) && !in_array($element['#type'], array('markup', 'textfield'))) ? $element['#type'] : $element['#webform_component']['type'];
+  }
+  $parents = str_replace('_', '-', implode('-', array_slice($element['#parents'], 1)));
+
   $wrapper_classes = array(
    'form-item',
-   $element['#format'] == 'html' ? 'webform-display-item' : 'webform-item',
+   'webform-component',
+   'webform-component-' . $type,
   );
-  $output = '<div class="' . implode(' ', $wrapper_classes) . '" id="' . $element['#id'] . '-wrapper">' . "\n";
+  $output = '<div class="' . implode(' ', $wrapper_classes) . '" id="webform-component-' . $parents . '">' . "\n";
   $required = !empty($element['#required']) ? '<span class="form-required" title="' . t('This field is required.') . '">*</span>' : '';
 
   if (!empty($element['#title'])) {
Index: components/fieldset.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/webform/components/fieldset.inc,v
retrieving revision 1.15
diff -u -r1.15 fieldset.inc
--- components/fieldset.inc	21 Mar 2010 03:43:17 -0000	1.15
+++ components/fieldset.inc	26 Apr 2010 01:27:30 -0000
@@ -79,7 +79,7 @@
     $element = _webform_render_fieldset($component, $value);
   }
 
-  $element['#component'] = $component;
+  $element['#webform_component'] = $component;
   $element['#format'] = $format;
 
   return $element;
Index: components/textfield.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/webform/components/textfield.inc,v
retrieving revision 1.25
diff -u -r1.25 textfield.inc
--- components/textfield.inc	21 Mar 2010 03:38:25 -0000	1.25
+++ components/textfield.inc	26 Apr 2010 01:27:32 -0000
@@ -131,10 +131,8 @@
     '#field_suffix'  => empty($component['extra']['field_suffix']) ? NULL : check_plain($component['extra']['field_suffix']),
     '#description'   => $filter ? _webform_filter_descriptions($component['extra']['description']) : $component['extra']['description'],
     '#attributes'    => $component['extra']['attributes'],
-    '#prefix'        => '<div class="webform-component webform-component-' . $component['type'] . '" id="webform-component-' . $component['form_key'] . '">',
-    '#suffix'        => '</div>',
+    '#theme_wrappers' => array('webform_element'),
     '#webform_component' => $component,
-    '#element_validate' => array(),
   );
 
   if ($component['extra']['disabled']) {
@@ -172,7 +170,7 @@
     '#theme_wrappers' => $format == 'html' ? array('webform_element') : array('webform_element_text'),
     '#field_prefix' => $component['extra']['field_prefix'],
     '#field_suffix' => $component['extra']['field_suffix'],
-    '#component' => $component,
+    '#webform_component' => $component,
     '#format' => $format,
     '#value' => isset($value[0]) ? $value[0] : '',
   );
Index: components/time.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/webform/components/time.inc,v
retrieving revision 1.32
diff -u -r1.32 time.inc
--- components/time.inc	26 Mar 2010 00:09:08 -0000	1.32
+++ components/time.inc	26 Apr 2010 01:27:32 -0000
@@ -124,13 +124,11 @@
     '#required' => $component['mandatory'],
     '#weight' => $component['weight'],
     '#description' => _webform_filter_descriptions($component['extra']['description']),
-    '#prefix' => '<div class="webform-component webform-component-' . $component['type'] . '" id="webform-component-' . $component['form_key'] . '">',
-    '#suffix' => '</div>',
+    '#hourformat' => $component['extra']['hourformat'],
     '#theme' => 'webform_time',
+    '#theme_wrappers' => array('webform_element'),
     '#element_validate' => array('webform_validate_time'),
-    '#hourformat' => $component['extra']['hourformat'],
     '#webform_component' => $component,
-    '#theme_wrappers' => array('form_element'),
   );
 
   $element['hour'] = array(
@@ -234,7 +232,7 @@
     '#weight' => $component['weight'],
     '#theme' => 'webform_display_time',
     '#theme_wrappers' => $format == 'html' ? array('webform_element') : array('webform_element_text'),
-    '#component' => $component,
+    '#webform_component' => $component,
     '#format' => $format,
     '#hourformat' => $component['extra']['hourformat'],
     '#value' => $value,
Index: components/textarea.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/webform/components/textarea.inc,v
retrieving revision 1.24
diff -u -r1.24 textarea.inc
--- components/textarea.inc	21 Mar 2010 03:38:25 -0000	1.24
+++ components/textarea.inc	26 Apr 2010 01:27:31 -0000
@@ -108,8 +108,7 @@
     '#cols'          => !empty($component['extra']['cols']) ? $component['extra']['cols'] : 60,
     '#attributes'    => $component['extra']['attributes'],
     '#resizable'     => (bool) $component['extra']['resizable'], // MUST be FALSE to disable.
-    '#prefix'        => '<div class="webform-component webform-component-' . $component['type'] . '" id="webform-component-' . $component['form_key'] . '">',
-    '#suffix'        => '</div>',
+    '#theme_wrappers' => array('webform_element'),
   );
 
   if ($component['extra']['disabled']) {
@@ -132,7 +131,7 @@
     '#weight' => $component['weight'],
     '#theme' => 'webform_display_textarea',
     '#theme_wrappers' => $format == 'html' ? array('webform_element') : array('webform_element_text'),
-    '#component' => $component,
+    '#webform_component' => $component,
     '#format' => $format,
     '#value' => isset($value[0]) ? $value[0] : '',
   );
Index: components/date.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/webform/components/date.inc,v
retrieving revision 1.39
diff -u -r1.39 date.inc
--- components/date.inc	13 Apr 2010 21:38:26 -0000	1.39
+++ components/date.inc	26 Apr 2010 01:27:26 -0000
@@ -122,15 +122,14 @@
     '#weight' => $component['weight'],
     '#type' => 'date',
     '#description' => _webform_filter_descriptions($component['extra']['description']),
-    '#prefix' => '<div class="webform-component webform-component-' . $component['type'] . '" id="webform-component-' . $component['form_key'] . '">',
-    '#suffix' => '</div>',
     '#required' => $component['mandatory'],
     '#year_start' => $component['extra']['year_start'],
     '#year_end' => $component['extra']['year_end'],
-    '#webform_component' => $component,
     '#process' => array('webform_expand_date'),
     '#theme' => 'webform_date',
+    '#theme_wrappers' => array('webform_element'),
     '#element_validate' => array('webform_validate_date'),
+    '#webform_component' => $component,
   );
 
   if ($component['extra']['datepicker']) {
@@ -316,7 +315,7 @@
     '#weight' => $component['weight'],
     '#theme' => 'webform_display_date',
     '#theme_wrappers' => $format == 'html' ? array('webform_element') : array('webform_element_text'),
-    '#component' => $component,
+    '#webform_component' => $component,
     '#format' => $format,
     '#value' => $value,
   );
Index: components/email.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/webform/components/email.inc,v
retrieving revision 1.34
diff -u -r1.34 email.inc
--- components/email.inc	23 Apr 2010 15:46:24 -0000	1.34
+++ components/email.inc	26 Apr 2010 01:27:30 -0000
@@ -115,8 +115,7 @@
     '#weight'        => $component['weight'],
     '#description'   => _webform_filter_descriptions($component['extra']['description']),
     '#attributes'    => $component['extra']['attributes'],
-    '#prefix'        => '<div class="webform-component webform-component-' . $component['type'] . '" id="webform-component-' . $component['form_key'] . '">',
-    '#suffix'        => '</div>',
+    '#theme_wrappers' => array('webform_element'),
     '#element_validate'  => array('_webform_validate_email'),
     '#webform_component' => $component,
   );
@@ -176,7 +175,7 @@
     '#weight' => $component['weight'],
     '#theme' => 'webform_display_email',
     '#theme_wrappers' => $format == 'html' ? array('webform_element') : array('webform_element_text'),
-    '#component' => $component,
+    '#webform_component' => $component,
     '#format' => $format,
     '#value' => isset($value[0]) ? $value[0] : '',
   );
Index: components/hidden.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/webform/components/hidden.inc,v
retrieving revision 1.24
diff -u -r1.24 hidden.inc
--- components/hidden.inc	11 Mar 2010 01:40:11 -0000	1.24
+++ components/hidden.inc	26 Apr 2010 01:27:30 -0000
@@ -77,7 +77,7 @@
     '#value' => isset($value[0]) ? $value[0] : NULL,
     '#weight' => $component['weight'],
     '#theme' => 'webform_display_hidden',
-    '#component' => $component,
+    '#webform_component' => $component,
     '#format' => $format,
     '#theme' => 'webform_display_hidden',
     '#theme_wrappers' => $format == 'text' ? array('webform_element_text') : array('webform_element'),
Index: components/file.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/webform/components/file.inc,v
retrieving revision 1.21
diff -u -r1.21 file.inc
--- components/file.inc	21 Mar 2010 03:38:25 -0000	1.21
+++ components/file.inc	26 Apr 2010 01:27:30 -0000
@@ -295,14 +295,13 @@
       '_webform_validate_file',
       '_webform_required_file',  // Custom required routine.
     ),
+    '#weight' => $component['weight'],
+    '#theme' => 'webform_render_file',
+    '#theme_wrappers' => array('webform_element'),
     '#webform_component' => $component,
+    '#webform_required' => $component['mandatory'],
+    '#webform_form_key' => $form_key,
   );
-  $element['#webform_required'] = $component['mandatory'];
-  $element['#webform_form_key'] = $form_key;
-  $element['#weight'] = $component['weight'];
-  $element['#theme'] = 'webform_render_file';
-  $element['#prefix'] = '<div class="webform-component webform-component-' . $component['type'] . '" id="webform-component-' . $component['form_key'] . '">';
-  $element['#suffix'] = '</div>';
 
 
   // Change the 'width' option to the correct 'size' option.
@@ -486,7 +485,7 @@
      '#weight' => $component['weight'],
      '#theme' => 'webform_display_file',
      '#theme_wrappers' => $format == 'text' ? array('webform_element_text') : array('webform_element'),
-     '#component' => $component,
+     '#webform_component' => $component,
      '#format' => $format,
   );
 }
Index: components/pagebreak.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/webform/components/pagebreak.inc,v
retrieving revision 1.10
diff -u -r1.10 pagebreak.inc
--- components/pagebreak.inc	8 Mar 2010 01:04:42 -0000	1.10
+++ components/pagebreak.inc	26 Apr 2010 01:27:30 -0000
@@ -69,7 +69,7 @@
     '#theme' => 'webform_display_pagebreak',
     '#title' => $component['name'],
     '#weight' => $component['weight'],
-    '#component' => $component,
+    '#webform_component' => $component,
     '#format' => $format,
   );
   return $element;
Index: components/grid.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/webform/components/grid.inc,v
retrieving revision 1.21
diff -u -r1.21 grid.inc
--- components/grid.inc	29 Mar 2010 03:19:37 -0000	1.21
+++ components/grid.inc	26 Apr 2010 01:27:30 -0000
@@ -59,7 +59,7 @@
       '#title' => t('Options'),
       '#collapsible' => TRUE,
       '#description' => t('Options to select across the top. Usually these are ratings such as "poor" through "excellent" or "strongly disagree" through "strongly agree".'),
-      '#attributes' => array('class' => 'webform-options-element'),
+      '#attributes' => array('class' => array('webform-options-element')),
       '#element_validate' => array('_webform_edit_validate_options'),
     );
     $form['options']['options'] = array(
@@ -78,7 +78,7 @@
       '#title' => t('Questions'),
       '#collapsible' => TRUE,
       '#description' => t('Questions list down the side of the grid.'),
-      '#attributes' => array('class' => 'webform-options-element'),
+      '#attributes' => array('class' => array('webform-options-element')),
       '#element_validate' => array('_webform_edit_validate_options'),
     );
     $form['questions']['options'] = array(
@@ -142,10 +142,10 @@
     '#title' => $component['name'],
     '#required' => $component['mandatory'],
     '#weight' => $component['weight'],
-    '#theme' => 'webform_grid',
     '#description' => $filter ? _webform_filter_descriptions($component['extra']['description']) : $component['extra']['description'],
-    '#prefix' => '<div class="webform-component webform-component-' . $component['type'] . '" id="webform-component-' . $component['form_key'] . '">',
-    '#suffix' => '</div>',
+    '#theme' => 'webform_grid',
+    '#theme_wrappers' => array('webform_element'),
+    '#webform_component' => $component,
   );
 
   $questions = _webform_select_options_from_text($component['extra']['questions'], TRUE);
@@ -191,7 +191,7 @@
   $element = array(
     '#title' => $component['name'],
     '#weight' => $component['weight'],
-    '#component' => $component,
+    '#webform_component' => $component,
     '#format' => $format,
     '#questions' => $questions,
     '#options' => $options,
@@ -220,7 +220,7 @@
 function theme_webform_display_grid($variables) {
   $element = $variables['element'];
 
-  $component = $element['#component'];
+  $component = $element['#webform_component'];
   $format = $element['#format'];
 
   if ($format == 'html') {
Index: components/markup.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/webform/components/markup.inc,v
retrieving revision 1.18
diff -u -r1.18 markup.inc
--- components/markup.inc	3 Apr 2010 02:49:23 -0000	1.18
+++ components/markup.inc	26 Apr 2010 01:27:30 -0000
@@ -60,8 +60,8 @@
     '#weight' => $component['weight'],
     '#markup' => $filter ? _webform_filter_values(check_markup($component['value'], $component['extra']['format'], FALSE), NULL, NULL, NULL, FALSE) : $component['value'],
     '#input_format' => $component['extra']['format'],
-    '#prefix' => '<div class="webform-component webform-component-' . $component['type'] . '" id="webform-component-' . $component['form_key'] . '">',
-    '#suffix' => '</div>',
+    '#theme_wrappers' => array('webform_element'),
+    '#webform_component' => $component,
   );
 
   // TODO: Remove when #markup becomes available in D7.
Index: components/select.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/webform/components/select.inc,v
retrieving revision 1.53
diff -u -r1.53 select.inc
--- components/select.inc	23 Apr 2010 16:57:13 -0000	1.53
+++ components/select.inc	26 Apr 2010 01:27:31 -0000
@@ -265,6 +265,7 @@
     '#required'      => $component['mandatory'],
     '#weight'        => $component['weight'],
     '#description'   => $filter ? _webform_filter_descriptions($component['extra']['description']) : $component['extra']['description'],
+    '#theme_wrappers' => array('webform_element'),
   );
 
   // Convert the user-entered options list into an array.
@@ -355,9 +356,6 @@
     }
   }
 
-  $element['#prefix'] = '<div class="webform-component webform-component-' . $element['#type'] . '" id="webform-component-' . $component['form_key'] . '">';
-  $element['#suffix'] = '</div>';
-
   return $element;
 }
 
@@ -418,7 +416,7 @@
     '#weight' => $component['weight'],
     '#theme' => 'webform_display_select',
     '#theme_wrappers' => $format == 'html' ? array('webform_element') : array('webform_element_text'),
-    '#component' => $component,
+    '#webform_component' => $component,
     '#format' => $format,
     '#value' => $value,
   );
@@ -476,7 +474,7 @@
  */
 function theme_webform_display_select($variables) {
   $element = $variables['element'];
-  $component = $element['#component'];
+  $component = $element['#webform_component'];
 
   // Convert submitted 'safe' values to un-edited, original form.
   $options = _webform_select_options($component);
Index: css/webform-admin.css
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/webform/css/webform-admin.css,v
retrieving revision 1.2
diff -u -r1.2 webform-admin.css
--- css/webform-admin.css	10 Apr 2010 22:02:12 -0000	1.2
+++ css/webform-admin.css	26 Apr 2010 01:27:32 -0000
@@ -1,12 +1,5 @@
 /* $Id: webform-admin.css,v 1.2 2010/04/10 22:02:12 quicksketch Exp $ */
 
-.webform-display-item {
-  margin-top: 0.5em;
-  margin-bottom: 0.5em;
-}
-.webform-display-item label {
-  display: inline;
-}
 .webform-submission-navigation {
   text-align: right;
 }
