4 * Contains all functionality for theming webforms.
8 * Implements hook_webform_email().
10 * We override this function because the XHTML DOCTYPE doesn't
11 * allow <input type="email" />.
13 function rijkshuisstijl_webform_email($variables) {
14 $element = $variables['element'];
16 // This IF statement is mostly in place to allow our tests to set type="text"
17 // because SimpleTest does not support type="email".
18 if (!isset($element['#attributes']['type'])) {
19 $element['#attributes']['type'] = 'text';
22 // Convert properties to attributes on the element if set.
23 foreach (array('id', 'name', 'value', 'size') as
$property) {
24 if (isset($element['#' .
$property]) && $element['#' .
$property] !== '') {
25 $element['#attributes'][$property] = $element['#' .
$property];
28 _form_set_class($element, array('form-text', 'form-email'));
30 return '<input' .
drupal_attributes($element['#attributes']) .
' />';