Provide a form to edit options for this plugin.
Overrides PluginBase::buildOptionsForm
public function buildOptionsForm(&$form, &$form_state) {
parent::buildOptionsForm($form, $form_state);
$form['submit_button'] = array(
'#type' => 'textfield',
'#title' => t('Submit button text'),
'#default_value' => $this->options['submit_button'],
'#required' => TRUE,
);
$form['reset_button'] = array(
'#type' => 'checkbox',
'#title' => t('Include reset button (resets all applied exposed filters).'),
'#default_value' => $this->options['reset_button'],
);
$form['reset_button_label'] = array(
'#type' => 'textfield',
'#title' => t('Reset button label'),
'#description' => t('Text to display in the reset button of the exposed form.'),
'#default_value' => $this->options['reset_button_label'],
'#required' => TRUE,
'#states' => array(
'invisible' => array(
'input[name="exposed_form_options[reset_button]"]' => array(
'checked' => FALSE,
),
),
),
);
$form['exposed_sorts_label'] = array(
'#type' => 'textfield',
'#title' => t('Exposed sorts label'),
'#default_value' => $this->options['exposed_sorts_label'],
'#required' => TRUE,
);
$form['expose_sort_order'] = array(
'#type' => 'checkbox',
'#title' => t('Allow people to choose the sort order'),
'#description' => t('If sort order is not exposed, the sort criteria settings for each sort will determine its order.'),
'#default_value' => $this->options['expose_sort_order'],
);
$form['sort_asc_label'] = array(
'#type' => 'textfield',
'#title' => t('Label for ascending sort'),
'#default_value' => $this->options['sort_asc_label'],
'#required' => TRUE,
'#states' => array(
'visible' => array(
'input[name="exposed_form_options[expose_sort_order]"]' => array(
'checked' => TRUE,
),
),
),
);
$form['sort_desc_label'] = array(
'#type' => 'textfield',
'#title' => t('Label for descending sort'),
'#default_value' => $this->options['sort_desc_label'],
'#required' => TRUE,
'#states' => array(
'visible' => array(
'input[name="exposed_form_options[expose_sort_order]"]' => array(
'checked' => TRUE,
),
),
),
);
}