You are here

function theme_webform_time in Webform 7.3

Same name and namespace in other branches
  1. 5.2 components/time.inc \theme_webform_time()
  2. 5 components/time.inc \theme_webform_time()
  3. 6.3 components/time.inc \theme_webform_time()
  4. 6.2 components/time.inc \theme_webform_time()
  5. 7.4 components/time.inc \theme_webform_time()

Theme a webform time element.

1 theme call to theme_webform_time()
_webform_render_time in components/time.inc
Implements _webform_render_component().

File

components/time.inc, line 237
Webform module time component.

Code

function theme_webform_time($variables) {
  $element = $variables['element'];
  $element['hour']['#attributes']['class'][] = 'hour';
  $element['minute']['#attributes']['class'][] = 'minute';

  // Add error classes to all items within the element.
  if (form_get_error($element)) {
    $element['hour']['#attributes']['class'][] = 'error';
    $element['minute']['#attributes']['class'][] = 'error';
  }
  $output = '<div class="webform-container-inline">' . drupal_render($element['hour']) . drupal_render($element['minute']) . drupal_render($element['ampm']) . '</div>';
  return $output;
}