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

Provide the default form for setting options.

Overrides views_plugin_argument_default::options_form

File

core/modules/taxonomy/views/views_plugin_argument_default_taxonomy_tid.inc, line 38
Definition of views_plugin_argument_default_taxonomy_tid.

Class

views_plugin_argument_default_taxonomy_tid
Taxonomy tid default argument.

Code

function options_form(&$form, &$form_state) {
  $form['term_page'] = array(
    '#type' => 'checkbox',
    '#title' => t('Load default filter from term page'),
    '#default_value' => $this->options['term_page'],
  );
  $form['node'] = array(
    '#type' => 'checkbox',
    '#title' => t('Load default filter from node page, that\'s good for related taxonomy blocks'),
    '#default_value' => $this->options['node'],
  );

  $form['limit'] = array(
    '#type' => 'checkbox',
    '#title' => t('Limit terms by vocabulary'),
    '#default_value' => $this->options['limit'],
    '#states' => array(
      'visible' => array(
        ':input[name="options[argument_default][taxonomy_tid][node]"]' => array('checked' => TRUE),
      ),
    ),
  );

  $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[argument_default][taxonomy_tid][limit]"]' => array('checked' => TRUE),
        ':input[name="options[argument_default][taxonomy_tid][node]"]' => array('checked' => TRUE),
      ),
    ),
  );

  $form['anyall'] = array(
    '#type' => 'radios',
    '#title' => t('Multiple-value handling'),
    '#default_value' => $this->options['anyall'],
    '#options' => array(
      ',' => t('Filter to items that share all terms'),
      '+' => t('Filter to items that share any term'),
    ),
    '#states' => array(
      'visible' => array(
        ':input[name="options[argument_default][taxonomy_tid][node]"]' => array('checked' => TRUE),
      ),
    ),
  );
}