function views_handler_field_contextual_links::options_form
3.x views_handler_field_contextual_links.inc | views_handler_field_contextual_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
- handlers/
views_handler_field_contextual_links.inc, line 23 - Definition of views_handler_field_contextual_links.
Class
- views_handler_field_contextual_links
- Provides a handler that adds contextual links.
Code
function options_form(&$form, &$form_state) {
$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 contextual 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 contextual action.'),
'#default_value' => $this->options['destination'],
);
}