You are here

function fb_canvas_goto in Drupal for Facebook 6.2

Same name and namespace in other branches
  1. 5.2 fb_canvas.module \fb_canvas_goto()
  2. 6.3 fb_canvas.module \fb_canvas_goto()
  3. 7.3 fb_canvas.module \fb_canvas_goto()

Uses $_fb->redirect on canvas pages, otherwise drupal_goto.

1 call to fb_canvas_goto()
fb_canvas_fb in ./fb_canvas.module
Implementation of hook_fb().

File

./fb_canvas.module, line 610
This module provides support for Canvas page applications. Use Drupal to power traditional Facebook Apps.

Code

function fb_canvas_goto($path) {
  global $_fb, $_fb_app;
  if ($_fb && (fb_canvas_is_fbml() || fb_canvas_is_iframe())) {
    $url = fb_canvas_fix_url(url($path, array(
      'absolute' => TRUE,
    )), $_fb_app);

    // Allow modules to react to the end of the page request before redirecting.
    // We do not want this while running update.php.
    if (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'update') {
      $GLOBALS['_fb_canvas_goto'] = TRUE;

      // prevents fb_canvas_exit from calling redirect.
      module_invoke_all('exit', $url);
    }
    $_fb
      ->redirect($url);
  }
  else {
    drupal_goto($path);
  }
  exit;
}