You are here

function weather_custom_block_delete_confirm_submit in Weather 5.6

Same name and namespace in other branches
  1. 6.5 weather.module \weather_custom_block_delete_confirm_submit()

Handle the deletion of a location

File

./weather.module, line 835
Display <acronym title="METeorological Aerodrome Report">METAR</acronym> weather data from anywhere in the world

Code

function weather_custom_block_delete_confirm_submit($form, $form_values) {

  // delete the entry
  $sql = "DELETE FROM {weather_config} WHERE uid=%d AND cid=%d";
  db_query($sql, $form_values['uid'], $form_values['cid']);
  drupal_set_message(t('The location has been deleted.'));
  if ($form_values['uid'] == WEATHER_SYSTEM_BLOCK) {

    // go back to the administration of the system weather block
    drupal_goto('admin/settings/weather');
  }
  else {
    drupal_goto('user/' . $form_values['uid'] . '/weather');
  }
}