function locale_languages_delete_form
7.x locale.admin.inc | locale_languages_delete_form( |
6.x locale.inc | locale_languages_delete_form(&$form_state, $langcode) |
User interface for the language deletion confirmation screen.
Related topics
1 string reference to 'locale_languages_delete_form'
- locale_menu in drupal-7.x/
modules/ locale/ locale.module - Implements hook_menu().
File
- drupal-7.x/
modules/ locale/ locale.admin.inc, line 432 - Administration functions for locale.module.
Code
function locale_languages_delete_form($form, &$form_state, $langcode) {
// Do not allow deletion of English locale.
if ($langcode == 'en') {
drupal_set_message(t('The English language cannot be deleted.'));
drupal_goto('admin/config/regional/language');
}
if (language_default('language') == $langcode) {
drupal_set_message(t('The default language cannot be deleted.'));
drupal_goto('admin/config/regional/language');
}
// For other languages, warn user that data loss is ahead.
$languages = language_list();
if (!isset($languages[$langcode])) {
drupal_not_found();
drupal_exit();
}
else {
$form['langcode'] = array('#type' => 'value', '#value' => $langcode);
return confirm_form($form, t('Are you sure you want to delete the language %name?', array('%name' => t($languages[$langcode]->name))), 'admin/config/regional/language', t('Deleting a language will remove all interface translations associated with it, and posts in this language will be set to be language neutral. This action cannot be undone.'), t('Delete'), t('Cancel'));
}
}