function page_manager_http_response_render

cis7 http_response.inc page_manager_http_response_render($handler, $base_contexts, $args, $test = TRUE)
cle7 http_response.inc page_manager_http_response_render($handler, $base_contexts, $args, $test = TRUE)
elmsmedia7 http_response.inc page_manager_http_response_render($handler, $base_contexts, $args, $test = TRUE)
icor7 http_response.inc page_manager_http_response_render($handler, $base_contexts, $args, $test = TRUE)
meedjum_blog7 http_response.inc page_manager_http_response_render($handler, $base_contexts, $args, $test = TRUE)
mooc7 http_response.inc page_manager_http_response_render($handler, $base_contexts, $args, $test = TRUE)
1 string reference to 'page_manager_http_response_render'
http_response.inc in sites/all/modules/ulmus/ctools/page_manager/plugins/task_handlers/http_response.inc
This is the task handler plugin to handle generating 403, 404 and 301 response codes.

File

sites/all/modules/ulmus/ctools/page_manager/plugins/task_handlers/http_response.inc, line 252
This is the task handler plugin to handle generating 403, 404 and 301 response codes.

Code

function page_manager_http_response_render($handler, $base_contexts, $args, $test = TRUE) {
  // Go through arguments and see if they match.
  ctools_include('context');
  ctools_include('context-task-handler');

  // Add my contexts
  $contexts = ctools_context_handler_get_handler_contexts($base_contexts, $handler);

  // Test.
  if ($test && !ctools_context_handler_select($handler, $contexts)) {
    return;
  }

  if (isset($handler->handler)) {
    ctools_context_handler_pre_render($handler, $contexts, $args);
  }

  $info['response code'] = $handler->conf['code'];
  if ($info['response code'] == 301) {
    $path = ctools_context_keyword_substitute($handler->conf['destination'], array(), $contexts);
    $url = parse_url($path);
    if (isset($url['query'])) {
      $path = strtr($path, array('?' . $url['query'] => ''));
      $info['query'] = drupal_get_query_array($url['query']);
    }
    if (isset($url['fragment'])) {
      $path = strtr($path, array('#' . $url['fragment'] => ''));
      $info['fragment'] = $url['fragment'];
    }

    $info['destination'] = rtrim($path, '?');
  }

  return $info;
}