You are here

function hook_tmgmt_job_checkout_after_alter in Translation Management Tool 8

Allows to alter job checkout workflow after the default behavior.

Parameters

$redirects: List of redirects the user is supposed to be redirected to.

$jobs: Array with the translation jobs to be checked out.

2 invocations of hook_tmgmt_job_checkout_after_alter()
JobCheckoutManager::checkoutMultiple in src/JobCheckoutManager.php
Attempts to check out a number of jobs.
tmgmt_job_checkout_multiple in ./tmgmt.module
Attempts to check out a number of jobs. Performs a number of checks on each job and also allows to alter the behavior through hooks.

File

./tmgmt.api.php, line 254
Hooks provided by the Translation Management module.

Code

function hook_tmgmt_job_checkout_after_alter(&$redirects, &$jobs) {

  // Redirect to custom multi-checkout form if there are multple redirects.
  if (count($redirects) > 2) {
    $redirects = array(
      '/my/custom/checkout/form/' . implode(',', array_keys($jobs)),
    );
  }
}