| 1 |
<?php |
<?php |
| 2 |
// $Id: path_redirect.admin.inc,v 1.1.2.48 2009/11/04 06:10:31 davereid Exp $ |
// $Id: path_redirect.admin.inc,v 1.1.2.49 2009/11/04 06:14:00 davereid Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 239 |
'#title' => t('Display a warning message to users when they are redirected.'), |
'#title' => t('Display a warning message to users when they are redirected.'), |
| 240 |
'#default_value' => path_redirect_var('redirect_warning'), |
'#default_value' => path_redirect_var('redirect_warning'), |
| 241 |
); |
); |
|
|
|
| 242 |
$form['path_redirect_allow_bypass'] = array( |
$form['path_redirect_allow_bypass'] = array( |
| 243 |
'#type' => 'checkbox', |
'#type' => 'checkbox', |
| 244 |
'#title' => t('Allow users to bypass redirects by adding %code to the URL.', array('%code' => variable_get('clean_url', 0) ? '?redirect=no' : '&redirect=no')), |
'#title' => t('Allow users to bypass redirects by adding %code to the URL.', array('%code' => variable_get('clean_url', 0) ? '?redirect=no' : '&redirect=no')), |
| 245 |
'#default_value' => path_redirect_var('allow_bypass'), |
'#default_value' => path_redirect_var('allow_bypass'), |
| 246 |
); |
); |
|
|
|
| 247 |
$form['path_redirect_auto_redirect'] = array( |
$form['path_redirect_auto_redirect'] = array( |
| 248 |
'#type' => 'checkbox', |
'#type' => 'checkbox', |
| 249 |
'#title' => t('Automatically create redirects when URL aliases are changed.'), |
'#title' => t('Automatically create redirects when URL aliases are changed.'), |
| 250 |
'#default_value' => path_redirect_var('auto_redirect'), |
'#default_value' => path_redirect_var('auto_redirect'), |
| 251 |
'#access' => module_exists('path'), |
'#access' => module_exists('path'), |
| 252 |
); |
); |
|
|
|
| 253 |
$form['path_redirect_purge_inactive'] = array( |
$form['path_redirect_purge_inactive'] = array( |
| 254 |
'#type' => 'select', |
'#type' => 'select', |
| 255 |
'#title' => t('Discard redirects that have not been accessed for'), |
'#title' => t('Discard redirects that have not been accessed for'), |
| 256 |
'#default_value' => path_redirect_var('purge_inactive'), |
'#default_value' => path_redirect_var('purge_inactive'), |
| 257 |
'#options' => array(0 => t('Never (do not discard)')) + drupal_map_assoc(array(604800, 1209600, 2419200, 4838400, 7257600, 9676800, 31536000), 'format_interval'), |
'#options' => array(0 => t('Never (do not discard)')) + drupal_map_assoc(array(604800, 1209600, 2419200, 4838400, 7257600, 9676800, 31536000), 'format_interval'), |
| 258 |
); |
); |
|
|
|
|
$status_options = array(); |
|
|
$status_descriptions = array(); |
|
|
foreach (path_redirect_status_codes() as $code => $details) { |
|
|
$status_options[$code] = $details['title']; |
|
|
$status_descriptions[] = $details['title'] .': '. $details['description']; |
|
|
} |
|
| 259 |
$form['path_redirect_default_status'] = array( |
$form['path_redirect_default_status'] = array( |
| 260 |
'#type' => 'select', |
'#type' => 'select', |
| 261 |
'#title' => t('Default redirect status'), |
'#title' => t('Default redirect status'), |
| 262 |
'#description' => theme('item_list', $status_descriptions) . t('You can find more information about HTTP redirect status codes at <a href="@link">@link</a>.', array('@link' => 'http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3')), |
'#description' => t('You can find more information about HTTP redirect status codes at <a href="@status-codes">@status-codes</a>.', array('@status-codes' => 'http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#3xx_Redirection')), |
| 263 |
'#default_value' => path_redirect_var('default_status'), |
'#default_value' => path_redirect_var('default_status'), |
| 264 |
'#options' => $status_options, |
'#options' => path_redirect_status_code_options(), |
| 265 |
); |
); |
| 266 |
|
|
| 267 |
return system_settings_form($form); |
return system_settings_form($form); |