function nodeblock_link in Nodeblock 6
Same name and namespace in other branches
- 5 nodeblock.module \nodeblock_link()
Implementation of hook_link().
File
- ./
nodeblock.module, line 156 - Enables use of specified node types as custom blocks.
Code
function nodeblock_link($type, $node = NULL, $teaser = FALSE) {
$links = array();
if ($type == 'node' && nodeblock_type_enabled($node)) {
if (!module_exists('admin_links') && node_access('update', $node)) {
$links['nodeblock_edit'] = array(
'title' => t('Edit'),
'href' => 'node/' . $node->nid . '/edit',
'query' => drupal_get_destination(),
);
}
if (!module_exists('admin_links') && module_exists('translation') && _translation_tab_access($node)) {
$links['nodeblock_translate'] = array(
'title' => t('Translate'),
'href' => 'node/' . $node->nid . '/translate',
'query' => drupal_get_destination(),
);
}
if (user_access('administer blocks')) {
$links['nodeblock_configure'] = array(
'title' => t('Configure'),
'href' => 'admin/build/block/configure/nodeblock/' . $node->nid,
'query' => drupal_get_destination(),
);
}
}
return $links;
}