function tripal_views_handler_field_aggregate::options_form

1.x tripal_views_handler_field_aggregate.inc tripal_views_handler_field_aggregate::options_form(&$form, &$form_state)

Defines the options form (form available to admin when they add a field to a view)

Overrides chado_views_handler_field::options_form

File

tripal_views/views/handlers/tripal_views_handler_field_aggregate.inc, line 33
A chado wrapper for the views_handler_field.

Class

tripal_views_handler_field_aggregate
@file A chado wrapper for the views_handler_field.

Code

function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);

  $form['format'] = array(
    '#type' => 'fieldset',
    '#title' => 'Format Output',
    '#description' => t('The following fields specify how a single result of this field will be
        displayed. When there are multiple results of this field due to aggregation, each result
        will be rendered according to the following rules and then all results will be joined
        together based on the "Display Type" indicated.')
  );

  $this->tokens = array();
  $value = array();
  foreach (array_keys($this->chado_table_description['fields']) as $field) {
    $t = '[' . $this->options['id'] . '-' . $field . ']';
    $this->tokens[$t] = t($field);
    $value[] = $t . ' == ' . $field;
  }

  $form['format']['format_string'] = array(
    '#type' => 'textfield',
    '#title' => t('Format String'),
    '#description' => 'Use any of the format tokens below to indicate what fields you want displayed.',
    '#default_value' => ($this->options['format']['format_string']) ? $this->options['format']['format_string'] : implode(', ', array_keys($this->tokens)),
  );

  $form['format']['tokens'] = array(
    '#type' => 'item',
    '#title' => 'Format Tokens',
    '#value' => implode("<br />", $value),
  );

}