root / drupal7 / sites / all / themes / bootstrap / templates / webform / webform-element.func.php @ 1f623f01
1 |
<?php
|
---|---|
2 |
/**
|
3 |
* @file
|
4 |
* Stub file for bootstrap_webform_element().
|
5 |
*/
|
6 |
|
7 |
/**
|
8 |
* Returns HTML for a webform element.
|
9 |
*
|
10 |
* @see theme_webform_element()
|
11 |
* @see bootstrap_form_element()
|
12 |
*/
|
13 |
function bootstrap_webform_element(&$variables) { |
14 |
$element = &$variables['element']; |
15 |
|
16 |
// Inline title.
|
17 |
if (isset($element['#title_display']) && $element['#title_display'] === 'inline') { |
18 |
$element['#title_display'] = 'before'; |
19 |
$element['#wrapper_attributes']['class'][] = 'form-inline'; |
20 |
} |
21 |
|
22 |
// Description above field.
|
23 |
if (!empty($element['#webform_component']['extra']['description_above'])) { |
24 |
$element['#description_display'] = 'before'; |
25 |
} |
26 |
|
27 |
// If field prefix or suffix is present, make this an input group.
|
28 |
if (!empty($element['#field_prefix']) || !empty($element['#field_suffix'])) { |
29 |
$element['#input_group'] = TRUE; |
30 |
} |
31 |
|
32 |
// Render as a normal "form_element" theme hook.
|
33 |
return theme('form_element', $variables); |
34 |
} |