You are here

function domain_api in Domain Access 6.2

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

Helper function for passing hook_domainload() by reference.

Parameters

$domain: The domain array defined by domain_lookup().

$reset: A boolean flag to clear the static variable if necessary.

Return value

The $domain array, modified by reference by hook_domainload() implementations.

4 calls to domain_api()
domain_default in ./domain.module
Assigns the default settings to domain 0, the root domain.
domain_domains in ./domain.module
Return all active domains (including the default) as an array.
domain_lookup in ./domain.module
Runs a lookup against the {domain} table. One of the two values must be present
domain_view in ./domain.admin.inc
The main administration page, a list of active domains.

File

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

Code

function domain_api($domain, $reset = FALSE) {
  static $_modules;
  if (!isset($_modules) || $reset) {
    $_modules = module_implements('domainload');
  }
  if (!empty($_modules)) {
    foreach ($_modules as $module) {

      // Cannot use module_invoke_all() since these are passed by reference.
      $function = $module . '_domainload';
      $function($domain);
    }
  }
  return $domain;
}