'admin/settings/globalredirect',
'title' => t('Global Redirect'),
'description' => t('Chose which features you would like enabled for Global Redirect'),
'access' => user_access('administer site configuration'),
'callback' => 'drupal_get_form',
'callback arguments' => array('globalredirect_admin_settings'),
);
return $items;
}
}
/**
* Function to generate the form setting array
*/
function globalredirect_admin_settings() {
$form = array();
$form['globalredirect_deslash'] = array(
'#type' => 'radios',
'#title' => t('Deslash'),
'#description' => t('If enabled, this option will remove the trailing slash from requests. This stops requests such as example.com/node/1/
failing to match the corresponding alias and can cause duplicate content. On the other hand, if you require certain requests to have a trailing slash, this feature can cause problems so may need to be disabled.'),
'#options' => array(
GLOBALREDIRECT_FEATURE_DISABLED => t('Off'),
GLOBALREDIRECT_DESLASH_ENABLED => t('On'),
),
'#default_value' => variable_get('globalredirect_deslash', GLOBALREDIRECT_DESLASH_ENABLED),
);
$form['globalredirect_nonclean2clean'] = array(
'#type' => 'radios',
'#title' => t('Non-clean to Clean'),
'#description' => t('If enabled, this option will redirect from non-clean to clean URL (if Clean URL\'s are enabled). This will stop, for example, node 1 existing on both example.com/node/1
AND example.com?q=node/1
.'),
'#options' => array(
GLOBALREDIRECT_FEATURE_DISABLED => t('Off'),
GLOBALREDIRECT_NONCLEAN2CLEAN_ENABLED => t('On'),
),
'#default_value' => variable_get('globalredirect_nonclean2clean', GLOBALREDIRECT_NONCLEAN2CLEAN_ENABLED),
);
$form['globalredirect_trailingzero'] = array(
'#type' => 'radios',
'#title' => t('Remove Trailing Zero Argument'),
'#description' => t('If enabled, any instance of "/0" will be trimmed from the right of the URL. This stops duplicate pages such as "taxonomy/term/1" and "taxonomy/term/1/0" where 0 is the default depth. There is an option of limiting this feature to taxonomy term pages ONLY or allowing it to effect any page. By default this feature is disabled to avoid any unexpected behaviour'),
'#options' => array(
GLOBALREDIRECT_FEATURE_DISABLED => t('Disabled'),
GLOBALREDIRECT_TRAILINGZERO_TAXTERM => t('Enabled for taxonomy term pages only'),
GLOBALREDIRECT_TRAILINGZERO_ALL => t('Enabled for all pages'),
),
'#default_value' => variable_get('globalredirect_trailingzero', GLOBALREDIRECT_FEATURE_DISABLED),
);
$form['globalredirect_case_sensitive_urls'] = array(
'#type' => 'radios',
'#title' => t('Case Sensitive URLs'),
'#description' => t('If enabled, the module will compare the current URL to the alias stored in the system. If there are any differences in case then the user will be redirected to the correct URL.'),
'#options' => array(
GLOBALREDIRECT_FEATURE_DISABLED => t('Off'),
GLOBALREDIRECT_CASE_SENSITIVE_URLS_ENABLED => t('On'),
),
'#default_value' => variable_get('globalredirect_case_sensitive_urls', GLOBALREDIRECT_CASE_SENSITIVE_URLS_ENABLED),
);
return system_settings_form($form);
}