You are here

public function Report::render in Forena Reports 7.5

Same name and namespace in other branches
  1. 8 src/Report.php \Drupal\forena\Report::render()

Render the report

Return value

unknown_type

File

src/Report.php, line 245
Basic report provider. Controls the rendering of the report.

Class

Report

Namespace

Drupal\forena

Code

public function render($format, $render_form = TRUE, $cache_data = array()) {
  if (!$format) {
    $format = 'web';
  }

  // Only push the parameter conte
  Frx::Data()
    ->push($this->parms, 'parm');
  $this->parameters_form = array();

  // Find the Body of the report.
  $this->format = $format;
  $dom = $this->dom;

  // Trap error condition
  if (!$dom) {
    return '';
  }
  $body = $dom
    ->getElementsByTagName('body')
    ->item(0);
  $this
    ->preloadData();

  // Render the rport.
  $c = Frx::Controls('RendererBase');
  $c
    ->initReportNode($body, $this);
  if (!$this->missing_parms) {
    $c
      ->renderChildren($body, $this->html);
  }

  //$this->collapseParameters();
  if (!$this->parameters_form) {
    $this
      ->parametersForm(array(
      'collapsible' => TRUE,
      'collapsed' => $this->blocks_loaded,
    ));
  }

  // Determine the correct filter.
  $filter = variable_get('forena_input_format', 'none');
  $skinfo = Frx::Data()
    ->getContext('skin');
  if (isset($skinfo['input_format'])) {
    $filter = $skinfo['input_format'];
  }
  if (isset($this->options['input_format'])) {
    $filter = $this->options['input_format'];
  }
  if ($filter && $filter != 'none') {
    $this->html = check_markup($this->html, $filter);
  }

  // Default in dynamic title from head.
  if ($this->frx_title) {
    $title = check_plain($this->teng
      ->replace($this->frx_title));
    if ($title) {
      $title = $this->title = $title;
    }
  }
  Frx::Data()
    ->pop();
}