You are here

function lingotek_config_delete_form_submit in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.6 lingotek.bulk_grid.inc \lingotek_config_delete_form_submit()
1 string reference to 'lingotek_config_delete_form_submit'
lingotek_entity_delete_form in ./lingotek.bulk_grid.inc
Form constructor for the entity delete.

File

./lingotek.bulk_grid.inc, line 3170

Code

function lingotek_config_delete_form_submit($form, &$form_state) {
  if (isset($form_state['values']['entity_ids'])) {
    $lids = json_decode($form_state['values']['entity_ids']);
  }
  elseif (isset($form_state['entity_ids'])) {
    $lids = json_decode($form_state['entity_ids']);
  }
  if (!empty($lids)) {
    LingotekConfigSet::deleteSegmentTranslations($lids);
    $count = count($lids);
    watchdog('content', format_plural($count, 'Deleted translations for 1 entity.', 'Deleted translations for @count entities.'));
    drupal_set_message(format_plural($count, 'Deleted translations for 1 entity.', 'Deleted translations for @count entities.'));
    $form_state['executed'] = TRUE;
  }
  $form_state['redirect'] = LINGOTEK_MENU_MAIN_BASE_URL . '/manage';
  return lingotek_grid_filter_submit($form, $form_state);
}