Projet

Général

Profil

Paste
Télécharger (941 octets) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / themes / bootstrap / templates / webform / webform-element.func.php @ 0a17cb7f

1
<?php
2

    
3
/**
4
 * @file
5
 * Stub file for bootstrap_webform_element().
6
 */
7

    
8
/**
9
 * Returns HTML for a webform element.
10
 *
11
 * @see theme_webform_element()
12
 * @see bootstrap_form_element()
13
 */
14
function bootstrap_webform_element(&$variables) {
15
  $element = &$variables['element'];
16

    
17
  // Inline title.
18
  if (isset($element['#title_display']) && $element['#title_display'] === 'inline') {
19
    $element['#title_display'] = 'before';
20
    $element['#wrapper_attributes']['class'][] = 'form-inline';
21
  }
22

    
23
  // Description above field.
24
  if (!empty($element['#webform_component']['extra']['description_above'])) {
25
    $element['#description_display'] = 'before';
26
  }
27

    
28
  // If field prefix or suffix is present, make this an input group.
29
  if (!empty($element['#field_prefix']) || !empty($element['#field_suffix'])) {
30
    $element['#input_group'] = TRUE;
31
  }
32

    
33
  // Render as a normal "form_element" theme hook.
34
  return theme('form_element', $variables);
35
}