You are here

protected function LingotekEntityController::translationsPageRedirect in Lingotek Translation 3.2.x

Same name and namespace in other branches
  1. 8 src/Controller/LingotekEntityController.php \Drupal\lingotek\Controller\LingotekEntityController::translationsPageRedirect()
  2. 8.2 src/Controller/LingotekEntityController.php \Drupal\lingotek\Controller\LingotekEntityController::translationsPageRedirect()
  3. 4.0.x src/Controller/LingotekEntityController.php \Drupal\lingotek\Controller\LingotekEntityController::translationsPageRedirect()
  4. 3.0.x src/Controller/LingotekEntityController.php \Drupal\lingotek\Controller\LingotekEntityController::translationsPageRedirect()
  5. 3.1.x src/Controller/LingotekEntityController.php \Drupal\lingotek\Controller\LingotekEntityController::translationsPageRedirect()
  6. 3.3.x src/Controller/LingotekEntityController.php \Drupal\lingotek\Controller\LingotekEntityController::translationsPageRedirect()
  7. 3.4.x src/Controller/LingotekEntityController.php \Drupal\lingotek\Controller\LingotekEntityController::translationsPageRedirect()
  8. 3.5.x src/Controller/LingotekEntityController.php \Drupal\lingotek\Controller\LingotekEntityController::translationsPageRedirect()
  9. 3.6.x src/Controller/LingotekEntityController.php \Drupal\lingotek\Controller\LingotekEntityController::translationsPageRedirect()
  10. 3.7.x src/Controller/LingotekEntityController.php \Drupal\lingotek\Controller\LingotekEntityController::translationsPageRedirect()
  11. 3.8.x src/Controller/LingotekEntityController.php \Drupal\lingotek\Controller\LingotekEntityController::translationsPageRedirect()
6 calls to LingotekEntityController::translationsPageRedirect()
LingotekEntityController::addTarget in src/Controller/LingotekEntityController.php
LingotekEntityController::checkTarget in src/Controller/LingotekEntityController.php
LingotekEntityController::checkUpload in src/Controller/LingotekEntityController.php
LingotekEntityController::download in src/Controller/LingotekEntityController.php
LingotekEntityController::update in src/Controller/LingotekEntityController.php

... See full list

File

src/Controller/LingotekEntityController.php, line 339

Class

LingotekEntityController

Namespace

Drupal\lingotek\Controller

Code

protected function translationsPageRedirect(EntityInterface $entity) {
  $entity_type_id = $entity
    ->getEntityTypeId();
  $uri = Url::fromRoute("entity.{$entity_type_id}.content_translation_overview", [
    $entity_type_id => $entity
      ->id(),
  ]);
  $entity_type = $entity
    ->getEntityType();
  if ($entity_type
    ->hasLinkTemplate('canonical')) {
    return new RedirectResponse($uri
      ->setAbsolute(TRUE)
      ->toString());
  }
  else {
    return new RedirectResponse($this->request
      ->getUri());
  }
}