You are here

function forena_report in Forena Reports 7.3

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.2 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

4 calls to forena_report()
ForenaViewsPlugin::render in ./ForenaViewsPlugin.inc
Render the display in this style.
forena_report_menu_callback in ./forena.module
Menu callback for rendering the forena report.
FrxReportContext::getValue in plugins/FrxReportContext.inc
_forena_filter_process in ./forena.module
Process tag replacement for xml filters
1 string reference to 'forena_report'
forena_menu in ./forena.module
Implementation of hook_menu.

File

./forena.module, line 800

Code

function forena_report($name_in, $parms = array(), $print = TRUE) {
  require_once 'forena.common.inc';
  $desc = Frx::Menu()
    ->parseURL($name_in);
  if (!$desc['exists']) {
    drupal_set_message(t('Report %s not found', array(
      '%s' => $name_in,
    )), 'error', FALSE);
    return '';
  }
  FrxData::instance()
    ->setContext('cookie', $_COOKIE);
  FrxData::instance()
    ->setContext('forenaReport', $desc);
  $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');
  if ($output) {

    // This has been deprecated, but we'll eave it in for now.
    if ($print) {
      drupal_add_js($m_path . '/forena.js');
    }
    $forena_js = array();
    $forena_js['form'] = preg_replace('/[^\\w\\-]+/u', '_', Frx::Skin()->name);
    $forena_js['report'] = preg_replace('/[^\\w\\-]+/u', '_', $name_in);
    if ($print) {
      drupal_add_js(array(
        'forena' => $forena_js,
      ), 'setting');
    }
    return $output;
  }
}