function addthis_link in AddThis 6.2
Same name and namespace in other branches
- 5.2 addthis.module \addthis_link()
- 6.3 addthis.module \addthis_link()
- 6 addthis.module \addthis_link()
Implementation of hook_link().
File
- ./
addthis.module, line 20 - Stand alone module file to handle AddThis button integration
Code
function addthis_link($type, $node = NULL, $teaser = FALSE) {
$links = array();
if ($type === 'node' && user_access('view addthis')) {
if ($node && variable_get('addthis_nodetype_' . $node->type, 1) && ($teaser && variable_get('addthis_display_in_teasers', '0') || !$teaser && variable_get('addthis_display_in_links', '0'))) {
$links['addthis'] = array(
'title' => _addthis_create_button($node, $teaser),
'html' => TRUE,
);
}
}
return $links;
}