1 views_handler_field_term_node_tid.inc views_handler_field_term_node_tid::options_form(&$form, &$form_state)

Provide "link to term" option.

Overrides views_handler_field_prerender_list::options_form

File

core/modules/taxonomy/views/views_handler_field_term_node_tid.inc, line 47
Definition of views_handler_field_term_node_tid.

Class

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

Code

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_vocabulary_load_multiple(FALSE);
  foreach ($vocabularies as $voc) {
    $options[$voc->machine_name] = check_plain($voc->name);
  }

  $form['vocabularies'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Vocabularies'),
    '#options' => $options,
    '#default_value' => $this->options['vocabularies'],
    '#states' => array(
      'visible' => array(
        ':input[name="options[limit]"]' => array('checked' => TRUE),
      ),
    ),

  );

  parent::options_form($form, $form_state);
}