You are here

function enterprise_fields_comment_count in Enterprise Base 7.3

Field callback for meta_info

Parameters

type $variables:

Return value

type

1 string reference to 'enterprise_fields_comment_count'
enterprise_fields_ds_fields_info in enterprise_fields/enterprise_fields.module
Implements hook_ds_fields_info().

File

enterprise_fields/enterprise_fields.module, line 155

Code

function enterprise_fields_comment_count($variables) {
  if (module_exists('comment')) {
    $entity = $variables['entity'];
    if ($entity->comment) {
      $items[] = l(format_plural($entity->comment_count, 'Comment (1)', 'Comments (@count)'), 'node/' . $entity->nid, array(
        'fragment' => 'comments',
      ));
    }
    return theme('item_list', array(
      'items' => $items,
      'attributes' => array(
        'class' => array(
          'meta-info',
        ),
      ),
    ));
  }
}