You are here

protected function AjaxPageControllerBase::modalReport in Forena Reports 8

Render a forena report in a modal

Parameters

string $section: The id of the section where the report goes.

string $title: Title of modal window

string $report: The name of the report to render.

array $options: Modal dialog options.

File

src/Controller/AjaxPageControllerBase.php, line 567

Class

AjaxPageControllerBase

Namespace

Drupal\forena\Controller

Code

protected function modalReport($section, $report, $title = '', $options = []) {

  /** @var Forena $forena */
  $forena = \Drupal::service('forena.reports');
  if ($this->jsMode == 'nojs') {
    $this
      ->report($section, $report);
  }
  else {
    $this->modal_content = $forena
      ->report($report, $this->parms);
    if (!isset($options['draggable'])) {
      $options['draggable'] = TRUE;
    }
    $this
      ->getModalForm($section, ReportModalForm::class, $title, $options);
  }
}