function forena_json in Forena Reports 7.4
Same name and namespace in other branches
- 7.5 forena.module \forena_json()
Output forena data as JSON objects.
Parameters
unknown $block_name:
string $parms:
1 string reference to 'forena_json'
- forena_menu in ./
forena.module - Implementation of hook_menu.
File
- ./
forena.module, line 571
Code
function forena_json($block_name, $parms = NULL) {
$block_name = str_replace('.', '/', $block_name);
if ($parms === NULL) {
$parms = array_merge($_GET, $_POST);
unset($parms['q']);
}
$data = forena_data($block_name, $parms);
$ret = array();
if ($data) {
foreach ($data as $row) {
$ret[] = $row;
}
}
drupal_json_output($ret);
}