You are here

function lingotek_bulk_mt_upload_batch_create in Lingotek Translation 7.2

Batch Create - Upload: Create a Bulk Machine Translate UPLOAD Batch.

1 call to lingotek_bulk_mt_upload_batch_create()
lingotek_dashboard_mt_upload in ./lingotek.batch.inc
Batch Create: Bulk Machine Translate Upload.

File

./lingotek.batch.inc, line 233

Code

function lingotek_bulk_mt_upload_batch_create() {
  $operations = array();
  $bundles = lingotek_translatable_node_types();

  // The nodes we translate.
  // Grab nodes that are currently marked 'EDITED'
  $query = db_select('lingotek', 'l')
    ->fields('l');
  $query
    ->condition('lingokey', 'node_sync_status');
  $query
    ->condition('lingovalue', LINGOTEK_NODE_SYNC_STATUS_EDITED);
  $result = $query
    ->execute();
  while ($record = $result
    ->fetchAssoc()) {
    $operations[] = array(
      'lingotek_machine_translate_node',
      array(
        $record['nid'],
      ),
    );
  }
  $batch = array(
    'title' => t('Sending Content to Lingotek for Translation.'),
    'operations' => $operations,
    'finished' => 'lingotek_bulk_mt_upload_batch_finished',
    'file' => 'lingotek.batch.inc',
  );
  batch_set($batch);
  batch_process('<front>');

  // Needed if not inside a form _submit handler.  Setting redirect in batch_process.
}