You are here

protected function LingotekWorkbenchController::workbenchPageRedirect in Lingotek Translation 8.2

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

Redirect to the TMS Workbench.

Parameters

string $doc_id: The Lingotek document id.

string $locale: The Lingotek locale.

Return value

\Drupal\Core\Routing\TrustedRedirectResponse A redirect.

Deprecated

Use LingotekWorkbenchRedirectController instead. Since 8.x-2.2.

1 call to LingotekWorkbenchController::workbenchPageRedirect()
LingotekWorkbenchController::loadDocument in src/Controller/LingotekWorkbenchController.php
Load a document for redirect.

File

src/Controller/LingotekWorkbenchController.php, line 47

Class

LingotekWorkbenchController
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['host']);
  return new TrustedRedirectResponse(Url::fromUri($link)
    ->toString());
}