Projet

Général

Profil

Révision 08475715

Ajouté par Assos Assos il y a plus de 7 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/ctools/page_manager/plugins/task_handlers/http_response.inc
3 3
/**
4 4
 * @file
5 5
 *
6
 * This is the task handler plugin to handle generating 403, 404 and 301 response codes.
6
 * This is the task handler plugin to handle generating 403, 404, 301 and 302
7
 * response codes.
7 8
 */
8 9

  
9 10
// Plugin definition
......
108 109
    403 => t('403 Access denied'),
109 110
    404 => t('404 Page not found'),
110 111
    410 => t('410 Gone'),
111
    301 => t('301 Redirect'),
112
    301 => t('301 Permanent redirect'),
113
    302 => t('302 Temporary redirect'),
112 114
  );
113 115
}
114 116

  
......
256 258
    '#type' => 'textfield',
257 259
    '#title' => t('Redirect destination'),
258 260
    '#default_value' => $conf['destination'],
259
    '#dependency' => array('edit-code' => array(301)),
261
    '#dependency' => array('edit-code' => array(301, 302)),
260 262
    '#description' => t('Enter the path to redirect to. You may use keyword substitutions from contexts. You can use external urls (http://www.example.com/foo) or internal urls (node/1).'),
261 263
  );
262 264

  
......
313 315
  }
314 316

  
315 317
  $info['response code'] = $handler->conf['code'];
316
  if ($info['response code'] == 301) {
318
  if ($info['response code'] == 301 || $info['response code'] == 302) {
317 319
    $path = ctools_context_keyword_substitute($handler->conf['destination'], array(), $contexts);
318 320
    $url = parse_url($path);
319 321
    if (isset($url['query'])) {

Formats disponibles : Unified diff