views-views-json-style-simple.tpl.php in Views Datasource 6
File
theme/views-views-json-style-simple.tpl.php
View source
<?php
$jsonp_prefix = $options['jsonp_prefix'];
if ($view->override_path) {
$json = _views_json_encode_formatted($rows, $options);
if (isset($_GET[$jsonp_prefix]) && $jsonp_prefix) {
$json = $_GET[$jsonp_prefix] . '(' . $json . ')';
}
print "<code>{$json}</code>";
}
else {
$json = json_encode($rows);
if ($jsonp_prefix) {
$json = "{$jsonp_prefix}({$json})";
}
if ($options['using_views_api_mode']) {
print $json;
}
else {
$content_type = $options['content_type'] == 'default' ? 'application/json' : $options['content_type'];
drupal_set_header("Content-Type: {$content_type}; charset=utf-8");
print $json;
drupal_page_footer();
exit;
}
}