function _fb_api_init in Drupal for Facebook 6.2
Same name and namespace in other branches
- 5.2 fb.module \_fb_api_init()
- 5 fb.module \_fb_api_init()
- 6.3 fb.module \_fb_api_init()
- 7.3 fb.module \_fb_api_init()
Wrapper function for fb_api_init. This helps for functions that should work whether or not we are on a canvas page. For canvas pages, the active fb object is used. For non-canvas pages, it will initialize the API using an infinite session, if configured.
Parameters
$fb_app Note this is ignored on canvas pages.:
This is for internal use. Third party modules use fb_api_init().
1 call to _fb_api_init()
File
- ./
fb.module, line 260
Code
function _fb_api_init($fb_app = NULL) {
$fb = $GLOBALS['_fb'];
// Default to active app on canvas pages
if (!$fb && $fb_app) {
// Otherwise, log into facebook api.
$fb = fb_api_init($fb_app, FB_FBU_ANY);
}
if (!$fb) {
watchdog('fb', '%function unable to initialize Facebook API.', array(
'%function' => '_fb_api_init()',
), WATCHDOG_ERROR);
return;
}
else {
return $fb;
}
}