From d8be91e0998d87fac9ba80f60f6d4a369539ebfa Mon Sep 17 00:00:00 2001
From: Alex Skrypnyk <alex.designworks@gmail.com>
Date: Thu, 26 Jul 2012 16:11:03 +1000
Subject: [PATCH 2/2] Issue #1677468 by alex.designworks: Add classes to component wrapper

---
 webform.module |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/webform.module b/webform.module
index fd79f42..7f7dbd1 100644
--- a/webform.module
+++ b/webform.module
@@ -2894,16 +2894,18 @@ function theme_webform_element($variables) {
   // Convert the parents array into a string, excluding the "submitted" wrapper.
   $nested_level = $element['#parents'][0] == 'submitted' ? 1 : 0;
   $parents = str_replace('_', '-', implode('--', array_slice($element['#parents'], $nested_level)));
-
-  $wrapper_classes = array(
+  if (!isset($element['wrapper_classes'])){
+    $element['wrapper_classes'] = array();
+  }
+  $element['wrapper_classes'] += array(
    'form-item',
    'webform-component',
    'webform-component-' . $type,
   );
   if (isset($element['#title_display']) && strcmp($element['#title_display'], 'inline') === 0) {
-    $wrapper_classes[] = 'webform-container-inline';
+    $element['wrapper_classes'][] = 'webform-container-inline';
   }
-  $output = '<div class="' . implode(' ', $wrapper_classes) . '" id="webform-component-' . $parents . '">' . "\n";
+  $output = '<div class="' . implode(' ', $element['wrapper_classes']) . '" id="webform-component-' . $parents . '">' . "\n";
 
   // If #title is not set, we don't display any label or required marker.
   if (!isset($element['#title'])) {
@@ -3704,10 +3706,8 @@ function webform_date_format($size = 'medium') {
  * Return a date in the desired format taking into consideration user timezones.
  */
 function webform_strtodate($format, $string, $timezone_name = NULL) {
-  global $user;
-
   // Adjust the time based on the user or site timezone.
-  if (variable_get('configurable_timezones', 1) && $timezone_name == 'user' && $user->uid) {
+  if (variable_get('configurable_timezones', 1) && $timezone_name == 'user') {
     $timezone_name = isset($GLOBALS['user']->timezone) ? $GLOBALS['user']->timezone : 'UTC';
   }
   // If the timezone is still empty or not set, use the site timezone.
-- 
1.7.4.msysgit.0

