You are here

function _range_field_widget_form_subelement_prefix_suffix in Range 7

Helper function. Adds prefix and suffix to a range field widget subelements.

Parameters

array $element: Range field widget definition array.

string $name: Form element machine name.

array $settings: Field instance settings.

1 call to _range_field_widget_form_subelement_prefix_suffix()
range_field_widget_form in ./range.module
Implements hook_field_widget_form().

File

./range.module, line 692
Defines range field types.

Code

function _range_field_widget_form_subelement_prefix_suffix(array &$element, $name, array $settings) {
  if (!empty($settings[$name]['prefix'])) {
    $prefix = field_filter_xss($settings[$name]['prefix']);
    $element[$name]['#field_prefix'] = $prefix;
  }
  if (!empty($settings[$name]['suffix'])) {
    $suffix = field_filter_xss($settings[$name]['suffix']);
    $element[$name]['#field_suffix'] = $suffix;
  }
}