You are here

function lingotek_entity_reference_updater_batch_finished in Lingotek Translation 7.7

Entity reference updater finished reporter

1 string reference to 'lingotek_entity_reference_updater_batch_finished'
lingotek_cleanup_entity_references in ./lingotek.util.inc
Re-links translation parent entities to translation child entities

File

./lingotek.batch.inc, line 348
Central location for batch create functions, before control is handed off to individual batch command files.

Code

function lingotek_entity_reference_updater_batch_finished($success, $results) {
  if (isset($results['entity_reference_fixed'])) {
    $fixed_message = format_plural($results['entity_reference_fixed'], t('References corrected for one entity.'), t('References corrected for @num entities.', array(
      '@num' => (int) $results['entity_reference_fixed'],
    )));
    drupal_set_message(filter_xss($fixed_message), 'status');
  }
  if (isset($results['entity_reference_not_fixed'])) {
    $not_fixed_message = format_plural($results['entity_reference_not_fixed'], t('No translation was found for 1 entity.'), t('No reference correction needed for @num entities', array(
      '@num' => (int) $results['entity_reference_not_fixed'],
    )));
    drupal_set_message(filter_xss($not_fixed_message), 'warning');
  }
  if (!isset($results['entity_reference_fixed']) && !isset($results['entity_reference_not_fixed'])) {
    $message = t('No entity references required correcting.');
    drupal_set_message(filter_xss($message), 'status');
  }
}