You are here

function _fb_social_send_link in Facebook social plugins integration 6.2

Same name and namespace in other branches
  1. 7.2 plugins/fb_plugin/send.inc \_fb_social_send_link()

Pseudo hook_link for this plugin

1 string reference to '_fb_social_send_link'
send.inc in plugins/fb_plugin/send.inc

File

plugins/fb_plugin/send.inc, line 173

Code

function _fb_social_send_link($preset, $type, $object, $teaser = FALSE) {
  $links = array();

  //only nodes are supported / dont like unpublished nodes
  if ('node' != $type || !$object->status) {
    return $links;
  }

  // if no plugin on teasers continue
  if ($teaser && empty($preset->settings['plugin_location']['node_view_modes']['teaser'])) {
    return $links;
  }

  // if no plugin on teasers continue
  if (!$teaser && empty($preset->settings['plugin_location']['node_view_modes']['full'])) {
    return $links;
  }

  // plugin is not to be displayed in the node links. continue
  if ($preset->settings['plugin_location']['location']) {
    return $links;
  }

  // good to go
  $links = array();
  if (fb_social_preset_node_types($preset, $object->type)) {
    $preset->fb_attrs['href'] = fb_social_url('node/' . $object->nid);
    $link_title = fb_social_preset_view($preset);
    $links['fb-social-send-' . $preset->name] = array(
      'title' => $link_title,
      'html' => TRUE,
    );
  }
  return $links;
}