You are here

function tweetbutton_link in Tweet Button 6

Implementation of hook_link

File

./tweetbutton.module, line 100

Code

function tweetbutton_link($entity_type, $entity, $teaser = FALSE) {
  $location = variable_get('tweetbutton_node_location', array(
    'full',
  ));
  if ($entity_type != 'node' || !user_access('access tweetbutton') || empty($location['links']) || !tweetbutton_allowed_path() || !in_array($entity->type, variable_get('tweetbutton_node_types', array(
    'story',
  )), TRUE)) {
    return;
  }
  $links = array();
  $links['tweetbutton'] = array(
    'title' => theme('tweetbutton_display', $entity, array(
      'type' => 'horizontal',
    )),
    'html' => TRUE,
  );
  return $links;
}