You are here

function hook_tmgmt_ui_job_checkout_before_alter in Translation Management Tool 7

Allows to alter job checkout workflow before the default behavior kicks in.

Note: The default behavior will ignore jobs that have already been checked out. Remove jobs from the array to prevent the default behavior for them.

Parameters

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

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

1 invocation of hook_tmgmt_ui_job_checkout_before_alter()
tmgmt_ui_job_checkout_multiple in ui/tmgmt_ui.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

ui/tmgmt_ui.api.php, line 19
API documentation file for Translation Management API.

Code

function hook_tmgmt_ui_job_checkout_before_alter(&$redirects, &$jobs) {
  foreach ($jobs as $job) {

    // Automatically check out all jobs using the default settings.
    $job->translator = 'example';
    $job->translator_context = $job
      ->getTranslator()
      ->getController()
      ->defaultCheckoutSettings();
  }
}