You are here

public function SearchApiRangesWidgetUISlider::execute in Search API ranges 7

Renders the links.

File

plugins/facetapi/widget_slider.inc, line 12
Widget for facets rendered as UI slider with Min/Max.

Class

SearchApiRangesWidgetUISlider
@file Widget for facets rendered as UI slider with Min/Max.

Code

public function execute() {
  $element =& $this->build[$this->facet['field alias']];
  $theme_suffix = '';
  $theme_suffix .= '__' . preg_replace('/\\W+/', '_', $this->facet
    ->getAdapter()
    ->getSearcher());
  $theme_suffix .= '__' . preg_replace('/\\W+/', '_', $this->facet['field alias']);
  $settings = $this->settings->settings;
  $step = isset($settings['slider-step']) ? $settings['slider-step'] : 1;
  $round_precision = isset($settings['round-precision']) ? (int) $settings['round-precision'] : 0;
  $element = array(
    '#theme' => 'search_api_ranges_slider' . $theme_suffix,
    '#slider' => $this
      ->_buildUISliderForm(),
    '#prefix' => '<div id="search-api-ranges-' . $this->facet['field alias'] . '">',
    '#suffix' => '</div>',
    '#attached' => array(
      'js' => array(
        array(
          'data' => array(
            'search_api_ranges' => array(
              $this->facet['field alias'] => array(
                'slider-step' => $step,
                'round-precision' => $round_precision,
              ),
            ),
          ),
          'type' => 'setting',
        ),
      ),
    ),
  );
}