You are here

function weather_location_delete_confirm_submit in Weather 7

Same name and namespace in other branches
  1. 7.3 weather.forms.inc \weather_location_delete_confirm_submit()
  2. 7.2 weather.forms.inc \weather_location_delete_confirm_submit()

Implement actual deletion of location.

File

./weather.forms.inc, line 594
Provide forms for configuration of weather displays.

Code

function weather_location_delete_confirm_submit($form, &$form_state) {
  db_delete('weather_location')
    ->condition('id', $form_state['values']['id'])
    ->execute();
  if ($form_state['values']['display_type'] == 'user') {
    $path = 'user/' . $form_state['values']['display_number'] . '/weather';
  }
  else {
    $path = 'admin/config/user-interface/weather';
  }
  $form_state['redirect'] = $path;
}