You are here

public function Drupal::flush in Forena Reports 8

Return value

array Drupal render array containing report.

Overrides DocumentBase::flush

File

src/FrxPlugin/Document/Drupal.php, line 29
Drupal.inc Standard web document manager @author metzlerd

Class

Drupal
Provides Drupal Rendering in a themed drupal page.

Namespace

Drupal\forena\FrxPlugin\Document

Code

public function flush() {
  $content = [];

  // Set Dynamic title for the page
  if ($this->title) {
    $content['#title'] = $this->title;
  }

  // Add the parameters form
  if ($this->parameters_form) {
    $content['parameters'] = $this->parameters_form;
  }

  // Add the skin library references
  if ($this->skin_name) {
    if (!empty($this->skin->info['library'])) {
      $content['#attached']['library'][] = 'forena/skin.' . $this->skin_name;
    }
    if (!empty($this->skin->info['libraries'])) {
      foreach ($this->skin->info['libraries'] as $library) {
        $content['#attached']['library'][] = $library;
      }
    }
  }

  // Add the content.
  $content['report']['#type'] = 'inline_template';
  $content['report']['#context'] = [];
  $content['report']['#template'] = $this->write_buffer;
  return $content;
}