You are here

function countries_admin_delete in Countries 7

Same name and namespace in other branches
  1. 8 countries.admin.inc \countries_admin_delete()
  2. 7.2 countries.admin.inc \countries_admin_delete()

Menu callback; confirm deletion of a country.

See also

countries_admin_delete_submit()

1 string reference to 'countries_admin_delete'
countries_menu in ./countries.module
Implement hook_menu().

File

./countries.admin.inc, line 294
Admin page callbacks for the Countries module.

Code

function countries_admin_delete($form, &$form_state, $country) {
  include_once DRUPAL_ROOT . '/includes/iso.inc';
  $core_countries = _country_get_predefined_list();
  if (array_key_exists($country->iso2, $core_countries)) {
    drupal_set_message(t('Core countries defined by the system can not be deleted.'), 'error');
    drupal_goto('admin/config/regional/countries');
  }
  $form['#country'] = $country;
  return confirm_form($form, t('Are you sure you want to delete the country %country?', array(
    '%country' => $country->name,
  )), 'admin/config/regional/countries', t('References that use this country will become invalid. This action cannot be undone.'), t('Delete'), t('Cancel'));
}