You are here

function fb_canvas_goto in Drupal for Facebook 6.3

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

Uses javascript on iframe canvas pages change top frame, otherwise drupal_goto().

See also

drupal_goto()

3 calls to fb_canvas_goto()
fb_example_init in contrib/fb_example.module
Implements hook_init().
fb_friend_request_accept_page in contrib/fb_friend.module
fb_friend_request_submit_page in contrib/fb_friend.module
3 string references to 'fb_canvas_goto'
fb_example_init in contrib/fb_example.module
Implements hook_init().
fb_friend_request_accept_page in contrib/fb_friend.module
fb_friend_request_submit_page in contrib/fb_friend.module

File

./fb_canvas.module, line 261
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_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_canvas_redirect($url);
  }
  else {
    drupal_goto($path);
  }
  exit;
}