function attachment_links_build_links in Attachment Links 6
1 call to attachment_links_build_links()
- template_preprocess_attachment_links in ./attachment_links.module
- Preprocess the output for attachment links.
File
- ./attachment_links.module, line 255
- 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_build_links($node) {
$links = array();
$options = array(
'absolute' => TRUE,
);
$preferred_path = 'node/' . $node->nid . '/attachment';
$links['preferred'] = array(
'url' => $preferred_path,
'weight' => -5,
'default render' => t('Preferred version: !link', array(
'!link' => l(url($preferred_path, $options), $preferred_path),
)),
);
$newest_path = 'node/' . $node->nid . '/attachment/newest';
$links['newest'] = array(
'url' => $newest_path,
'weight' => 0,
'default render' => t('Newest version: !link', array(
'!link' => l(url($newest_path, $options), $newest_path),
)),
);
return $links;
}