You are here

function theme_cctags_node_links_block in cctags 6

1 theme call to theme_cctags_node_links_block()
cctags_block in ./cctags.module
implementation of hook_block

File

./cctags.module, line 802

Code

function theme_cctags_node_links_block($node, $amount) {
  $output = '';
  if (isset($node->node_links) && is_array($node->node_links)) {
    if ($amount < count($node->node_links) - 1 && $amount > 0) {
      foreach ($node->taxonomy as $tid => $value) {
        $tids[] = $tid;
      }
      $path = 'taxonomy/term/' . implode('+', $tids);
      $more_links = '<div class="more-link">' . l(t('more nodes'), $path) . '</div>';
    }
    $cnt = 1;
    foreach ($node->node_links as $key => $values) {
      if ($amount < $cnt && $amount != 0) {
        break;
      }
      if ($values->nid != $node->nid) {
        $items[] = l($values->title, "node/{$key}", array(
          'attributes' => array(
            'class' => "cctags cctags-nodelinks ccfilter tooltip",
          ),
        ));
        $cnt++;
      }
    }
    $output .= theme('item_list', $items);
    $output .= $more_links;
  }
  if ($cnt == 1) {
    $output = NULL;
  }
  return $output;
}