You are here

public function FrxEditor::documentLinks in Forena Reports 7.4

1 call to FrxEditor::documentLinks()
FrxEditor::report in ./FrxEditor.inc
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

./FrxEditor.inc, line 1202
FrxEditor.inc Wrapper XML class for working with DOM object. It provides helper Enter description here ... @author metzlerd

Class

FrxEditor
@file FrxEditor.inc Wrapper XML class for working with DOM object. It provides helper Enter description here ... @author metzlerd

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 '';
}