You are here

function phptemplate_heartbeat_comments in Heartbeat 6.4

Theme function for heartbeat comments

Parameters

$comments Array of comment/reaction objects:

$type Boolean to indicate whether it is a node comment or not:

Return value

String Themed output for comments

File

modules/heartbeat_example/heartbeat_example.module, line 205

Code

function phptemplate_heartbeat_comments($comments, $uaid, $node_comment = FALSE, $has_more = FALSE) {
  $output = '';
  $comment = current($comments);
  $output .= '<ul class="summary" id="heartbeat-comments-list-' . $uaid . '">';
  if (!empty($comments)) {
    $i = 1;
    foreach ($comments as $comment) {
      $last = count($comments) == $i ? TRUE : FALSE;
      $i++;
      $output .= theme('heartbeat_comment', $comment, $node_comment, $last);
    }
  }

  // Add more button.
  if ($has_more) {
    $link = heartbeat_comments_load_more_link($uaid, $node_comment, isset($comment->nid) ? $comment->nid : 0);
    $output .= '<li class="heartbeat-comment heartbeat-comment-more">' . $link . '</li>';
  }
  $output .= '</ul>';
  return $output;
}