You are here

function _nagios_updates_sort_by_severity in Nagios Monitoring 7

Same name and namespace in other branches
  1. 8 nagios.module \_nagios_updates_sort_by_severity()
  2. 6 nagios.module \_nagios_updates_sort_by_severity()

Helper function to sort modules by severity with usort().

1 string reference to '_nagios_updates_sort_by_severity'
nagios_check_requirements in ./nagios.module
Check all Drupal requirements are satisfied.

File

./nagios.module, line 1288

Code

function _nagios_updates_sort_by_severity($a, $b) {
  if (isset($a['severity'], $b['severity'])) {
    if ($a['severity'] == $b['severity']) {
      return 0;
    }
    return $a['severity'] < $b['severity'] ? -1 : 1;
  }
  return 0;
}