You are here

function domain_path_domain_path in Domain Path 7

Implements hook_domainpath().

1 call to domain_path_domain_path()
domain_path_domainpath in ./domain_path.module
Implements hook_domainpath().

File

./domain_path.module, line 73
Path alias handling for multiple domains.

Code

function domain_path_domain_path($domain_id, &$path, &$options, $original_path) {

  // Let's not muck with absolute paths.
  if (!empty($options['absolute'])) {
    return;
  }
  $path_language = isset($options['language']->language) ? $options['language']->language : NULL;
  if ($alias = domain_path_lookup_path('alias', $original_path, $domain_id, $path_language)) {
    $path = $alias;
    $options['alias'] = TRUE;
  }
  elseif ($alias = drupal_get_path_alias($original_path, $path_language)) {
    $path = $alias;
    $options['alias'] = TRUE;
  }
}