| 1 |
<?php |
<?php |
| 2 |
// $Id: path_redirect.admin.inc,v 1.1.2.46 2009/11/04 05:49:46 davereid Exp $ |
// $Id: path_redirect.admin.inc,v 1.1.2.47 2009/11/04 06:00:11 davereid Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 142 |
'#collapsible' => TRUE, |
'#collapsible' => TRUE, |
| 143 |
'#collapsed' => TRUE, |
'#collapsed' => TRUE, |
| 144 |
); |
); |
|
|
|
|
$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']; |
|
|
} |
|
| 145 |
$form['advanced']['type'] = array( |
$form['advanced']['type'] = array( |
| 146 |
'#type' => 'select', |
'#type' => 'select', |
| 147 |
'#title' => t('Redirect status'), |
'#title' => t('Redirect status'), |
| 148 |
'#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' => theme('item_list', path_redirect_status_code_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')), |
| 149 |
'#default_value' => $redirect['type'], |
'#default_value' => $redirect['type'], |
| 150 |
'#options' => $status_options, |
'#options' => path_redirect_status_code_options(), |
| 151 |
); |
); |
| 152 |
|
|
| 153 |
$form['submit'] = array( |
$form['submit'] = array( |
| 277 |
return system_settings_form($form); |
return system_settings_form($form); |
| 278 |
} |
} |
| 279 |
|
|
| 280 |
/** |
function path_redirect_status_code_options() { |
|
* Return an array of 300-range status codes. |
|
|
*/ |
|
|
function path_redirect_status_codes() { |
|
| 281 |
return array( |
return array( |
| 282 |
300 => array( |
300 => t('300 Multiple Choices'), |
| 283 |
'title' => t('300 Multiple Choices'), |
301 => t('301 Moved Permanently'), |
| 284 |
'description' => t('The request is ambiguous and needs clarification as to which resource was requested.'), |
302 => t('302 Found'), |
| 285 |
), |
303 => t('303 See Other'), |
| 286 |
301 => array( |
304 => t('304 Not Modified'), |
| 287 |
'title' => t('301 Moved Permanently'), |
305 => t('305 Use Proxy'), |
| 288 |
'description' => t('The resource has permanently moved elsewhere, the response indicates where it has gone to. <strong>Recommended.</strong>'), |
307 => t('307 Temporary Redirect'), |
| 289 |
), |
); |
| 290 |
302 => array( |
} |
| 291 |
'title' => t('302 Found'), |
|
| 292 |
'description' => t("The resource has temporarily moved elsewhere, the response indicates where it is at present. <strong>This is Drupal's default redirect type.</strong>"), |
function path_redirect_status_code_descriptions() { |
| 293 |
), |
return array( |
| 294 |
303 => array( |
300 => t('!300: The request is ambiguous and needs clarification as to which resource was requested.', array('!300' => t('300 Multiple Choices'))), |
| 295 |
'title' => t('303 See Other'), |
301 => t('!301: The resource has permanently moved elsewhere, the response indicates where it has gone to. <strong>Recommended.</strong>', array('!301' => t('301 Moved Permanently'))), |
| 296 |
'description' => t('A preferred alternative source should be used at present.'), |
302 => t("!302: The resource has temporarily moved elsewhere, the response indicates where it is at present. <strong>This is Drupal's default redirect type.</strong>", array('!302' => t('302 Found'))), |
| 297 |
), |
303 => t('!303: A preferred alternative source should be used at present.', array('!303' => t('303 See Other'))), |
| 298 |
304 => array( |
304 => t("!304: The server has identified from the request information that the client's copy of the information is up-to-date and the requested information does not need to be sent again.", array('!304' => t('304 Not Modified'))), |
| 299 |
'title' => t('304 Not Modified'), |
5305 => t('!305: The request must be sent through the indicated proxy server.', array('!305' => t('305 Use Proxy'))), |
| 300 |
'description' => t("The server has identified from the request information that the client's copy of the information is up-to-date and the requested information does not need to be sent again."), |
307 => t('!307: The resource has temporarily moved elsewhere, the response indicates where it is at present. Client should still use this URL.', array('!307' => t('307 Temporary Redirect'))), |
|
), |
|
|
305 => array( |
|
|
'title' => t('305 Use Proxy'), |
|
|
'description' => t('The request must be sent through the indicated proxy server.'), |
|
|
), |
|
|
307 => array( |
|
|
'title' => t('307 Temporary Redirect'), |
|
|
'description' => t('The resource has temporarily moved elsewhere, the response indicates where it is at present. Client should still use this URL.'), |
|
|
), |
|
| 301 |
); |
); |
| 302 |
} |
} |
| 303 |
|
|