You are here

function forena_report in Forena Reports 7.2

Same name and namespace in other branches
  1. 8 forena.module \forena_report()
  2. 6.2 forena.module \forena_report()
  3. 6 forena.module \forena_report()
  4. 7.5 forena.module \forena_report()
  5. 7 forena.module \forena_report()
  6. 7.3 forena.module \forena_report()
  7. 7.4 forena.module \forena_report()

Load and render a report based on a drupal path. In this function the arglist is used to get the full path to the report.

Return value

unknown

1 string reference to 'forena_report'
forena_menu in ./forena.module
Implementation of hook_menu.

File

./forena.module, line 507

Code

function forena_report($name_in, $parms = array(), $print = TRUE) {
  require_once 'forena.common.inc';
  $desc = forena_report_desc($name_in);
  if (!$desc['exists']) {
    drupal_not_found();
    exit;
  }
  $report_name = $desc['name'];

  // Load dataTable plugin if possible.
  forena_include_data_tables();
  $output = FrxReportGenerator::instance()
    ->report($name_in, $parms, $print);
  $m_path = drupal_get_path('module', 'forena');
  drupal_add_js($m_path . '/forena.js');
  $forena_js = array();
  $forena_js['form'] = preg_replace('/[^\\w\\-]+/u', '_', FrxReportGenerator::instance()->form);
  $forena_js['report'] = preg_replace('/[^\\w\\-]+/u', '_', $name_in);
  drupal_add_js(array(
    'forena' => $forena_js,
  ), 'setting');
  return $output;
}