You are here

function attachment_links_nodeapi in Attachment Links 6

Implementation of hook_nodeapi().

Parameters

$node The node being operated on.:

$op The operation being performed. This implementation responds to:: "view"

$a3 For "view", passes in the $teaser parameter from node_view().:

$a4 Ignored.:

Return value

None.

File

./attachment_links.module, line 130
The Attachment Links module provides permanent links to files attached to a node. A single, easy-to-remember URL can be used to retrieve the preferred (canonical) or newest version of a file regardless of how many versions of that file have been…

Code

function attachment_links_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  if (variable_get("attachment_links_{$node->type}", 0) == 0 || empty($node->files)) {
    return;
  }
  if ($op == 'view' && $a3 == FALSE && user_access('view uploaded files')) {
    $node->content['attachment_links'] = array(
      '#value' => theme('attachment_links', $node, 'node'),
      '#weight' => 3,
    );
  }
}