You are here

function theme_tweetbutton_follow_display in Tweet Button 7

Same name and namespace in other branches
  1. 8 tweetbutton.module \theme_tweetbutton_follow_display()
  2. 7.2 tweetbutton.module \theme_tweetbutton_follow_display()
1 theme call to theme_tweetbutton_follow_display()
tweetbutton_block_view in ./tweetbutton.module
Implementation of hook_block_configure

File

./tweetbutton.module, line 263

Code

function theme_tweetbutton_follow_display($variables) {
  $script_url = url('http://platform.twitter.com/widgets.js', array(
    'external' => TRUE,
    'https' => TRUE,
  ));
  drupal_add_js($script_url, array(
    'type' => 'external',
    'scope' => 'footer',
  ));
  $options = $variables['options'];
  $screen_name = $variables['screen_name'];
  if (empty($screen_name)) {
    $screen_name = variable_get('tweetbutton_follow_screen_name');
  }
  $follow_user_text = isset($options['tweetbutton_label']) ? $options['tweetbutton_label'] : t('Follow !screen_name', array(
    '!screen_name' => $screen_name,
  ));
  $twitter_account_link = 'http://twitter.com/' . $screen_name;
  $attributes = tweetbutton_follow_get_attributes($options);
  $follow_link = l($follow_user_text, $twitter_account_link, array(
    'attributes' => $attributes,
    'external' => TRUE,
    'https' => TRUE,
  ));
  $link = '<div class="tweetbutton-follow tweetbutton">' . $follow_link . '</div>';
  return $link;
}