You are here

function service_links_link in Service links 6

Same name and namespace in other branches
  1. 5 service_links.module \service_links_link()
  2. 6.2 service_links.module \service_links_link()

Implementation of hook_link().

File

./service_links.module, line 285
Current Maintainer: Fabio Mucciante aka TheCrow Original Author: Fredrik Jonsson fredrik at combonet dot se A module that adds Digg, del.icio.us, reddit, Technorati etc. links to nodes.

Code

function service_links_link($type, $node = NULL, $teaser = FALSE) {
  $links = array();
  switch (variable_get('service_links_in_links', 0)) {
    case 0:
      $show_links = FALSE;
      break;
    case 1:
      $show_links = $teaser ? TRUE : FALSE;
      break;
    case 2:
      $show_links = $teaser ? FALSE : TRUE;
      break;
    case 3:
      $show_links = TRUE;
      break;
    default:
      $show_links = FALSE;
  }
  $links_show = _service_links_show($node);
  if ($type == 'node' && $links_show && $show_links && user_access('access service links')) {
    $links = service_links_render($node, TRUE);
  }
  return $links;
}