You are here

function lingotek_field_language_data_cleanup_batch_finished in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.2 lingotek.batch.inc \lingotek_field_language_data_cleanup_batch_finished()
  2. 7.3 lingotek.batch.inc \lingotek_field_language_data_cleanup_batch_finished()
  3. 7.4 lingotek.batch.inc \lingotek_field_language_data_cleanup_batch_finished()
  4. 7.5 lingotek.batch.inc \lingotek_field_language_data_cleanup_batch_finished()
  5. 7.6 lingotek.batch.inc \lingotek_field_language_data_cleanup_batch_finished()

FINISHED CALLBACK: lingotek_field_language_data_cleanup_batch_create()

1 string reference to 'lingotek_field_language_data_cleanup_batch_finished'
lingotek_field_language_data_cleanup_batch_create in ./lingotek.batch.inc
Field Language Data Cleanup Utility

File

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

Code

function lingotek_field_language_data_cleanup_batch_finished($success, $results, $operations) {
  if ($success) {
    $did_something = FALSE;
    $def_lang = language_default('name');
    if (isset($results['entity_cleanup'])) {
      $num_nodes = (int) $results['entity_cleanup'];
      drupal_set_message(format_plural($num_nodes, t('Converted @count entities from language neutral to @language', array(
        '@count' => $num_nodes,
        '@language' => $def_lang,
      )), t('Converted @count entities from language neutral to @language', array(
        '@count' => $num_nodes,
        '@language' => $def_lang,
      ))));
      $did_something = TRUE;
    }
    if (isset($results['url_alias_cleanup'])) {
      $searched = (int) $results['url_alias_cleanup']['searched'];
      $added = (int) $results['url_alias_cleanup']['added'];
      drupal_set_message(format_plural($searched, t('Searched @search_count entity for url aliases, added @add_count in @language.', array(
        '@search_count' => $searched,
        '@add_count' => $added,
        '@language' => $def_lang,
      )), t('Searched @search_count entities for url aliases, added @add_count in @language.', array(
        '@search_count' => $searched,
        '@add_count' => $added,
        '@language' => $def_lang,
      ))));
      $did_something = TRUE;
    }
    if (isset($results['field_cleanup'])) {
      $num_nodes = (int) $results['field_cleanup'];
      drupal_set_message(format_plural($num_nodes, t('Added language-specific fields for @count entity with language-neutral fields.', array(
        '@count' => $num_nodes,
      )), t('Added language-specific fields for @count entities with language-neutral fields.', array(
        '@count' => $num_nodes,
      ))));
      $did_something = TRUE;
    }
    if (!$did_something) {
      drupal_set_message(t('No requested entities currently require any preparation.'), 'status', FALSE);
    }
  }
}