/** * Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::defineOptions(). */ public function buildOptionsForm(&$form, &$form_state) { parent::buildOptionsForm($form, $form_state); // Only show fields that precede this one. $field_options = $this->getPreviousFieldLabels(); $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 link action.'), '#default_value' => $this->options['destination']); }
public function buildOptionsForm(&$form, &$form_state) { $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'], '#states' => array('visible' => array(':input[name="options[type]"]' => array('value' => 'separator')))); parent::buildOptionsForm($form, $form_state); }