You are here

function better_statistics_views_data in Better Statistics 7

Implements hook_views_data().

File

views/better_statistics.views.inc, line 56
Views hooks for the Better Statistics module.

Code

function better_statistics_views_data() {
  $data['blocked_ips']['table']['group'] = t('Blocked IPs');

  // For other base tables, explain how we join.
  $data['blocked_ips']['table']['join'] = array(
    'accesslog' => array(
      'field' => 'ip',
      'left_field' => 'hostname',
    ),
  );

  // blocked_ips.iid
  $data['blocked_ips']['iid'] = array(
    'title' => t('Blocked IP ID'),
    'help' => t('The unique ID of the IP block.'),
    'field' => array(
      'handler' => 'views_handler_field_numeric',
      'click sortable' => TRUE,
    ),
    'argument' => array(
      'handler' => 'views_handler_argument_numeric',
      'name field' => 'iid',
      'numeric' => TRUE,
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_numeric',
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
  );

  // blocked_ips.ip
  $data['blocked_ips']['ip'] = array(
    'title' => t('Block IP'),
    'help' => t('A link to block or unblock the IP from the site.'),
    'field' => array(
      'handler' => 'better_statistics_handler_field_block_ip',
      'click sortable' => FALSE,
    ),
  );
  return $data;
}