You are here

public function FrxCrosstab::configValidate in Forena Reports 8

Default configuration validator. Simply validates header and footer attributes.

Parameters

array $config: configuration

Return value

array errors in configuration.

File

src/FrxPlugin/Template/FrxCrosstab.php, line 147

Class

FrxCrosstab
Crosstab Report Template

Namespace

Drupal\forena\Template

Code

public function configValidate(&$config) {
  $errors = $this
    ->validateTextFormats($config, array(
    'header',
    'footer',
  ));
  $dims = 0;
  if (@$config['crosstab_columns']) {
    foreach ($config['crosstab_columns'] as $col) {
      if (@$col['type'] == 'value') {
        $dims++;
      }
    }
  }
  if ($dims > 1) {
    $errors[] = t('Too many value columns.  Please select only one');
  }
  return $errors;
}