function views_handler_filter_term_node_tid::extra_options_form

Overrides views_handler::extra_options_form

2 calls to views_handler_filter_term_node_tid::extra_options_form()
views_handler_filter_term_node_tid_depth::extra_options_form in modules/taxonomy/views_handler_filter_term_node_tid_depth.inc
Provide a form for setting options.
views_handler_filter_term_node_tid_depth_join::extra_options_form in modules/taxonomy/views_handler_filter_term_node_tid_depth_join.inc
Provide a form for setting options.
2 methods override views_handler_filter_term_node_tid::extra_options_form()
views_handler_filter_term_node_tid_depth::extra_options_form in modules/taxonomy/views_handler_filter_term_node_tid_depth.inc
Provide a form for setting options.
views_handler_filter_term_node_tid_depth_join::extra_options_form in modules/taxonomy/views_handler_filter_term_node_tid_depth_join.inc
Provide a form for setting options.

File

modules/taxonomy/views_handler_filter_term_node_tid.inc, line 72

Class

views_handler_filter_term_node_tid
Filter by term id.

Code

public function extra_options_form(&$form, &$form_state) {
    $vocabularies = taxonomy_get_vocabularies();
    $options = array();
    foreach ($vocabularies as $voc) {
        $options[$voc->machine_name] = check_plain($voc->name);
    }
    if ($this->options['limit']) {
        // We only do this when the form is displayed.
        if (empty($this->options['vocabulary'])) {
            $first_vocabulary = reset($vocabularies);
            $this->options['vocabulary'] = $first_vocabulary->machine_name;
        }
        if (empty($this->definition['vocabulary'])) {
            $form['vocabulary'] = array(
                '#type' => 'radios',
                '#title' => t('Vocabulary'),
                '#options' => $options,
                '#description' => t('Select which vocabulary to show terms for in the regular options.'),
                '#default_value' => $this->options['vocabulary'],
            );
        }
    }
    $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']),
        '#dependency' => array(
            'radio:options[type]' => array(
                'select',
            ),
        ),
    );
    $form['optgroups'] = array(
        '#type' => 'checkbox',
        '#title' => t('Show groups in dropdown'),
        '#default_value' => !empty($this->options['optgroups']),
        '#dependency' => array(
            'radio:options[type]' => array(
                'select',
            ),
        ),
    );
}