You are here

function nodeblock_link in Nodeblock 5

Same name and namespace in other branches
  1. 6 nodeblock.module \nodeblock_link()

Implementation of hook_link().

File

./nodeblock.module, line 135

Code

function nodeblock_link($type, $node = NULL, $teaser = FALSE) {
  $links = array();
  if ($type == 'node' && nodeblock_type_enabled($node)) {
    if (node_access('update', $node)) {
      $links['nodeblock_edit'] = array(
        'title' => t('Edit Block'),
        'href' => 'node/' . $node->nid . '/edit',
        'query' => drupal_get_destination(),
      );
    }
    if (user_access('administer blocks')) {
      $links['nodeblock_configure'] = array(
        'title' => t('Configure Block'),
        'href' => 'admin/build/block/configure/nodeblock/' . $node->nid,
        'query' => drupal_get_destination(),
      );
    }
  }
  return $links;
}