You are here

function fb_permission_fb in Drupal for Facebook 7.3

Same name and namespace in other branches
  1. 6.2 contrib/fb_permission.module \fb_permission_fb()

File

contrib/fb_permission.module, line 79
Code pertaining to Facebook's extended permissions. see http://wiki.developers.facebook.com/index.php/Extended_permissions

Code

function fb_permission_fb($op, $data, &$return) {
  if ($op == FB_OP_JS && FALSE) {

    // Disabled because the login popup not really working.
    // fb.module is adding javascript to the page footer.
    if (!empty($GLOBALS['_fb_permission_extra_perms'])) {

      // We know from access hook that additional perms are required.
      // Use javascript to ask for them.
      $perms = array();
      drupal_alter('fb_required_perms', $perms);
      $perm_string = json_encode(implode(',', $perms));
      $return['fb_permission_0'] = "debugger;";
      $return['fb_permission'] = "FB.login(function(response){}, {scope:{$perm_string}});";

      // Haven't figured out how to make this dialog work.

      //$return['fb_permission'] = "FB.ui({method:'oauth',scope:$perm_string}, function(response){debugger;});";

      //dpm($return);
    }
  }
}