You are here

function fb_canvas_nodeapi in Drupal for Facebook 5

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

File

./fb_canvas.module, line 217
This module provides some app-specific navigation to facebook apps. This is fairly experimental material. May change a lot in near future.

Code

function fb_canvas_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  if ($op == 'view' && $node->type == 'fb_app') {

    //dpm(func_get_args(), 'fb_canvas_nodeapi');
    if (user_access('administer fb apps')) {
      $fb_app = $node->fb_app;
      $output = theme('dl', array(
        t('Canvas page') => "http://apps.facebook.com/{$fb_app->canvas}",
        t('Callback URL') => t("%clean_url<br /> (or %advanced_url only if your theme is designed to support PAGE_TYPE.)<br/>Make sure you have enabled clean URLs, and include the trailing '/'.", array(
          "%clean_url" => url('', NULL, NULL, TRUE) . FB_SETTINGS_APP_NID . '/' . $node->nid . '/',
          "%advanced_url" => url('', NULL, NULL, TRUE) . FB_SETTINGS_APP_NID . '/' . $node->nid . '/' . FB_SETTINGS_PAGE_TYPE . '/PAGE_TYPE/',
        )),
      ));
      $node->content['fb_canvas'] = array(
        '#value' => $output,
        '#weight' => 2,
      );
    }
  }
}