You are here

public static function Frx::Document in Forena Reports 7.3

Same name and namespace in other branches
  1. 7.5 Frx.inc \Frx::Document()
  2. 7.4 Frx.inc \Frx::Document()

Enter description here ...

Parameters

unknown_type $type:

Return value

FrxDocument

2 calls to Frx::Document()
forena_report_include in ./forena.module
Render report as an inlcude. Don't perform the output fuctnions for the document
FrxReportGenerator::report in ./FrxReportGenerator.inc
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.

File

./Frx.inc, line 81
Frx.incL General Forena Reporting Class

Class

Frx

Code

public static function Document($type = 'web') {
  static $doc_types = '';
  static $objects = '';
  require_once 'FrxDocument.inc';

  // Invoke doc_type hook to see which document types are there.
  if (!$doc_types) {
    $doc_types = module_invoke_all('forena_document_types');
  }
  if (!$type) {
    $type = 'web';
  }
  if (isset($doc_types[$type]) && class_exists(@$doc_types[$type]['class'])) {
    if (!@$doc_types[$type]['object']) {
      $o = new $doc_types[$type]['class']();
      $o->format = $type;
      $doc_types[$type]['object'] = $o;
    }
    else {
      $o = $doc_types[$type]['object'];
    }
    return $o;
  }
  else {
    drupal_set_message(t('Unsupported document type: &s'), array(
      '%s' => $type,
    ), 'error');
  }
}