You are here

function analytics_reports_overview in Analytics 6

Page callback for analytics overview page.

1 string reference to 'analytics_reports_overview'
analytics_ui_menu in modules/analytics_ui/analytics_ui.module
Implementation of hook_menu().

File

modules/analytics_ui/analytics_ui.admin.inc, line 10

Code

function analytics_reports_overview() {
  $list = Analytic::listEvents();
  $events = array();
  foreach ($list as $key => $value) {
    $events[$key] = new AnalyticData();
    $events[$key]
      ->setEventId($key);
  }
  $overview = array();
  foreach ($events as $id => $event) {
    $overview[] = array(
      'event_name' => $event
        ->getEventName(),
      'instances' => $event
        ->getCountEventInstance(),
      'daily_instances' => $event
        ->getCountEventInstance('daily'),
      'weekly_instances' => $event
        ->getCountEventInstance('weekly'),
      'event_link' => l('view more', 'admin/reports/analytics/event/' . $id),
    );
  }
  return theme('analytics_reports_overview', $overview);
}