You are here

function theme_tweetbutton_tweet_display in Tweet Button 7.2

Same name and namespace in other branches
  1. 8 tweetbutton.module \theme_tweetbutton_tweet_display()
2 theme calls to theme_tweetbutton_tweet_display()
tweetbutton_block_view in ./tweetbutton.module
Implements hook_block_configure().
tweetbutton_field_formatter_view in ./tweetbutton.module
Implements hook_field_formatter_view().

File

./tweetbutton.module, line 388

Code

function theme_tweetbutton_tweet_display($variables) {
  $script_url = _tweetbutton_get_widgets_js_url();
  drupal_add_js($script_url, array(
    'type' => 'external',
    'scope' => 'footer',
  ));
  $options = $variables['options'];
  $attributes = tweetbutton_tweet_get_attributes($options);
  $tweetbutton_label = isset($options['tweetbutton_label']) ? $options['tweetbutton_label'] : t('Tweet');
  $tweet_link = l($tweetbutton_label, 'http://twitter.com/share', array(
    'attributes' => $attributes,
    'external' => TRUE,
    'https' => TRUE,
  ));
  $link = '<div class="tweetbutton-tweet tweetbutton">' . $tweet_link . '</div>';
  return $link;
}