You are here

function _homebox_block_compare in Homebox 6.2

Same name and namespace in other branches
  1. 6.3 homebox.admin.inc \_homebox_block_compare()
  2. 6 homebox.admin.inc \_homebox_block_compare()
  3. 7.3 homebox.admin.inc \_homebox_block_compare()
  4. 7.2 homebox.admin.inc \_homebox_block_compare()

Helper function for sorting blocks on admin/build/homebox.

Active blocks are sorted by region, then by weight. Disabled blocks are sorted by name.

Parameters

$a: An array

$b: An array

Return value

Comparison result

1 string reference to '_homebox_block_compare'
homebox_layout in ./homebox.admin.inc
Form builder function for module settings.

File

./homebox.admin.inc, line 876
Homebox admin file, takes care admin interface for homebox

Code

function _homebox_block_compare($a, $b) {

  // Sort by weight.
  $weight = $a['weight'] - $b['weight'];
  if ($weight) {
    return $weight;
  }

  // Sort by title.
  return strcmp($a['info'], $b['info']);
}