function fb_connect_require_feature in Drupal for Facebook 6.2
Same name and namespace in other branches
- 5.2 fb_connect.module \fb_connect_require_feature()
Allows other modules to specify which Facebook Connect features are required. This will affect how the FB_RequireFeatures javascript method is called.
7 calls to fb_connect_require_feature()
- fb_canvas_iframe_excursion in ./
fb_canvas.module - This is intended to help sites which have some FBML and some iframe pages. Makes the current FBML canvas page an iframe. And attempts to preserve session while visiting multiple iframe pages.
- fb_connect_block in ./
fb_connect.module - Implementation of hook_block.
- fb_connect_fb in ./
fb_connect.module - Implementation of hook_fb().
- fb_connect_footer in ./
fb_connect.module - Include facebook javascript in the footer of the current page.
- fb_connect_form_alter in ./
fb_connect.module
File
- ./
fb_connect.module, line 348 - Support for Facebook Connect features
Code
function fb_connect_require_feature($feature = NULL, $fb_app = NULL) {
if ($feature && !isset($fb_app) && isset($GLOBALS['_fb_app'])) {
$fb_app = $GLOBALS['_fb_app'];
}
// some features may apply without an app, but for now let's enforce that an app is required.
if ($feature && !isset($fb_app)) {
return;
}
static $features;
if (!$features) {
_fb_connect_add_js();
// include our javascript.
$features = array();
}
if ($fb_app && !isset($features[$fb_app->apikey])) {
$features[$fb_app->apikey] = array(
'fb_app' => $fb_app,
'features' => array(),
);
}
if ($feature) {
$features[$fb_app->apikey]['features'][$feature] = $feature;
}
return $features;
}