protected function FacetapiAjaxWidgetLinks::setThemeHooks in Ajax facets 7.3
Recursive function that sets each item's theme hook.
The indivual items will be rendered by different theme hooks depending on whether or not they are active.
Parameters
array &$build: A render array containing the facet items.
Return value
FacetapiWidget An instance of this class.
See also
theme_facetapi_link_inactive()
File
- plugins/
facetapi/ ajax_widget_links.inc, line 118 - The facetapi ajax links widget.
Class
- FacetapiAjaxWidgetLinks
- Widget that renders facets as a list of clickable links.
Code
protected function setThemeHooks(array &$build) {
foreach ($build as $value => &$item) {
$item['#theme'] = !empty($item['#active']) ? 'facetapi_link_active' : 'facetapi_link_inactive';
if (!empty($item['#item_children'])) {
$this
->setThemeHooks($item['#item_children']);
}
}
return $this;
}