You are here

function theme_fb_login_button in Drupal for Facebook 7.4

Same name and namespace in other branches
  1. 6.3 fb.theme.inc \theme_fb_login_button()
  2. 7.3 fb.theme.inc \theme_fb_login_button()
4 theme calls to theme_fb_login_button()
fb_connect_admin_form in ./fb_connect.admin.inc
Form callback.
fb_friend_select_process in ./fb.module
fb_invite_element_process in contrib/fb_invite.module
Process callback for drupal_render element.
_fb_connect_block_login_defaults in ./fb_connect.module
Default markup for our login block.

File

./fb.theme.inc, line 31

Code

function theme_fb_login_button($params) {

  // Merge in defaults
  $params += array(
    'text' => t('Connect'),
    'attributes' => array(),
    'scope' => NULL,
  );
  if (empty($params['onclick'])) {
    $params['onclick'] = 'return FB_JS.clientAuth(null, ' . htmlspecialchars(json_encode($params['scope'])) . ');';
  }
  $params['attributes'] += array(
    'class' => 'fb_login_button_wrapper fb_button_style',
  );
  $markup = '<div ' . drupal_attributes($params['attributes']) . '><a href="#" onclick="' . $params['onclick'] . '"><span>' . $params['text'] . '</span></a></div>';
  return $markup;
}