function views_handler_field_term_node_tid::options_form

Provide "link to term" option.

Overrides views_handler_field_prerender_list::options_form

File

modules/taxonomy/views_handler_field_term_node_tid.inc, line 55

Class

views_handler_field_term_node_tid
Field handler to display all taxonomy terms of a node.

Code

public function options_form(&$form, &$form_state) {
    $form['link_to_taxonomy'] = array(
        '#title' => t('Link this field to its term page'),
        '#type' => 'checkbox',
        '#default_value' => !empty($this->options['link_to_taxonomy']),
    );
    $form['limit'] = array(
        '#type' => 'checkbox',
        '#title' => t('Limit terms by vocabulary'),
        '#default_value' => $this->options['limit'],
    );
    $options = array();
    $vocabularies = taxonomy_get_vocabularies();
    foreach ($vocabularies as $voc) {
        $options[$voc->machine_name] = check_plain($voc->name);
    }
    $form['vocabularies'] = array(
        '#prefix' => '<div><div id="edit-options-vocabularies">',
        '#suffix' => '</div></div>',
        '#type' => 'checkboxes',
        '#title' => t('Vocabularies'),
        '#options' => $options,
        '#default_value' => $this->options['vocabularies'],
        '#dependency' => array(
            'edit-options-limit' => array(
                TRUE,
            ),
        ),
    );
    parent::options_form($form, $form_state);
}