You are here

function theme_twitter_signin_button in Twitter 6.5

Same name and namespace in other branches
  1. 6.3 twitter_signin/twitter_signin.module \theme_twitter_signin_button()
  2. 6.4 twitter_signin/twitter_signin.module \theme_twitter_signin_button()
  3. 7.6 twitter_signin/twitter_signin.module \theme_twitter_signin_button()
  4. 7.3 twitter_signin/twitter_signin.module \theme_twitter_signin_button()
  5. 7.4 twitter_signin/twitter_signin.module \theme_twitter_signin_button()
  6. 7.5 twitter_signin/twitter_signin.module \theme_twitter_signin_button()

Themable function for an image link for signing in with Twitter.

1 theme call to theme_twitter_signin_button()
twitter_signin_button in twitter_signin/twitter_signin.module
Returns an image link for signing in with Twitter.

File

twitter_signin/twitter_signin.module, line 75
Hook implementations for twitter_signin submodule.

Code

function theme_twitter_signin_button() {
  $button = variable_get('twitter_signin_button', 'Sign-in-with-Twitter-lighter-small.png');
  $class = 'twitter-signin-menuitem';
  if ($button == 'just-text') {
    $item = t('Sign in with Twitter');
    $class .= ' twitter-signin-menuitem-just-text';
    $link = l($item, 'twitter/redirect', array(
      'attributes' => array(
        'class' => $class,
      ),
    ));
  }
  else {
    $img = drupal_get_path('module', 'twitter_signin') . '/images/' . $button;
    $class .= ' twitter-signin-menuitem-image';
    $item = theme('image', $img, t('Sign in with Twitter'));
    $link = l($item, 'twitter/redirect', array(
      'html' => TRUE,
      'attributes' => array(
        'class' => $class,
      ),
    ));
  }
  return $link;
}