You are here

function nagios_system_theme_settings_form_submit in Nagios Monitoring 7

Same name and namespace in other branches
  1. 8 nagios.module \nagios_system_theme_settings_form_submit()

Additional system theme settings form submit handler.

Saves the Nagios theme ignore status to the 'nagios_ignored_themes' variable. Variable contains an array of theme names to be ignored in the form 'theme_machine_name' => TRUE

1 string reference to 'nagios_system_theme_settings_form_submit'
nagios_form_system_theme_settings_alter in ./nagios.module
Implements hook_form_FORMID_alter().

File

./nagios.module, line 607

Code

function nagios_system_theme_settings_form_submit(&$form, &$form_state) {

  // Grab the name of the theme.
  if (isset($form_state['build_info']['args'][0]) && !empty($form_state['build_info']['args'][0])) {
    $theme_name = check_plain($form_state['build_info']['args'][0]);
    $nagios_ignored_themes = variable_get('nagios_ignored_themes', []);
    if (!empty($form_state['values']['nagios_ignore'])) {
      $nagios_ignored_themes[$theme_name] = TRUE;
    }
    else {
      unset($nagios_ignored_themes[$theme_name]);
    }
    variable_set('nagios_ignored_themes', $nagios_ignored_themes);
  }
}