You are here

function fbconnect_login_render_button in Facebook Connect 7.2

Same name and namespace in other branches
  1. 8.2 fbconnect_login/fbconnect_login.module \fbconnect_login_render_button()

Render a custom button to log in via Facebook.

5 calls to fbconnect_login_render_button()
fbconnect_appearance_settings in ./fbconnect.admin.inc
fbconnect_fbapp_settings in ./fbconnect.admin.inc
fbconnect_login_block_view in fbconnect_login/fbconnect_login.module
Implements hook_block_view().
fbconnect_login_form_alter in fbconnect_login/fbconnect_login.module
Implements hook_form_alter().
theme_fbconnect_login_user_profile_tab_unconnected in fbconnect_login/fbconnect_login.pages.inc

File

fbconnect_login/fbconnect_login.module, line 604
Login functionality for Facebook Connect module

Code

function fbconnect_login_render_button($attr = array(), $op = NULL) {
  $user_profile = fbconnect_user_profile();
  if (!$op) {
    $op = $user_profile ? 'login' : 'register';
  }
  list($size) = explode('_', variable_get('fbconnect_button', NULL));
  $default_attr = array(
    'text' => variable_get('fbconnect_button_' . $op . '_text', t('Connect')),
    'size' => $size,
    'background' => 'dark',
    'v' => 3,
  );
  $attr = array_merge($default_attr, $attr);
  $text = $attr['text'];
  unset($attr['text']);
  return theme('fbconnect_login_button', array(
    'text' => $text,
    'attr' => $attr,
    'op' => $op,
    'user_profile' => $user_profile,
  ));
}