You are here

function weather_display_delete_confirm in Weather 7

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

Generate a confirmation form before deleting.

1 string reference to 'weather_display_delete_confirm'
weather_menu in ./weather.module
Implement hook_menu().

File

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

Code

function weather_display_delete_confirm($form, &$form_state, $display_type, $display_number) {
  $form['type'] = array(
    '#type' => 'value',
    '#value' => $display_type,
  );
  $form['number'] = array(
    '#type' => 'value',
    '#value' => $display_number,
  );
  if ($display_type == 'user') {
    $question = t('Are you sure you want to delete your custom display?');
    $return_path = 'user/' . $display_number . '/weather';
  }
  else {
    $question = t('Are you sure you want to delete display #@number?', array(
      '@number' => $display_number,
    ));
    $return_path = 'admin/config/user-interface/weather';
  }
  return confirm_form($form, $question, $return_path, NULL, t('Delete'));
}