You are here

protected function LingotekWorkbenchController::workbenchPageRedirect in Lingotek Translation 8

Same name and namespace in other branches
  1. 8.2 src/Controller/LingotekWorkbenchController.php \Drupal\lingotek\Controller\LingotekWorkbenchController::workbenchPageRedirect()
1 call to LingotekWorkbenchController::workbenchPageRedirect()
LingotekWorkbenchController::loadDocument in src/Controller/LingotekWorkbenchController.php

File

src/Controller/LingotekWorkbenchController.php, line 15

Class

LingotekWorkbenchController

Namespace

Drupal\lingotek\Controller

Code

protected function workbenchPageRedirect($doc_id, $locale) {

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

  // generate an external link to the Lingotek Workbench
  $link = self::generateWorkbenchLink($doc_id, $locale, $account['default_client_id'], $account['access_token'], $account['login_id'], $account['login_id'], $account['use_production'] ? $account['host'] : $account['sandbox_host']);
  return new TrustedRedirectResponse(Url::fromUri($link)
    ->toString());
}