You are here

function theme_webform_email in Webform 6.3

Same name and namespace in other branches
  1. 7.4 components/email.inc \theme_webform_email()
  2. 7.3 components/email.inc \theme_webform_email()

Theme function to render a number component.

1 theme call to theme_webform_email()
webform_elements in ./webform.module
Implements hook_elements().

File

components/email.inc, line 165
Webform module email component.

Code

function theme_webform_email($element) {

  // This IF statement is mostly in place to allow our tests to set type="text"
  // because SimpleTest does not support type="number".
  if (!isset($element['#attributes']['type'])) {
    $element['#attributes']['type'] = 'email';
  }

  // Convert properties to attributes on the element if set.
  foreach (array(
    'id',
    'name',
    'value',
    'size',
  ) as $property) {
    if (isset($element['#' . $property]) && $element['#' . $property] !== '') {
      $element['#attributes'][$property] = $element['#' . $property];
    }
  }
  _form_set_class($element, array(
    'form-text',
    'form-email',
  ));
  $output = '<input' . drupal_attributes($element['#attributes']) . ' />';
  return theme('form_element', $element, $output);
}