You are here

class Drupal in Forena Reports 8

Provides Drupal Rendering in a themed drupal page.

Plugin annotation


@FrxDocument(
  id= "drupal",
  name="Drupal Render Array",
  ext="drupal"
)

Hierarchy

Expanded class hierarchy of Drupal

2 string references to 'Drupal'
DataSourceDefinitionForm::buildForm in src/Form/DataSourceDefinitionForm.php
[@inheritdoc}
settings.php in data/drupal/settings.php

File

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

Namespace

Drupal\forena\FrxPlugin\Document
View source
class Drupal extends DocumentBase {
  public function header() {
    $this->write_buffer = '';
  }

  /**
   * @return array
   *   Drupal render array containing report.
   */
  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;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DocumentBase::$buffer public property
DocumentBase::$charset public property
DocumentBase::$commands protected property
DocumentBase::$content_type public property
DocumentBase::$filename protected property
DocumentBase::$file_name public property
DocumentBase::$format public property
DocumentBase::$headers public property
DocumentBase::$libraries public property
DocumentBase::$parameters_form public property
DocumentBase::$skin protected property
DocumentBase::$skin_name protected property
DocumentBase::$title public property
DocumentBase::$write_buffer protected property
DocumentBase::addAjaxCommand public function
DocumentBase::check_markup public function Wrapper function for check output to default the right type.
DocumentBase::clear public function Clear the buffer Overrides DocumentInterface::clear
DocumentBase::convertCharset public function Perform character set conversion
DocumentBase::footer public function No default footer. Overrides DocumentInterface::footer 1
DocumentBase::getAjaxCommands public function
DocumentBase::setFilename public function Overrides DocumentInterface::setFilename
DocumentBase::setSkin public function Overrides DocumentInterface::setSkin
DocumentBase::write public function Write Overrides DocumentInterface::write
Drupal::flush public function Overrides DocumentBase::flush
Drupal::header public function Default implementation to put in content type based headers. Overrides DocumentBase::header
FrxAPI::app public function Returns containing application service
FrxAPI::currentDataContext public function Get the current data context.
FrxAPI::currentDataContextArray public function
FrxAPI::dataManager public function Returns the data manager service
FrxAPI::dataService public function Return Data Service
FrxAPI::documentManager public function Returns the fornea document manager
FrxAPI::error public function Report an error
FrxAPI::getDataContext public function Get the context of a specific id.
FrxAPI::getDocument public function Get the current document
FrxAPI::getReportFileContents public function Load the contents of a file in the report file system.
FrxAPI::innerXML function Enter description here... 1
FrxAPI::popData public function Pop data off of the stack.
FrxAPI::pushData public function Push data onto the Stack
FrxAPI::report public function Run a report with a particular format. 1
FrxAPI::reportFileSystem public function Get the current report file system.
FrxAPI::setDataContext public function Set Data context by id.
FrxAPI::setDocument public function Change to a specific document type.
FrxAPI::skins public function Get list of skins.