function domain_warning_check in Domain Access 5
Same name and namespace in other branches
- 6.2 domain.module \domain_warning_check()
- 7.3 domain.module \domain_warning_check()
- 7.2 domain.module \domain_warning_check()
Sets a message to the site admin.
If our module changes $conf settings, they may be reflected on admin pages when we don't want them to be.
1 call to domain_warning_check()
- domain_form_alter in ./
domain.module - Implement hook_form_alter()
File
- ./
domain.module, line 1452 - Core module functions for the Domain Access suite.
Code
function domain_warning_check($form_id) {
static $_warning;
// If $_POST is set, we are submitting the form and should not set a message.
if (!$_POST && empty($_warning)) {
global $_domain;
// Add the list of forms
$forms = array();
$forms = module_invoke_all('domainwarnings');
if (arg(2) != 'domain' && in_array($form_id, $forms)) {
$default = domain_default();
if ($_domain['domain_id'] != $default['domain_id']) {
$_path = domain_get_uri($default);
drupal_set_message(t('You are viewing #this. This form may need to be entered from <a href="!url">!domain</a>', array(
'#this' => $_domain['subdomain'],
'!url' => $_path,
'!domain' => $default['subdomain'],
)));
}
}
$_warning = TRUE;
}
}