function views_handler_filter_term_node_tid::extra_options_form

3.x views_handler_filter_term_node_tid.inc views_handler_filter_term_node_tid::extra_options_form(&$form, &$form_state)
2.x views_handler_filter_term_node_tid.inc views_handler_filter_term_node_tid::extra_options_form(&$form, &$form_state)

Provide a form for setting options.

Overrides views_handler::extra_options_form

1 call to views_handler_filter_term_node_tid::extra_options_form()
1 method overrides views_handler_filter_term_node_tid::extra_options_form()

File

modules/taxonomy/views_handler_filter_term_node_tid.inc, line 21

Class

views_handler_filter_term_node_tid
Filter by term id

Code

function extra_options_form(&$form, &$form_state) {
  $vocabularies = taxonomy_get_vocabularies();
  foreach ($vocabularies as $voc) {
    $options[$voc->vid] = check_plain($voc->name);
  }

  if ($this->options['limit']) {
    // We only do this when the form is displayed.
    if ($this->options['vid'] == 0) {
      $first_vocabulary = reset($vocabularies);
      $this->options['vid'] = $first_vocabulary->vid;
    }

    $form['vid'] = array(
      '#prefix' => '<div class="views-left-40">',
      '#suffix' => '</div>',
      '#type' => 'radios',
      '#title' => t('Vocabulary'),
      '#options' => $options,
      '#description' => t('Select which vocabulary to show terms for in the regular options.'),
      '#default_value' => $this->options['vid'],
    );
  }

  $form['markup_start'] = array(
    '#value' => '<div class="views-left-40">',
  );

  $form['type'] = array(
    '#type' => 'radios',
    '#title' => t('Selection type'),
    '#options' => array('select' => t('Dropdown'), 'textfield' => t('Autocomplete')),
    '#default_value' => $this->options['type'],
  );

  $form['hierarchy'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show hierarchy in dropdown'),
    '#default_value' => !empty($this->options['hierarchy']),
    '#process' => array('views_process_dependency'),
    '#dependency' => array('radio:options[type]' => array('select')),
  );

  $form['markup_end'] = array(
    '#value' => '</div>',
  );
}