You are here

function facetapi_widget_textfield in Facet API 6

Builds items as a textfield element.

Parameters

&$build: The facet's render array.

&$key: A string containing the key the facet's render array will be appended to.

&$settings: An array containing the JavaScript settings.

1 string reference to 'facetapi_widget_textfield'
facetapi_facetapi_widget_info in ./facetapi.module
Implementation of hook_facetapi_widget_info().

File

./facetapi.widget.inc, line 155
Widget callbacks and building functions.

Code

function facetapi_widget_textfield(array &$build, &$key, &$settings) {
  $build['#type'] = 'textfield';
  $build['#default_value'] = drupal_implode_tags($build['#adapter']
    ->getActiveValues($build['#facet']));
  $build['#prefix'] = '<div class="criterion">';
  $build['#suffix'] = '</div>';
  $build['#size'] = 30;
  unset($build[$build['#facet']['field alias']]);
}