You are here

public static function Frx::Document in Forena Reports 7.4

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

Enter description here ...

Parameters

unknown_type $type:

Return value

FrxDocument

2 calls to Frx::Document()
FrxEditor::report in ./FrxEditor.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. Pass parameters or NULL to use get /post parameters.
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 120
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');
  }
}