You are here

function _pm_dashboard_sort_links in Drupal PM (Project Management) 8

Same name and namespace in other branches
  1. 7.3 pm.module \_pm_dashboard_sort_links()
  2. 7 pm.module \_pm_dashboard_sort_links()
  3. 7.2 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 274
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;
  }
}