_update_project_status_sort

6 update.module _update_project_status_sort($a, $b)
7 update.module _update_project_status_sort($a, $b)
8 update.module _update_project_status_sort($a, $b)

Private sort function to order projects based on their status.

See also

update_requirements()

uasort()

1 string reference to '_update_project_status_sort'

File

modules/update/update.module, line 499
The "Update status" module checks for available updates of Drupal core and any installed contributed modules and themes. It warns site administrators if newer releases are available via the system status report (admin/reports/status), the…

Code

function _update_project_status_sort($a, $b) {
  // The status constants are numerically in the right order, so we can
  // usually subtract the two to compare in the order we want. However,
  // negative status values should be treated as if they are huge, since we
  // always want them at the bottom of the list.
  $a_status = $a['status'] > 0 ? $a['status'] : (-10 * $a['status']);
  $b_status = $b['status'] > 0 ? $b['status'] : (-10 * $b['status']);
  return $a_status - $b_status;
}
Login or register to post comments