function lingotek_sync_batch_create_old in Lingotek Translation 7.2
Same name and namespace in other branches
- 7.3 lingotek.batch.inc \lingotek_sync_batch_create_old()
1 call to lingotek_sync_batch_create_old()
- lingotek_sync in ./lingotek.sync.inc
- The main function responsible for syncing node/document translation.
File
- ./lingotek.batch.inc, line 108
Code
function lingotek_sync_batch_create_old() {
$download_commands = lingotek_get_sync_download_batch_elements();
$upload_commands = lingotek_get_sync_upload_batch_elements();
$operations = array();
$operations[] = array(
'lingotek_mt_sync_set_status',
array(
'set',
),
);
$operations = array_merge($operations, $download_commands, $upload_commands);
$operations[] = array(
'lingotek_mt_sync_set_status',
array(
'clear',
),
);
$redirect = isset($_GET['redirect_url']) && strlen($_GET['redirect_url']) ? $_GET['redirect_url'] : LINGOTEK_BASE_URL;
if (count($operations) > 0) {
$batch = array(
'title' => t('Syncing Content Translations with Lingotek'),
'operations' => $operations,
'file' => drupal_get_path('module', 'lingotek') . '/lib/Drupal/batch/lingotek.mt.batch.sync.inc',
);
batch_set($batch);
batch_process($redirect);
}
else {
$options = strpos($redirect, '//') !== FALSE ? array(
'external' => TRUE,
) : array();
drupal_goto($redirect, $options);
}
}