public function IndexTidDepth::buildOptionsForm

Build the options form.

Overrides ArgumentPluginBase::buildOptionsForm

File

drupal/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/argument/IndexTidDepth.php, line 39
Definition of Drupal\taxonomy\Plugin\views\argument\IndexTidDepth.

Class

IndexTidDepth
Argument handler for taxonomy terms with depth.

Namespace

Drupal\taxonomy\Plugin\views\argument

Code

public function buildOptionsForm(&$form, &$form_state) {
  $form['depth'] = array(
    '#type' => 'weight',
    '#title' => t('Depth'),
    '#default_value' => $this->options['depth'],
    '#description' => t('The depth will match nodes tagged with terms in the hierarchy. For example, if you have the term "fruit" and a child term "apple", with a depth of 1 (or higher) then filtering for the term "fruit" will get nodes that are tagged with "apple" as well as "fruit". If negative, the reverse is true; searching for "apple" will also pick up nodes tagged with "fruit" if depth is -1 (or lower).'),
  );
  $form['break_phrase'] = array(
    '#type' => 'checkbox',
    '#title' => t('Allow multiple values'),
    '#description' => t('If selected, users can enter multiple values in the form of 1+2+3. Due to the number of JOINs it would require, AND will be treated as OR with this filter.'),
    '#default_value' => !empty($this->options['break_phrase']),
  );
  $form['set_breadcrumb'] = array(
    '#type' => 'checkbox',
    '#title' => t("Set the breadcrumb for the term parents"),
    '#description' => t('If selected, the breadcrumb trail will include all parent terms, each one linking to this view. Note that this only works if just one term was received.'),
    '#default_value' => !empty($this->options['set_breadcrumb']),
  );
  $form['use_taxonomy_term_path'] = array(
    '#type' => 'checkbox',
    '#title' => t("Use Drupal's taxonomy term path to create breadcrumb links"),
    '#description' => t('If selected, the links in the breadcrumb trail will be created using the standard drupal method instead of the custom views method. This is useful if you are using modules like taxonomy redirect to modify your taxonomy term links.'),
    '#default_value' => !empty($this->options['use_taxonomy_term_path']),
    '#states' => array(
      'visible' => array(
        ':input[name="options[set_breadcrumb]"]' => array(
          'checked' => TRUE,
        ),
      ),
    ),
  );
  parent::buildOptionsForm($form, $form_state);
}