You are here

function views_toggle_filter_handler::options_form in Views Toggle Filter 7

Provide the basic form which calls through to subforms.

If overridden, it is best to call through to the parent, or to at least make sure all of the functions in this form are called.

Overrides views_handler_filter::options_form

File

views/views_toggle_filter_handler.inc, line 41
Definition of views_toggle_filter_handler.

Class

views_toggle_filter_handler
Views Toggle Filter handler.

Code

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

  // Lock the exposed checkbox.
  $form['expose_button']['checkbox']['checkbox']['#disabled'] = TRUE;
  $form['expose_button']['checkbox']['#attributes']['class'][] = 'element-invisible';
  $form['first_name'] = array(
    '#type' => 'textfield',
    '#title' => t('Name of the first state'),
    '#default_value' => $this->options['first_name'],
  );
  $form['second_name'] = array(
    '#type' => 'textfield',
    '#title' => t('Name of the second state'),
    '#default_value' => $this->options['second_name'],
  );
  $filters = $this
    ->get_filter_options();
  if (!empty($filters)) {
    $form['first_filters'] = array(
      '#type' => 'checkboxes',
      '#title' => t('Filters to show in the first state'),
      '#options' => $filters,
      '#default_value' => $this->options['first_filters'],
    );
    $form['second_filters'] = array(
      '#type' => 'checkboxes',
      '#title' => t('Filters to show in the second state'),
      '#options' => $filters,
      '#default_value' => $this->options['second_filters'],
    );
  }
}