You are here

function domain_domains in Domain Access 6.2

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

Return all active domains (including the default) as an array.

Parameters

$reset: A boolean flag indicating whether to reset the static array or not.

Return value

An array of all active domains, with the domain_id as the key.

26 calls to domain_domains()
domain_alias_block in domain_alias/domain_alias.module
Implement hook_block().
domain_batch in ./domain.admin.inc
Allows for the batch update of certain elements.
domain_block in ./domain.module
Implement hook_block()
domain_configure_form in ./domain.admin.inc
FormsAPI for configuring the domain module.
domain_content_add_form_widget in domain_content/domain_content.module
Abstraction function for selecting domains for batch operations.

... See full list

File

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

Code

function domain_domains($reset = FALSE) {
  static $domains;
  if (empty($domains) || $reset) {
    $domains = array();

    // Query the db for active domain records.
    $result = db_query("SELECT domain_id, subdomain, sitename, scheme, valid FROM {domain}");
    while ($domain = db_fetch_array($result)) {
      $domains[$domain['domain_id']] = domain_api($domain, $reset);
      $domains[0] = domain_default();
    }
  }
  $sort = variable_get('domain_sort', 'id');
  uasort($domains, '_domain_' . $sort . '_sort');
  return $domains;
}