You are here

public function LingotekEntity::getUrl in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.5 lib/Drupal/lingotek/LingotekEntity.php \LingotekEntity::getUrl()
  2. 7.6 lib/Drupal/lingotek/LingotekEntity.php \LingotekEntity::getUrl()

Overrides LingotekTranslatableEntity::getUrl

File

lib/Drupal/lingotek/LingotekEntity.php, line 405
Defines LingotekEntity.

Class

LingotekEntity
A class wrapper for Lingotek-specific behavior on nodes.

Code

public function getUrl($getSource = FALSE) {
  global $base_url;
  $path = entity_uri($this->entity_type, $this->entity);
  if ($getSource && isset($path['path'])) {
    return $this
      ->formatSourceUrl($base_url, $path['path']);
  }
  if ($path) {
    $url = $base_url . "/lingotek/view/" . $this
      ->getEntityType() . '/' . $this->entity_id . '/{locale}';
  }
  drupal_alter('lingotek_source_URL', $url);
  return $url;
}