You are here

function nagios_system_modules_form_submit in Nagios Monitoring 7

Additional system modules form submit handler.

This is for Drupal core's regular modules page, /admin/modules.

Saves the modules that have been selected to be ignored from Nagios reporting to the 'nagios_ignored_modules' variable. Variable contains an array of module names to be ignored in the form 'module_machine_name' => TRUE

1 string reference to 'nagios_system_modules_form_submit'
nagios_form_system_modules_alter in ./nagios.module
Implements hook_form_FORMID_alter().

File

./nagios.module, line 540

Code

function nagios_system_modules_form_submit(&$form, &$form_state) {
  $nagios_ignored_modules = [];
  foreach ($form_state['values']['modules'] as $package_name => $package) {
    if ($package_name[0] != '#') {
      foreach ($package as $module_name => $module) {
        if ($module_name[0] != '#') {
          if (!empty($module['links']['nagios_ignore'])) {
            $nagios_ignored_modules[$module_name] = TRUE;
          }
        }
      }
    }
  }
  variable_set('nagios_ignored_modules', $nagios_ignored_modules);
}