You are here

function twitter_signin_block_view in Twitter 7.5

Same name and namespace in other branches
  1. 7.6 twitter_signin/twitter_signin.module \twitter_signin_block_view()
  2. 7.3 twitter_signin/twitter_signin.module \twitter_signin_block_view()
  3. 7.4 twitter_signin/twitter_signin.module \twitter_signin_block_view()

Implements hook_block_view().

File

twitter_signin/twitter_signin.module, line 42
Hook implementations for Twitter Signin module.

Code

function twitter_signin_block_view($delta) {

  // Don't do anything if the credentials haven't been set up yet.
  $key = variable_get('twitter_consumer_key', '');
  $secret = variable_get('twitter_consumer_secret', '');
  if (empty($key) || empty($secret)) {
    return;
  }
  global $user;
  if (!$user->uid) {
    $block['subject'] = t('Sign in with Twitter');
    $block['content'] = twitter_signin_button();
    return $block;
  }
}