You are here

protected function LingotekWorkbenchRedirectController::generateWorkbenchUri in Lingotek Translation 4.0.x

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

Generates a workbench uri for this account given a document id and locale.

Parameters

string $document_id: The document id.

string $locale: Lingotek translation language.

\Drupal\Core\Config\Config $account: Config with the account settings.

Return value

string The uri of the workbench for this account for editing this translation.

1 call to LingotekWorkbenchRedirectController::generateWorkbenchUri()
LingotekWorkbenchRedirectController::redirectToWorkbench in src/Controller/LingotekWorkbenchRedirectController.php
Redirects to the workbench of the given document and locale in the TMS.

File

src/Controller/LingotekWorkbenchRedirectController.php, line 92

Class

LingotekWorkbenchRedirectController
Controller for redirecting to the Lingotek TMS workbench.

Namespace

Drupal\lingotek\Controller

Code

protected function generateWorkbenchUri($document_id, $locale, $account) {
  $base_url = $account
    ->get('host');

  // https://{environment}/workbench/document/{uuid}/locale/{es-MX}
  $workbench_uri = $base_url . '/workbench/document/' . $document_id . '/locale/' . $locale;
  return $workbench_uri;
}