You are here

function domain_get_uri in Domain Access 7.3

Same name and namespace in other branches
  1. 5 domain.module \domain_get_uri()
  2. 6.2 domain.module \domain_get_uri()
  3. 7.2 domain.module \domain_get_uri()

Determine an absolute path to the current page.

Parameters

$domain: The currently active $domain array, provided by domain_lookup().

Return value

The absolute url to the current page on the requested domain.

8 calls to domain_get_uri()
domain_alias_init in domain_alias/domain_alias.module
Implements hook_init().
domain_block_view_switcher in ./domain.blocks.inc
A nifty little domain-switcher block, useful during debugging.
domain_goto in ./domain.module
Determine if we must switch the active domain.
domain_init in ./domain.module
Implements hook_init().
domain_overview_form in ./domain.admin.inc
Create an overview form for sorting domains and other quick actions.

... See full list

1 string reference to 'domain_get_uri'
domain_nav_render in domain_nav/domain_nav.module
Renders output for the block.

File

./domain.module, line 1659
Core module functions for the Domain Access suite.

Code

function domain_get_uri($domain) {
  global $base_path;
  $modules = _domain_path_modules();
  if (!empty($modules) && !drupal_is_front_page()) {

    // request_path() does not include base_path, which will be added by the
    // call to url() below.
    $request_uri = request_path();
    $options = array();

    // If needed, let modules modify the path alias.
    // We cannot use URL here because we need the domain_id data.
    // TODO: use url() but pass a domain_id option?
    domain_path($domain['domain_id'], $request_uri, $options, $_GET['q']);
    $request_uri = base_path() . $request_uri;
  }
  else {
    $request_uri = request_uri();
  }
  $path = domain_check_scheme($domain['scheme']) . '://' . $domain['subdomain'] . $request_uri;
  return $path;
}