function fboauth_block_view in Facebook OAuth (FBOAuth) 7.2
Same name and namespace in other branches
- 6 fboauth.module \fboauth_block_view()
- 7 fboauth.module \fboauth_block_view()
Implements hook_block_view().
File
- ./
fboauth.module, line 104
Code
function fboauth_block_view($delta) {
$block = array();
if (variable_get('fboauth_id', '') && !fboauth_fbid_load()) {
// Set the redirect to the current page (unless we're on the login page).
$destination = drupal_get_destination();
$redirect = arg(0) === 'user' && (arg(1) === 'login' || arg(1) == '') ? NULL : $destination['destination'];
$block['content'] = fboauth_action_display('connect', $redirect);
if (variable_get('fboauth_popup', 1) && !variable_get('fboauth_always_load_js', 0)) {
drupal_add_js(drupal_get_path('module', 'fboauth') . '/fboauth_popup.js');
}
}
return $block;
}