You are here

function weather_custom_block_delete_confirm in Weather 5.6

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

Confirmation page before deleting a location

1 string reference to 'weather_custom_block_delete_confirm'
weather_menu in ./weather.module
Implementation of hook_menu().

File

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

Code

function weather_custom_block_delete_confirm($uid, $cid) {
  if ($uid == WEATHER_SYSTEM_BLOCK) {
    $abort_path = 'admin/settings/weather';
  }
  else {
    $abort_path = 'user/' . $uid . '/weather';
  }
  $sql = "SELECT * FROM {weather_config} WHERE uid=%d and cid=%d";
  $result = db_query($sql, $uid, $cid);
  $row = db_fetch_array($result);
  $form = array();
  $form['uid'] = array(
    '#type' => 'hidden',
    '#value' => $uid,
  );
  $form['cid'] = array(
    '#type' => 'hidden',
    '#value' => $cid,
  );
  return confirm_form($form, t('Are you sure you want to delete the location %name?', array(
    '%name' => $row['real_name'],
  )), $abort_path, t('This action cannot be undone.'), t('Delete'), t('Cancel'));
}