You are here

function fb_canvas_footer in Drupal for Facebook 6.2

Same name and namespace in other branches
  1. 5.2 fb_canvas.module \fb_canvas_footer()

Implementation of hook_footer().

Invoke FB_OP_CANVAS_FBJS_INIT, allowing other modules to insert FBJS to the current page.

File

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

Code

function fb_canvas_footer($main = 0) {
  if (fb_canvas_is_fbml()) {

    // Add FBJS only to FBML pages.
    global $_fb, $_fb_app;
    $data = array(
      'fb' => $_fb,
      'fb_app' => $_fb_app,
    );
    $extra = fb_invoke(FB_OP_CANVAS_FBJS_INIT, $data, array());
    if (count($extra)) {
      $extra_js = implode("\n", $extra);
      fb_add_js('', '');

      // prime javascript
      drupal_add_js($extra_js, 'inline', 'fbml');
    }
  }
}