function facetapi_sort_active in Facet API 6.3
Same name and namespace in other branches
- 6 facetapi.adapter.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.
2 string references to 'facetapi_sort_active'
- facetapi_facetapi_sort_info in ./
facetapi.facetapi.inc - Implements hook_facetapi_sort_info().
- hook_facetapi_sort_info in ./
facetapi.api.php - Define all facets sorting algorithms provided by the module.
File
- plugins/
facetapi/ widget.inc, line 257 - Abstract widget plugin class.
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;
}