You are here

function _search_autocomplete_sort_by_weight in Search Autocomplete 7.3

Same name and namespace in other branches
  1. 6.4 search_autocomplete.form.treelist.inc \_search_autocomplete_sort_by_weight()
  2. 6.2 search_autocomplete.form.treelist.inc \_search_autocomplete_sort_by_weight()
  3. 7.4 search_autocomplete.form.treelist.inc \_search_autocomplete_sort_by_weight()
  4. 7.2 search_autocomplete.form.treelist.inc \_search_autocomplete_sort_by_weight()

HELPER: Usort function for sorting arrays by weight

Return value

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: Returns a tree list of all items in the $items array that are children of the supplied parent, ordered appropriately

File

./search_autocomplete.form.treelist.inc, line 245
Search Autocomplete Display the list of form to autocomplete and themis 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;
}