You are here

function theme_fb_login_buttonXXX in Drupal for Facebook 6.3

Same name and namespace in other branches
  1. 7.3 fb.theme.inc \theme_fb_login_buttonXXX()

File

./fb.theme.inc, line 78

Code

function theme_fb_login_buttonXXX($text = '', $options = array()) {

  // Merge in defaults
  $options += array(
    'attributes' => array(),
    'connected_markup' => NULL,
  );
  $options['attributes'] += array(
    'class' => 'fb-login-button',
    // important
    'data-show-faces' => 'false',
    'data-max-rows' => 1,
  );
  if (!isset($options['attributes']['scope'])) {

    // Which permissions to prompt for?
    $perms = array();
    drupal_alter('fb_required_perms', $perms);
    if (count($perms)) {
      $options['attributes']['scope'] = implode(',', $perms);
    }
  }
  $button = '<div ' . drupal_attributes($options['attributes']) . '>' . ($text ? check_plain($text) : '') . '</div>';

  // Show picture instead of button when user is connected.
  if ($options['connected_markup']) {
    $button = '<div class=fb_not_connected>' . $button . '</div>' . '<div class=fb_connected>' . $options['connected_markup'] . '</div>';
  }
  return $button;
}