function hosting_alias_settings in Hosting 7.4
Same name and namespace in other branches
- 5 alias/hosting_alias.module \hosting_alias_settings()
- 6.2 alias/hosting_alias.module \hosting_alias_settings()
- 7.3 alias/hosting_alias.module \hosting_alias_settings()
Configuration form for site aliases.
See also
1 string reference to 'hosting_alias_settings'
- hosting_alias_menu in alias/
hosting_alias.module - Implements hook_menu().
File
- alias/
hosting_alias.module, line 492 - Allow sites to have domain aliases that they can be accessed with.
Code
function hosting_alias_settings($form, &$form_state) {
$form['hosting_alias_subdomain'] = array(
'#type' => 'textfield',
'#title' => t('Domain used for automatic subdomain hosting'),
'#description' => t('To be able to provide a temporary url for your sites, you need to have configured a wild card dns entry<br /> resolving all calls to subdomains of your chosen domain, to point at your web server.'),
'#default_value' => variable_get('hosting_alias_subdomain', ''),
);
$form['hosting_alias_subdomain_replace_dash'] = array(
'#type' => 'checkbox',
'#title' => t('Replace dashes'),
'#description' => t('Replace dashes in automatic subdomain aliases. Changes only take effect when a site is verified.'),
'#default_value' => variable_get('hosting_alias_subdomain_replace_dash', TRUE),
);
$form['hosting_alias_subdomain_dash_substitute'] = array(
'#type' => 'textfield',
'#title' => t('Dash substitute'),
'#description' => t('Dashes in automatic subdomain aliases will be replaced with the given value. Changes only take effect when a site is verified.'),
'#default_value' => variable_get('hosting_alias_subdomain_dash_substitute', '--'),
'#states' => array(
'visible' => array(
':input[name="hosting_alias_subdomain_replace_dash"]' => array(
'checked' => TRUE,
),
),
),
);
$form['hosting_alias_automatic_www'] = array(
'#type' => 'checkbox',
'#title' => t('Generate www.domain.com alias automatically'),
'#description' => t('If a domain name does not start with www., automatically create an alias for www.domain?'),
'#default_value' => variable_get('hosting_alias_automatic_www', FALSE),
);
$form['hosting_alias_automatic_no_www'] = array(
'#type' => 'checkbox',
'#title' => t('Generate domain.com alias automatically'),
'#description' => t('If a domain name starts with www., automatically create an alias for domain.com?'),
'#default_value' => variable_get('hosting_alias_automatic_no_www', FALSE),
);
$form['hosting_alias_redirection'] = array(
'#type' => 'checkbox',
'#title' => t('Use redirects instead of aliases by default'),
'#description' => t('Instead of serving the primary domain under a symlinked site alias, this module can also redirect the user to the primary domain from an alias. This setting can be controlled per site. Setting this option here will make redirection the default behavior for site aliases.'),
'#default_value' => variable_get('hosting_alias_redirection', FALSE),
);
$form['#submit'][] = 'hosting_alias_settings_validate';
return system_settings_form($form);
}