You are here

function ajax_facets_facetapi_widgets in Ajax facets 7.3

Same name and namespace in other branches
  1. 7 ajax_facets.module \ajax_facets_facetapi_widgets()
  2. 7.2 ajax_facets.module \ajax_facets_facetapi_widgets()

Implements hook_facetapi_widgets().

File

./ajax_facets.module, line 45

Code

function ajax_facets_facetapi_widgets() {
  $query_type = [
    'term',
    'date',
    'date_range',
  ];
  $widgets = [
    // Custom widget to handle ajax-refreshed facets.
    'facetapi_ajax_checkboxes' => [
      'handler' => [
        'label' => 'Ajax multiple checkboxes',
        'class' => 'FacetapiAjaxWidgetCheckboxes',
        'query types' => $query_type,
      ],
    ],
    'facetapi_ajax_select' => [
      'handler' => [
        'label' => 'Ajax selectbox',
        'class' => 'FacetapiAjaxWidgetSelect',
        'query types' => $query_type,
      ],
    ],
    'facetapi_ajax_links' => [
      'handler' => [
        'label' => 'Ajax links',
        'class' => 'FacetapiAjaxWidgetLinks',
        'query types' => $query_type,
      ],
    ],
    'facetapi_ajax_ranges' => [
      'handler' => [
        'label' => 'Ajax ranges',
        'class' => 'FacetapiAjaxWidgetRanges',
        'query types' => [
          'term',
        ],
      ],
    ],
  ];
  return $widgets;
}