function domain_default in Domain Access 7.2
Same name and namespace in other branches
- 5 domain.module \domain_default()
- 6.2 domain.module \domain_default()
- 7.3 domain.module \domain_default()
Assigns the default settings to domain 0, the root domain.
This value is used throughout the modules. Even though this record is in the {domain} table, we use the value stored as a variable. Doing so prevents the module from firing when it has not been configured.
Parameters
$reset: A boolean flag indicating whether to reset the static array or not.
$alter: A boolean flag indicating whether to allow hook_domainload(). In some cases where external scripts do not pass an HTTP_HOST, Drupal does not behave as expected and we cannot trigger this API call.
Return value
The domain array for the default domain.
See also
12 calls to domain_default()
- domain_check_primary in ./
domain.module - Check to see if a redirect to the primary domain is needed.
- domain_configure_form_submit in ./
domain.admin.inc - Save any changes to the primary domain record.
- domain_form_alter in ./
domain.module - Implements hook_form_alter()
- domain_init in ./
domain.module - Implements hook_init().
- domain_invalid_domain_requested in ./
domain.module - Redirect a request to an invalid domain.
3 string references to 'domain_default'
- domain_enable in ./
domain.module - Upon enabling this module, store the default view grant in the {node_access} table. Then it assigns all users to the primary domain.
- domain_install in ./
domain.install - Implements hook_install()
- domain_view in ./
domain.admin.inc - The main administration page, a list of active domains.
File
- ./
domain.module, line 883 - Core module functions for the Domain Access suite.
Code
function domain_default($reset = FALSE, $alter = TRUE) {
static $default;
if (empty($default) || $reset) {
$default['domain_id'] = 0;
$default['sitename'] = variable_get('domain_sitename', variable_get('site_name', 'Drupal'));
$default['subdomain'] = variable_get('domain_root', '');
$default['scheme'] = variable_get('domain_scheme', 'http');
// Set the valid flag.
$default['valid'] = TRUE;
if ($alter) {
// Let submodules overwrite the defaults, if they wish.
$default = domain_api($default, $reset);
}
}
return $default;
}