You are here

function entity_translation_delete_confirm in Entity Translation 7

Translation deletion confirmation form.

1 string reference to 'entity_translation_delete_confirm'
entity_translation_menu_alter in ./entity_translation.module
Implements hook_menu_alter().

File

./entity_translation.admin.inc, line 460
The entity translation user interface.

Code

function entity_translation_delete_confirm($form, $form_state, $entity_type, $entity, $langcode) {
  $handler = entity_translation_get_handler($entity_type, $entity);
  $handler
    ->setActiveLanguage($langcode);
  $handler
    ->initPathScheme();
  $languages = language_list();
  $form = array(
    '#handler' => $handler,
    '#entity_type' => $entity_type,
    // Ensure $entity holds an entity object and not an id.
    '#entity' => $handler
      ->getEntity(),
    '#language' => $langcode,
  );
  return confirm_form($form, t('Are you sure you want to delete the @language translation of %label?', array(
    '@language' => $languages[$langcode]->name,
    '%label' => $handler
      ->getLabel(),
  )), $handler
    ->getEditPath($langcode), t('This action cannot be undone.'), t('Delete'), t('Cancel'));
}