You are here

function monitoring_clear_missing_sensor_submit in Monitoring 7

Same name and namespace in other branches
  1. 8 monitoring.module \monitoring_clear_missing_sensor_submit()

Submit callback to clear the disappeared sensors list.

See also

\Drupal\monitoring\Sensor\Sensors\SensorDisappearedSensors::settingsForm()

1 string reference to 'monitoring_clear_missing_sensor_submit'
SensorDisappearedSensors::settingsForm in lib/Drupal/monitoring/Sensor/Sensors/SensorDisappearedSensors.php
Adds UI to clear the missing sensor status.

File

./monitoring.module, line 633
Monitoring bootstrap file.

Code

function monitoring_clear_missing_sensor_submit($form, &$form_state) {
  $available_sensors = array();
  foreach (monitoring_sensor_info() as $key => $info) {
    $available_sensors[$key] = array(
      'name' => $key,
      'label' => $info
        ->getLabel(),
      'enabled' => $info
        ->isEnabled(),
    );
  }
  variable_set('monitoring_available_sensors', $available_sensors);
  drupal_set_message(t('All missing sensors have been cleared.'));
}