You are here

function _fb_social_subscribe_link in Facebook social plugins integration 6.2

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

Pseudo hook_link for this plugin

1 string reference to '_fb_social_subscribe_link'
subscribe.inc in plugins/fb_plugin/subscribe.inc

File

plugins/fb_plugin/subscribe.inc, line 206

Code

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

  //only nodes are supported / dont subscribe 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)) {
    $link_title = fb_social_preset_view($preset);
    $links['fb-social-subscribe-' . $preset->name] = array(
      'title' => $link_title,
      'html' => TRUE,
    );
  }
  return $links;
}