You are here

public function ReportEditor::documentLinks in Forena Reports 7.5

Same name and namespace in other branches
  1. 8 src/Editor/ReportEditor.php \Drupal\forena\Editor\ReportEditor::documentLinks()
1 call to ReportEditor::documentLinks()
ReportEditor::report in src/Editor/ReportEditor.php
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.

File

src/Editor/ReportEditor.php, line 1257
ReportEditor.inc Wrapper XML class for working with DOM object. It provides helper Enter description here ... @author metzlerd

Class

ReportEditor

Namespace

Drupal\forena\Editor

Code

public function documentLinks() {
  $doctypes = array_keys(Frx::documentTypes());
  $links = array();
  $r = $this->frxReport;
  $formats = $r->formats ? $r->formats : array_filter(variable_get('forena_doc_defaults', array()));
  $parms = Frx::Data()
    ->getContext('parm');
  foreach ($doctypes as $ext) {
    if (array_search($ext, $formats) !== FALSE) {
      $links[] = array(
        'title' => strtoupper($ext),
        'href' => $this->report_link . ".{$ext}",
        'query' => $parms,
      );
    }
  }
  if ($links) {
    return array(
      '#theme' => 'links',
      '#links' => $links,
      '#attributes' => array(
        'class' => array(
          'forena-doclinks',
        ),
      ),
    );
  }
  return '';
}