You are here

function lingotek_grid_upload_edited in Lingotek Translation 7.5

Same name and namespace in other branches
  1. 7.7 lingotek.bulk_grid.inc \lingotek_grid_upload_edited()
  2. 7.6 lingotek.bulk_grid.inc \lingotek_grid_upload_edited()
1 string reference to 'lingotek_grid_upload_edited'
lingotek_menu in ./lingotek.module
Implements hook_menu().

File

./lingotek.bulk_grid.inc, line 727
Bulk Grid form

Code

function lingotek_grid_upload_edited($entity_type) {
  $entity_ids = LingotekSync::getEntityIdsToUpload($entity_type);
  if (!empty($entity_ids)) {
    $operations = array();
    foreach ($entity_ids as $id) {
      $operations[] = array(
        'lingotek_entity_upload',
        array(
          $id,
          $entity_type,
        ),
      );
    }
    $redirect = 'admin/settings/lingotek/manage/' . $entity_type;
    $batch = array(
      'title' => t('Uploading documents'),
      'finished' => 'lingotek_sync_upload_node_finished',
      'operations' => $operations,
    );
    batch_set($batch);
    batch_process($redirect);
  }
  else {
    drupal_set_message(t('There are no translations ready for upload.'));
    drupal_goto('admin/settings/lingotek/manage/' . $entity_type);
  }
}