You are here

function yandex_metrics_ajax in Yandex.Metrics 6

Same name and namespace in other branches
  1. 7 yandex_metrics.module \yandex_metrics_ajax()

Menu callback; outputs content of one of the 4 reports. It is intended for AJAX calls.

Parameters

$counter_id:

$filter:

$type:

Return value

void

1 string reference to 'yandex_metrics_ajax'
yandex_metrics_menu in ./yandex_metrics.module
Implementation of hook_menu().

File

./yandex_metrics.module, line 1054
The main code of Yandex.Metrics module.

Code

function yandex_metrics_ajax($counter_id, $filter, $type) {
  $output = '';
  switch ($type) {
    case 'visits_chart':
      $output = _yandex_metrics_visits_chart($counter_id, $filter);
      break;
    case 'sources_chart':
      $output = _yandex_metrics_sources_chart($counter_id, $filter);
      break;
    case 'search_phrases':
      $output = _yandex_metrics_search_phrases($counter_id, $filter);
      break;
    case 'popular_content':
      $output = _yandex_metrics_popular_content($counter_id, $filter);
      break;
    case 'geo_chart':
      $output = _yandex_metrics_geo_chart($counter_id, $filter);
      break;
    default:
      break;
  }
  print $output;
  die;
}