function _pm_dashboard_sort_links in Drupal PM (Project Management) 7.3
Same name and namespace in other branches
- 8 pm.module \_pm_dashboard_sort_links()
- 7 pm.module \_pm_dashboard_sort_links()
- 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()
File
- ./
pm.module, line 284 - 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;
}
}