You are here

function tmgmt_rules_job_add_item in Translation Management Tool 7

Rules callback to add an item to a job.

File

./tmgmt.rules.inc, line 198
Rules integration.

Code

function tmgmt_rules_job_add_item(TMGMTJob $job, $plugin, $item_type, $item_id) {
  try {
    $job
      ->addItem($plugin, $item_type, $item_id);
  } catch (TMGMTException $e) {
    watchdog_exception('tmgmt', $e);
    drupal_set_message(t('Unable to add job item of type %type with id %id. Make sure the source content is not empty.', array(
      '%type' => $item_type,
      '%id' => $item_id,
    )), 'error');
  }
}