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

Default options form that provides the label widget that all fields should have.

Overrides views_handler_field::options_form

File

core/modules/views/handlers/views_handler_field_links.inc, line 28
Definition of views_handler_field_links.

Class

views_handler_field_links
Provides a handler that adds a field of links.

Code

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

  // Most style settings don't apply to an array of links.
  $form['style_settings']['#access'] = FALSE;
  $form['alter']['#access'] = FALSE;

  $all_fields = $this->view->display_handler->get_field_labels();
  // Offer to include only those fields that follow this one.
  $field_options = array_slice($all_fields, 0, array_search($this->options['id'], array_keys($all_fields)));
  $form['fields'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Fields'),
    '#description' => t('Fields to be included as links.'),
    '#options' => $field_options,
    '#default_value' => $this->options['fields'],
  );
  $form['destination'] = array(
    '#type' => 'checkbox',
    '#title' => t('Include destination'),
    '#description' => t('Include a "destination" parameter in the link to return the user to the original view upon completing the action.'),
    '#default_value' => $this->options['destination'],
  );
}