You are here

public function FacetapiAjaxWidgetCheckboxes::execute in Ajax facets 7

Same name and namespace in other branches
  1. 7.2 plugins/facetapi/ajax_widget_checkboxes.inc \FacetapiAjaxWidgetCheckboxes::execute()

Implements FacetapiWidget::execute().

Transforms the render array into something that can be themed by theme_item_list().

See also

FacetapiWidgetLinks::setThemeHooks()

FacetapiWidgetLinks::buildListItems()

File

plugins/facetapi/ajax_widget_checkboxes.inc, line 168
The facetapi_links and facetapi_checkbox_links widget plugin classes.

Class

FacetapiAjaxWidgetCheckboxes
Widget that renders facets as a list of clickable links.

Code

public function execute() {
  $element =& $this->build[$this->facet['field alias']];

  // Sets each item's theme hook, builds item list.
  $this
    ->setThemeHooks($element);
  $item_list = array(
    '#theme' => 'item_list',
    '#items' => $this
      ->buildListItems($element),
    '#attributes' => $this->build['#attributes'],
  );
  $reset_link = '';
  if (!empty($this->settings->settings['checkboxes_show_reset_link']) && $this->settings->settings['checkboxes_show_reset_link']) {
    $reset_link = '<a class="reset-link" href="#">' . t('Reset filter') . '</a>';
  }
  $element = array(
    '#markup' => '<div class="facet-wrapper-checkboxes ' . $this->build['#attributes']['id'] . '">' . $reset_link . render($item_list) . '</div>',
  );
}