You are here

function better_statistics_views_data_alter in Better Statistics 6

Same name and namespace in other branches
  1. 7 views/better_statistics.views.inc \better_statistics_views_data_alter()

Implements hook_views_data_alter().

Exposes the fields this module's added to the accesslog to views.

File

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

Code

function better_statistics_views_data_alter(&$data) {

  // Fetch the fields defined by this module.
  module_load_include('inc', 'better_statistics', 'better_statistics.helpers');
  $fields = _better_statistics_define_fields();

  // For each field, expose the field to Views.
  foreach ($fields as $name => $field) {
    $data['accesslog'][$name] = _better_statistics_views_field($name);
  }
}