You are here

function facetapi_ranges_select_facet_form in Search API ranges 7

1 call to facetapi_ranges_select_facet_form()
SearchApiRangesWidgetSelect::execute in plugins/facetapi/widget_select.inc
Renders the links.

File

plugins/facetapi/widget_select.inc, line 192
Widget for facet ranges rendered as text links.

Code

function facetapi_ranges_select_facet_form($form_state, $options, $count = 0, $active) {
  $name = 'facetapi_ranges_select_facet_form_' . $count;
  $query_string = $_GET;
  unset($query_string['q']);
  $form['facets'] = array(
    '#type' => 'select',
    '#id' => $name,
    '#options' => $options,
    '#value' => $active,
    '#attributes' => array(
      'onchange' => "top.location.href=document.getElementById('{$name}').options[document.getElementById('{$name}').selectedIndex].value",
    ),
  );
  return $form;
}