You are here

function theme_activity_comments_comments in Activity 7

Same name and namespace in other branches
  1. 6.2 activity_comments/activity_comments.module \theme_activity_comments_comments()

Theme up all the comments

1 theme call to theme_activity_comments_comments()
activity_comments_form in activity_comments/activity_comments.module
Add comment form.

File

activity_comments/activity_comments.module, line 275
Provides comment handling for activity messages

Code

function theme_activity_comments_comments($variables) {
  $aid = $variables['aid'];
  $comments = $variables['comments'];
  $limit = $variables['limit'];
  $items = array();
  $count = 0;
  foreach ($comments as $comment) {
    $hide = ++$count > $limit;
    $classes = array(
      'activity-comment-wrapper',
    );
    if ($hide) {
      $classes[] = 'activity-comment-hidden';
    }
    $items[] = array(
      'data' => theme('activity_comments_comment', array(
        'comment' => $comment,
      )),
      'class' => $classes,
    );
  }
  return theme('item_list', array(
    'items' => $items,
    'title' => NULL,
    'type' => 'ul',
    'attributes' => array(
      'id' => 'activity_comments-' . $aid,
      'class' => 'activity-comment-list',
    ),
  ));
}