You are here

class SearchApiRangesWidgetCheckboxLinks in Search API ranges 7

Widget that renders facets as a list of clickable checkboxes.

This widget renders facets in the same way as SearchApiRangesWidgetLinks but uses JavaScript to transform the links into checkboxes followed by the facet.

Hierarchy

Expanded class hierarchy of SearchApiRangesWidgetCheckboxLinks

1 string reference to 'SearchApiRangesWidgetCheckboxLinks'
search_api_ranges_facetapi_widgets in ./search_api_ranges.module
Implements hook_facetapi_widgets().

File

plugins/facetapi/widget_links.inc, line 183
Widgets for facets rendered as test link ranges.

View source
class SearchApiRangesWidgetCheckboxLinks extends SearchApiRangesWidgetLinks {

  /**
   * Overrides SearchApiRangesWidgetLinks::init().
   *
   * Adds additional JavaScript settings and CSS.
   */
  public function init() {
    parent::init();
    $this->jsSettings['makeCheckboxes'] = 1;
    drupal_add_css(drupal_get_path('module', 'facetapi') . '/facetapi.css');
  }

  /**
   * Overrides SearchApiRangesWidgetLinks::getItemClasses().
   *
   * Sets the base class for checkbox facet items.
   */
  public function getItemClasses() {
    return array(
      'facetapi-checkbox',
    );
  }

}

Members

Namesort descending Modifiers Type Description Overrides
SearchApiRangesWidgetCheckboxLinks::getItemClasses public function Overrides SearchApiRangesWidgetLinks::getItemClasses().
SearchApiRangesWidgetCheckboxLinks::init public function Overrides SearchApiRangesWidgetLinks::init().
SearchApiRangesWidgetLinks::execute public function Renders the links.
SearchApiRangesWidgetLinks::getDefaultSettings function Returns defaults for the settings this widget provides.
SearchApiRangesWidgetLinks::settingsForm function Allows the widget to provide additional settings to the form.