You are here

function weather_display_delete_confirm_submit in Weather 7.2

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

Implements actual deletion of display.

1 string reference to 'weather_display_delete_confirm_submit'
weather_display_config_form in ./weather.forms.inc
Create a configuration form for a weather display.

File

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

Code

function weather_display_delete_confirm_submit($form, &$form_state) {

  // Delete associated locations.
  db_delete('weather_displays_places')
    ->condition('display_type', $form_state['values']['type'])
    ->condition('display_number', $form_state['values']['number'])
    ->execute();

  // Delete actual display.
  db_delete('weather_displays')
    ->condition('type', $form_state['values']['type'])
    ->condition('number', $form_state['values']['number'])
    ->execute();
  if ($form_state['values']['type'] == 'user') {
    $path = 'user/' . $form_state['values']['number'] . '/weather';
  }
  else {
    $path = 'admin/config/user-interface/weather';
  }
  $form_state['redirect'] = $path;
}