You are here

public function FrxTable::configForm in Forena Reports 8

File

src/FrxPlugin/Template/FrxTable.php, line 96
FrxTable Template that lays out a report in a particular table format.

Class

FrxTable

Namespace

Drupal\forena\Template

Code

public function configForm($config) {

  // Load header informationi from parent config.
  $form = parent::configForm($config);
  $this
    ->weight_sort($config['columns']);
  $form['columns'] = array(
    '#theme' => 'forena_element_draggable',
    '#draggable_id' => 'FrxTable-columns',
  );
  $form['caption'] = array(
    '#type' => 'textfield',
    '#title' => t('Caption'),
    '#default_value' => @$config['caption'],
  );
  foreach ($config['columns'] as $key => $col) {
    $ctl = array();
    $ctl['label'] = array(
      '#type' => 'textfield',
      '#size' => 30,
      '#title' => t('Label'),
      '#default_value' => $col['label'],
    );
    $ctl['contents'] = array(
      '#type' => 'textfield',
      '#size' => '30',
      '#title' => t('Data'),
      '#default_value' => $col['contents'],
    );
    $ctl['include'] = array(
      '#type' => 'checkbox',
      '#title' => t('Include'),
      '#default_value' => $col['include'],
    );
    $ctl['weight'] = array(
      "#type" => 'weight',
      '#title' => t('Weight'),
      "#delta" => 50,
      '#default_value' => $col['weight'],
    );
    $form['columns'][$key] = $ctl;
  }
  return $form;
}