function facetapi_sort_active in Facet API 6
Same name and namespace in other branches
- 6.3 plugins/facetapi/widget.inc \facetapi_sort_active()
- 7.2 plugins/facetapi/widget.inc \facetapi_sort_active()
- 7 plugins/facetapi/widget.inc \facetapi_sort_active()
Sorts by whether or not a facet is active.
1 string reference to 'facetapi_sort_active'
- facetapi_facetapi_sort_info in ./
facetapi.module - Implementation of hook_facetapi_sort_info().
File
- ./
facetapi.adapter.inc, line 745 - Defines classes used by the FacetAPI module.
Code
function facetapi_sort_active(array $a, array $b) {
$a_active = isset($a['#active']) ? $a['#active'] : 0;
$b_active = isset($b['#active']) ? $b['#active'] : 0;
if ($a_active == $b_active) {
return 0;
}
return $a_active < $b_active ? -1 : 1;
}