You are here

public function FrxTable::configForm in Forena Reports 7.4

Returns the section Enter description here ...

Overrides FrxRenderer::configForm

File

renderers/FrxTable.inc, line 94
FrxTable Template that lays out a report in a particular table format.

Class

FrxTable
@file FrxTable Template that lays out a report in a particular table format.

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