You are here

function lingotek_batch_reset_content in Lingotek Translation 7.3

Batch Create: Lingotek Reset Content

1 string reference to 'lingotek_batch_reset_content'
lingotek_admin_utilities_form in ./lingotek.admin.inc
Utilities Form

File

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

Code

function lingotek_batch_reset_content() {
  $doc_ids = LingotekSync::getAllLocalDocIds();
  $api = LingotekApi::instance();
  $operations = array();

  /*
   //one at a time
   foreach ($doc_ids as $doc_id) {
   $operations[] = array('lingotek_batch_reset_content_worker', array($api, $doc_id));
   }
  */

  // all at once
  $operations[] = array(
    'lingotek_batch_reset_content_worker',
    array(
      $api,
      $doc_ids,
    ),
  );
  $operations[] = array(
    'LingotekSync::disassociateAllNodes',
    array(),
  );
  $operations[] = array(
    'LingotekSync::disassociateAllEntities',
    array(),
  );
  $operations[] = array(
    'LingotekSync::disassociateAllChunks',
    array(),
  );
  drupal_set_message(t('All local translations have been disassociated from Lingotek.'));
  $operations[] = array(
    'lingotek_cleanup_utility',
    array(
      FALSE,
    ),
  );

  // identify translatable content
  drupal_set_message(t('Translation management settings for all nodes have been set to the defaults.'));
  $batch = array(
    'title' => t('Resetting Translations'),
    'operations' => $operations,
  );
  batch_set($batch);
}