You are here

function amcharts_get_data in Charts and Graphs 6

1 string reference to 'amcharts_get_data'
amcharts_menu in apis/amcharts/amcharts.module

File

apis/amcharts/amcharts.module, line 48
drupal module file implementing amcharts.

Code

function amcharts_get_data() {
  $cid = check_plain($_GET['cid']);
  $op = check_plain(arg(2));
  if ($op != 'settings' && $op != 'data') {
    drupal_not_found();
    exit;
  }
  $cache = cache_get($cid);
  if (!$cache || empty($cache->data)) {
    drupal_not_found();
    exit;
  }
  $obj = $cache->data;
  $ret = $obj->{$op};
  drupal_set_header('Content-Type: text/xml; charset=utf-8');
  print $ret;
  exit;
}