function translation_entity_delete_confirm_submit

Form submission handler for translation_entity_delete_confirm().

File

drupal/core/modules/translation_entity/translation_entity.pages.inc, line 249
The entity translation user interface.

Code

function translation_entity_delete_confirm_submit(array $form, array &$form_state) {
  list($entity, $language) = $form_state['build_info']['args'];
  $controller = translation_entity_controller($entity
    ->entityType());

  // Remove the translated values.
  $controller
    ->removeTranslation($entity, $language->langcode);
  $entity
    ->save();

  // Remove any existing path alias for the removed translation.
  if (module_exists('path')) {
    path_delete(array(
      'source' => $controller
        ->getViewPath($entity),
      'langcode' => $language->langcode,
    ));
  }
  $form_state['redirect'] = $controller
    ->getBasePath($entity) . '/translations';
}