You are here

function activity_comments_views_data in Activity 7

Same name and namespace in other branches
  1. 6.2 activity_comments/views/activity_comments.views.inc \activity_comments_views_data()

Implementation of hook_views_data().

File

activity_comments/views/activity_comments.views.inc, line 7

Code

function activity_comments_views_data() {
  $data['activity_comments']['table']['group'] = t('Activity comments');
  $data['activity_comments_field']['table']['join'] = array(
    'activity' => array(
      'left_field' => 'aid',
      'field' => 'aid',
    ),
  );
  $data['activity_comments_field']['comment_form'] = array(
    'title' => t('Comments'),
    'help' => t('Comments to activities.'),
    'group' => t('Activity Comments'),
    'field' => array(
      'handler' => 'activity_comments_handler_field_comments',
    ),
  );
  $data['activity_comments_stats']['table']['group'] = t('Activity comments');
  $data['activity_comments_stats']['table']['join'] = array(
    'activity' => array(
      'left_field' => 'aid',
      'field' => 'aid',
    ),
  );
  $data['activity_comments_stats']['changed'] = array(
    'title' => t('Changed time'),
    'help' => t('The time when last activity comment was added'),
    'field' => array(
      'handler' => 'views_handler_field_date',
      'click sortable' => TRUE,
    ),
    'sort' => array(
      'handler' => 'views_handler_sort_date',
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_date',
    ),
  );
  $data['activity_comments_stats']['comment_count'] = array(
    'title' => t('Comment count'),
    'help' => t('The comment count on an activity'),
    'field' => array(
      'handler' => 'views_handler_field_numeric',
      'click sortable' => TRUE,
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_numeric',
    ),
  );
  return $data;
}