You are here

function locale_admin_manage_delete_form in Drupal 4

Same name and namespace in other branches
  1. 5 modules/locale/locale.module \locale_admin_manage_delete_form()

User interface for the language deletion confirmation screen.

1 string reference to 'locale_admin_manage_delete_form'
locale_menu in modules/locale.module
Implementation of hook_menu().

File

modules/locale.module, line 317
Enables administrators to manage the site interface languages.

Code

function locale_admin_manage_delete_form() {
  include_once './includes/locale.inc';
  $langcode = arg(4);

  // Do not allow deletion of English locale.
  if ($langcode == 'en') {
    drupal_set_message(t('The English locale cannot be deleted.'));
    drupal_goto('admin/locale/language/overview');
  }

  // For other locales, warn user that data loss is ahead.
  $languages = locale_supported_languages(FALSE, TRUE);
  if (!isset($languages['name'][$langcode])) {
    drupal_not_found();
  }
  else {
    $form['langcode'] = array(
      '#type' => 'value',
      '#value' => $langcode,
    );
    return confirm_form('locale_admin_manage_delete_form', $form, t('Are you sure you want to delete the language %name?', array(
      '%name' => theme('placeholder', t($languages['name'][$langcode])),
    )), 'admin/locale/language/overview', t('Deleting a language will remove all data associated with it. This action cannot be undone.'), t('Delete'), t('Cancel'));
  }
}