You are here

function devel_exit in Devel 5

Same name and namespace in other branches
  1. 6 devel.module \devel_exit()

File

./devel.module, line 501

Code

function devel_exit($destination = NULL) {
  global $user;
  if (isset($destination)) {

    // The page we are leaving is a drupal_goto(). Present a redirection page
    // so that the developer can see the intermediate query log.
    if (isset($user) && function_exists('user_access') && user_access('access devel information') && variable_get('devel_redirect_page', 0)) {
      $output = t('<p>The user is being redirected to <a href="@destination">@destination</a>.</p>', array(
        '@destination' => $destination,
      ));
      print theme('page', $output);

      // Don't allow the automatic redirect to happen.
      drupal_page_footer();
      exit;
    }
    else {

      // Make sure not to print anything before the automatic redirect.
      return;
    }
  }
}