public function LingotekBatchController::uploadSingle in Lingotek Translation 3.8.x
Same name and namespace in other branches
- 8 src/Controller/LingotekBatchController.php \Drupal\lingotek\Controller\LingotekBatchController::uploadSingle()
- 8.2 src/Controller/LingotekBatchController.php \Drupal\lingotek\Controller\LingotekBatchController::uploadSingle()
- 4.0.x src/Controller/LingotekBatchController.php \Drupal\lingotek\Controller\LingotekBatchController::uploadSingle()
- 3.0.x src/Controller/LingotekBatchController.php \Drupal\lingotek\Controller\LingotekBatchController::uploadSingle()
- 3.1.x src/Controller/LingotekBatchController.php \Drupal\lingotek\Controller\LingotekBatchController::uploadSingle()
- 3.2.x src/Controller/LingotekBatchController.php \Drupal\lingotek\Controller\LingotekBatchController::uploadSingle()
- 3.3.x src/Controller/LingotekBatchController.php \Drupal\lingotek\Controller\LingotekBatchController::uploadSingle()
- 3.4.x src/Controller/LingotekBatchController.php \Drupal\lingotek\Controller\LingotekBatchController::uploadSingle()
- 3.5.x src/Controller/LingotekBatchController.php \Drupal\lingotek\Controller\LingotekBatchController::uploadSingle()
- 3.6.x src/Controller/LingotekBatchController.php \Drupal\lingotek\Controller\LingotekBatchController::uploadSingle()
- 3.7.x src/Controller/LingotekBatchController.php \Drupal\lingotek\Controller\LingotekBatchController::uploadSingle()
1 call to LingotekBatchController::uploadSingle()
- LingotekBatchController::dispatch in src/
Controller/ LingotekBatchController.php
File
- src/
Controller/ LingotekBatchController.php, line 38
Class
Namespace
Drupal\lingotek\ControllerCode
public function uploadSingle($entity_type, $entity_id, LingotekProfile $profile = NULL) {
$batch = [
'title' => $this
->t('Uploading content to Lingotek'),
'operations' => $this
->getUploadOperations($entity_type, [
$entity_id,
]),
'error_message' => t('An error happened.'),
'finished' => 'lingotek_operation_content_upload_finished',
'file' => drupal_get_path('module', 'lingotek') . '/lingotek.batch.inc',
];
$redirect_url = \Drupal::urlGenerator()
->generate("entity.{$entity_type}.content_translation_overview", [
$entity_type => $entity_id,
], UrlGeneratorInterface::ABSOLUTE_URL);
batch_set($batch);
return batch_process($redirect_url);
}