You are here

public function LingotekWorkbenchRedirectController::redirectToWorkbench in Lingotek Translation 3.4.x

Same name and namespace in other branches
  1. 8.2 src/Controller/LingotekWorkbenchRedirectController.php \Drupal\lingotek\Controller\LingotekWorkbenchRedirectController::redirectToWorkbench()
  2. 4.0.x src/Controller/LingotekWorkbenchRedirectController.php \Drupal\lingotek\Controller\LingotekWorkbenchRedirectController::redirectToWorkbench()
  3. 3.0.x src/Controller/LingotekWorkbenchRedirectController.php \Drupal\lingotek\Controller\LingotekWorkbenchRedirectController::redirectToWorkbench()
  4. 3.1.x src/Controller/LingotekWorkbenchRedirectController.php \Drupal\lingotek\Controller\LingotekWorkbenchRedirectController::redirectToWorkbench()
  5. 3.2.x src/Controller/LingotekWorkbenchRedirectController.php \Drupal\lingotek\Controller\LingotekWorkbenchRedirectController::redirectToWorkbench()
  6. 3.3.x src/Controller/LingotekWorkbenchRedirectController.php \Drupal\lingotek\Controller\LingotekWorkbenchRedirectController::redirectToWorkbench()
  7. 3.5.x src/Controller/LingotekWorkbenchRedirectController.php \Drupal\lingotek\Controller\LingotekWorkbenchRedirectController::redirectToWorkbench()
  8. 3.6.x src/Controller/LingotekWorkbenchRedirectController.php \Drupal\lingotek\Controller\LingotekWorkbenchRedirectController::redirectToWorkbench()
  9. 3.7.x src/Controller/LingotekWorkbenchRedirectController.php \Drupal\lingotek\Controller\LingotekWorkbenchRedirectController::redirectToWorkbench()
  10. 3.8.x src/Controller/LingotekWorkbenchRedirectController.php \Drupal\lingotek\Controller\LingotekWorkbenchRedirectController::redirectToWorkbench()

Redirects to the workbench of the given document and locale in the TMS.

1 string reference to 'LingotekWorkbenchRedirectController::redirectToWorkbench'
lingotek.routing.yml in ./lingotek.routing.yml
lingotek.routing.yml

File

src/Controller/LingotekWorkbenchRedirectController.php, line 71

Class

LingotekWorkbenchRedirectController
Controller for redirecting to the Lingotek TMS workbench.

Namespace

Drupal\lingotek\Controller

Code

public function redirectToWorkbench($doc_id, $locale) {

  // Get account settings to build workbench link.
  $account = $this
    ->config('lingotek.settings')
    ->get('account');

  // Generate the uri to the Lingotek Workbench.
  $uri = $this
    ->generateWorkbenchUri($doc_id, $locale, $account);
  return new TrustedRedirectResponse(Url::fromUri($uri)
    ->toString());
}