You are here

function _submenutree_sort_items_compare in Submenu Tree 5

Same name and namespace in other branches
  1. 6 submenutree.module \_submenutree_sort_items_compare()
  2. 7.2 submenutree.module \_submenutree_sort_items_compare()
  3. 7 submenutree.module \_submenutree_sort_items_compare()

Compare two items by weight then title.

Parameters

a: The first item to compare.

b: The second item to compare.

Return value

An integer less than, equal to, or greater than zero if $a is considered to be respectively less than, equal to, or greater than $b.

1 string reference to '_submenutree_sort_items_compare'
_submenutree_sort_items in ./submenutree.module
Sort an array of items.

File

./submenutree.module, line 386

Code

function _submenutree_sort_items_compare($a, $b) {
  $ret = $a['weight'] - $b['weight'];
  if ($ret == 0) {
    $ret = strcasecmp($a['title'], $b['title']);
  }
  return $ret;
}