You are here

function theme_tweetbutton_display in Tweet Button 7

Same name and namespace in other branches
  1. 6 tweetbutton.module \theme_tweetbutton_display()
1 call to theme_tweetbutton_display()
tweetbutton_handler_field_tweet::render in ./tweetbutton_handler_field_tweet.inc
Render the field.
2 theme calls to theme_tweetbutton_display()
tweetbutton_block_view in ./tweetbutton.module
Implementation of hook_block_configure
tweetbutton_node_view in ./tweetbutton.module
Implementation of hook_node_view()

File

./tweetbutton.module, line 226

Code

function theme_tweetbutton_display($variables) {
  $script_url = url('http://platform.twitter.com/widgets.js', array(
    'external' => TRUE,
  ));
  drupal_add_js($script_url, array(
    'type' => 'external',
    'scope' => 'footer',
  ));
  $object = $variables['object'];
  $options = $variables['options'];
  $attributes = tweetbutton_get_attributes($object, $options);
  $tweet_link = l(t('Tweet'), 'http://twitter.com/share', array(
    'attributes' => $attributes,
    'external' => TRUE,
  ));
  $link = '<div class="tweetbutton">' . $tweet_link . '</div>';
  return $link;
}