You are here

public function ReportEditor::getDocgen in Forena Reports 8

Same name and namespace in other branches
  1. 7.5 src/Editor/ReportEditor.php \Drupal\forena\Editor\ReportEditor::getDocgen()

Gets the array of selected document types or default if they are present.

Return value

array

1 call to ReportEditor::getDocgen()
ReportEditor::ensureDocGen in src/Editor/ReportEditor.php
Makes sure specific document types are asserted in the report document.

File

src/Editor/ReportEditor.php, line 437
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 getDocgen() {

  //build the options and default list
  $nodes = $this->simplexml->head
    ->xpath('//frx:doc');
  if ($nodes) {
    $doctypes = array();
    foreach ($nodes as $doc) {
      $doctypes[] = (string) $doc['type'];
    }
  }
  else {
    $doctypes = \Drupal::config('forena.settings')
      ->get('doc_formats');
  }

  // Verify that they are not disabled
  $supported_types = array_keys($this
    ->documentManager()
    ->getDocTypes());
  $doctypes = array_intersect($doctypes, $supported_types);
  $doctypes = array_combine($doctypes, $doctypes);
  return $doctypes;
}