You are here

function fb_canvas_custom_theme in Drupal for Facebook 7.4

Same name and namespace in other branches
  1. 7.3 fb_canvas.module \fb_canvas_custom_theme()

Implements hook_custom_theme().

File

./fb_canvas.module, line 42

Code

function fb_canvas_custom_theme() {
  if ($fb_app = fb_canvas_app()) {

    // Include our javascript.
    drupal_add_js(array(
      'fb_canvas' => array(
        'uid' => $GLOBALS['user']->uid,
        'namespace' => $fb_app['namespace'],
        'client_id' => $fb_app['client_id'],
      ),
    ), 'setting');
    drupal_add_js(drupal_get_path('module', 'fb_canvas') . '/fb_canvas.js');
    if (variable_get(FB_CANVAS_VAR_ADD_JS, TRUE)) {

      // Initialize Facebook JS API on canvas pages.
      fb_require_js();
    }
  }
}