You are here

function _pm_dashboard_sort_links in Drupal PM (Project Management) 7.2

Same name and namespace in other branches
  1. 8 pm.module \_pm_dashboard_sort_links()
  2. 7.3 pm.module \_pm_dashboard_sort_links()
  3. 7 pm.module \_pm_dashboard_sort_links()

Orders dashboard links by weight. Helper for pm_dashboard_get_links().

Parameters

array $a: Dashboard link array.

array $b: Dashboard link array.

Return value

int Relative weight of $a and $b.

See also

uasort()

1 string reference to '_pm_dashboard_sort_links'
pm_dashboard_get_links in ./pm.module
Return links array for the pm dashboard.

File

./pm.module, line 214
Main module file for the Project Management module.

Code

function _pm_dashboard_sort_links(array $a, array $b) {
  if (intval($a['weight']) == intval($b['weight'])) {
    return 0;
  }
  elseif (intval($a['weight']) < intval($b['weight'])) {
    return -1;
  }
  else {
    return 1;
  }
}