You are here

public function views_plugin_argument_validate_taxonomy_term::options_form in Views (for Drupal 7) 7.3

Same name and namespace in other branches
  1. 6.3 modules/taxonomy/views_plugin_argument_validate_taxonomy_term.inc \views_plugin_argument_validate_taxonomy_term::options_form()

Provide the default form for setting options.

Overrides views_plugin_argument_validate::options_form

File

modules/taxonomy/views_plugin_argument_validate_taxonomy_term.inc, line 45
Definition of views_plugin_argument_validate_taxonomy_term.

Class

views_plugin_argument_validate_taxonomy_term
Validate whether an argument is an acceptable node.

Code

public function options_form(&$form, &$form_state) {
  $vocabularies = taxonomy_get_vocabularies();
  $options = array();
  foreach ($vocabularies as $voc) {
    $options[$voc->machine_name] = check_plain($voc->name);
  }
  $form['vocabularies'] = array(
    '#type' => 'checkboxes',
    '#prefix' => '<div id="edit-options-validate-argument-vocabulary-wrapper">',
    '#suffix' => '</div>',
    '#title' => t('Vocabularies'),
    '#options' => $options,
    '#default_value' => $this->options['vocabularies'],
    '#description' => t('If you wish to validate for specific vocabularies, check them; if none are checked, all terms will pass.'),
  );
  $form['type'] = array(
    '#type' => 'select',
    '#title' => t('Filter value type'),
    '#options' => array(
      'tid' => t('Term ID'),
      'tids' => t('Term IDs separated by , or +'),
      'name' => t('Term name'),
      'convert' => t('Term name converted to Term ID'),
    ),
    '#default_value' => $this->options['type'],
    '#description' => t('Select the form of this filter value; if using term name, it is generally more efficient to convert it to a term ID and use Taxonomy: Term ID rather than Taxonomy: Term Name" as the filter.'),
  );
  $form['transform'] = array(
    '#type' => 'checkbox',
    '#title' => t('Transform dashes in URL to spaces in term name filter values'),
    '#default_value' => $this->options['transform'],
  );
}