You are here

class FacetapiWidgetCheckboxLinks in Facet API 7

Same name and namespace in other branches
  1. 6.3 plugins/facetapi/widget_links.inc \FacetapiWidgetCheckboxLinks
  2. 7.2 plugins/facetapi/widget_links.inc \FacetapiWidgetCheckboxLinks

Widget that renders facets as a list of clickable checkboxes.

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

Hierarchy

Expanded class hierarchy of FacetapiWidgetCheckboxLinks

1 string reference to 'FacetapiWidgetCheckboxLinks'
facetapi_facetapi_widgets in ./facetapi.facetapi.inc
Implements hook_facetapi_widgets().

File

plugins/facetapi/widget_links.inc, line 290
The facetapi_links and facetapi_checkbox_links widget plugin classes.

View source
class FacetapiWidgetCheckboxLinks extends FacetapiWidgetLinks {

  /**
   * Overrides FacetapiWidgetLinks::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 FacetapiWidgetLinks::getItemClasses().
   *
   * Sets the base class for checkbox facet items.
   */
  public function getItemClasses() {
    return array(
      'facetapi-checkbox',
    );
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FacetapiWidget::$build protected property The render that alterations are being applied to.
FacetapiWidget::$facet protected property The facet object containing the facet definition and required contexts.
FacetapiWidget::$id protected property The machine name of the plugin associated with this instance.
FacetapiWidget::$jsSettings protected property The widget's JavaScript settings that are passed to drupal_add_js().
FacetapiWidget::$key protected property The key of the facet's render array added to the realm's render array.
FacetapiWidget::$realm protected property The realm definition as returned by facetapi_realm_load().
FacetapiWidget::$settings protected property An array of facet settings.
FacetapiWidget::applySorts protected function Applies the sorts to the facet items recursively.
FacetapiWidget::getBuild public function Returns the altered render array acted on by FacetapiWidget::execute().
FacetapiWidget::getId public function Gets the machine name of the plugin.
FacetapiWidget::getJavaScriptSettings public function Returns the JavaScript settings that are passed to drupal_add_js().
FacetapiWidget::getKey public function Gets key used to append FacetapiWidget::build to the realm's render array.
FacetapiWidget::sortCallback protected function Applies sort information via the callback in the sort definition.
FacetapiWidget::sortFacet function Applies sorting algorithms to the items in the facet's render array.
FacetapiWidgetCheckboxLinks::getItemClasses public function Overrides FacetapiWidgetLinks::getItemClasses(). Overrides FacetapiWidgetLinks::getItemClasses
FacetapiWidgetCheckboxLinks::init public function Overrides FacetapiWidgetLinks::init(). Overrides FacetapiWidget::init
FacetapiWidgetLinks::buildListItems function Transforms the render array for use with theme_item_list().
FacetapiWidgetLinks::execute public function Implements FacetapiWidget::execute(). Overrides FacetapiWidget::execute
FacetapiWidgetLinks::getDefaultSettings function Overrides FacetapiWidget::getDefaultSettings(). Overrides FacetapiWidget::getDefaultSettings
FacetapiWidgetLinks::setThemeHooks protected function Recursive function that sets each item's theme hook.
FacetapiWidgetLinks::settingsForm function Overrides FacetapiWidget::settingsForm(). Overrides FacetapiWidget::settingsForm
FacetapiWidgetLinks::__construct public function Overrides FacetapiWidget::__construct(). Overrides FacetapiWidget::__construct