function _search_autocomplete_sort_by_weight in Search Autocomplete 7.4
Same name and namespace in other branches
- 6.4 search_autocomplete.form.treelist.inc \_search_autocomplete_sort_by_weight()
- 6.2 search_autocomplete.form.treelist.inc \_search_autocomplete_sort_by_weight()
- 7.2 search_autocomplete.form.treelist.inc \_search_autocomplete_sort_by_weight()
- 7.3 search_autocomplete.form.treelist.inc \_search_autocomplete_sort_by_weight()
HELPER function : Usort function for sorting arrays by weight.
Return value
bool 1: if ($a < $b), 0 if equal, -1 otherwise
1 string reference to '_search_autocomplete_sort_by_weight'
- _search_autocomplete_get_ordered_list in ./
search_autocomplete.form.treelist.inc - HELPER function to order a list.
File
- ./
search_autocomplete.form.treelist.inc, line 261 - Search Autocomplete Display the list of form to autocomplete and theme it as a draggable table.
Code
function _search_autocomplete_sort_by_weight($a, $b) {
if ($a->weight == $b->weight) {
return 0;
}
return $a->weight < $b->weight ? -1 : 1;
}