You are here

function addtoany_link in AddToAny Share Buttons 6.3

Same name and namespace in other branches
  1. 5.2 addtoany.module \addtoany_link()
  2. 5 addtoany.module \addtoany_link()
  3. 6 addtoany.module \addtoany_link()
  4. 6.2 addtoany.module \addtoany_link()

Implementation of hook_link().

Parameters

object $type:

object $node [optional]:

object $teaser [optional]:

File

./addtoany.module, line 26
Standalone module file to handle AddToAny button integration

Code

function addtoany_link($type, $node = NULL, $teaser = FALSE) {
  $links = array();
  $types = variable_get('addtoany_nodetypes', array());
  $show = !empty($types[$node->type]) && ($teaser && variable_get('addtoany_display_in_teasers', '1') != 0 || !$teaser && variable_get('addtoany_display_in_nodelink', '1') != 0);
  if ($type === 'node' && $show) {
    $links['addtoany'] = array(
      'title' => _addtoany_create_button($node, $teaser),
      'html' => TRUE,
    );
  }
  return $links;
}