You are here

function lingotek_sync_upload_node_finished in Lingotek Translation 7.6

Same name and namespace in other branches
  1. 7.7 lingotek.batch.inc \lingotek_sync_upload_node_finished()
  2. 7.4 lingotek.batch.inc \lingotek_sync_upload_node_finished()
  3. 7.5 lingotek.batch.inc \lingotek_sync_upload_node_finished()
1 call to lingotek_sync_upload_node_finished()
lingotek_sync_upload_config_finished in ./lingotek.batch.inc
2 string references to 'lingotek_sync_upload_node_finished'
lingotek_grid_action_submit in ./lingotek.bulk_grid.inc
Submit function for The Grid's actions The action corresponds to the key of the option selected Often redirects to batch operations or to other pages entirely
lingotek_grid_upload_edited in ./lingotek.bulk_grid.inc

File

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

Code

function lingotek_sync_upload_node_finished($success, $results, $operations, $config = FALSE) {
  if ($success) {
    $count = isset($results['uploads']) ? $results['uploads'] : 0;
    $node_message = format_plural($count, 'One entity uploaded to Lingotek.', '@count entities uploaded to Lingotek.');
    $config_message = format_plural($count, 'Uploaded one set of config items to Lingotek.', 'Uploaded @count sets of config items to Lingotek.');
    $message = $config === TRUE ? $config_message : $node_message;
    $message .= isset($results['uploaded_nids']) && is_array($results['uploaded_nids']) ? ' (' . format_plural($count, 'entity id', 'entity ids') . ': ' . implode(", ", $results['uploaded_nids']) . ')' : '';
    $message .= isset($results['disabled']) ? ' ' . t("<i>(Note: entities with the Disabled profile must be set to an enabled profile to be uploaded)</i>") : "";
    $status = isset($results['disabled']) ? 'warning' : 'status';
    drupal_set_message(filter_xss($message), $status);
  }
  else {
    $message = t('Finished with an error.');
    drupal_set_message(filter_xss($message), 'error');
  }
}