function chado_views_handler_field::options_form

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

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

Overrides views_handler_field::options_form

2 calls to chado_views_handler_field::options_form()
tripal_views_handler_field_aggregate::options_form in tripal_views/views/handlers/tripal_views_handler_field_aggregate.inc
Defines the options form (form available to admin when they add a field to a view)
tripal_views_handler_field_sequence::options_form in tripal_views/views/handlers/tripal_views_handler_field_sequence.inc
Defines the options form (form available to admin when they add a field to a view)
2 methods override chado_views_handler_field::options_form()
tripal_views_handler_field_aggregate::options_form in tripal_views/views/handlers/tripal_views_handler_field_aggregate.inc
Defines the options form (form available to admin when they add a field to a view)
tripal_views_handler_field_sequence::options_form in tripal_views/views/handlers/tripal_views_handler_field_sequence.inc
Defines the options form (form available to admin when they add a field to a view)

File

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

Class

chado_views_handler_field
@file A chado wrapper for the views_handler_field.

Code

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

  // Add a link to node checkbox
  // but only if this base table is linked to a node and this field is from the base_table
  if (tripal_core_is_tripal_node_type($this->table) && $this->table == $this->view->base_table) {
    // If there is a Node: NID field then show a link to node checkbox
    if (isset($this->view->display['default']->display_options['fields']['nid'])) {
      $form['link_to_node'] = array(
        '#type' => 'checkbox',
        '#title' => t('Link to Node'),
        '#description' => t('If a given row is associated with a drupal node then '
          . 'this field will appear as a link, linking the user to that node. Otherwise,'
          . ' no link will be displayed.'),
        '#default_value' => $this->options['link_to_node'],
      );
    }
    // Otherwise inform the user that they need to add a Node:Nid field
    // to get this functionality
    else {
      $form['link_to_node'] = array(
        '#type' => 'item',
        '#value' => "This field has the ability to link to it's corresponding node. "
          . "However, you first need to add the NID field associated with the node. "
          . "Simple set the NID field to hidden when adding it to ensure it's not "
          . "shown in the resulting view."
      );
    }
  }

  $form['type'] = array(
    '#type' => 'radios',
    '#title' => t('Display type'),
    '#options' => array(
      'ul' => t('Unordered list'),
      'ol' => t('Ordered list'),
      'separator' => t('Simple separator'),
    ),
    '#default_value' => $this->options['type'],
  );

  $form['separator'] = array(
    '#type' => 'textfield',
    '#title' => t('Separator'),
    '#default_value' => $this->options['separator'],
    '#process' => array('views_process_dependency'),
    '#dependency' => array('radio:options[type]' => array('separator')),
  );
}