You are here

function views_arg_parent_term_plugin_argument_default_parent_taxonomy_tid::options_form in Views arg parent term 7

Form builder method.

Overrides views_plugin_argument_default::options_form

File

includes/views_plugin_argument_default_parent_taxonomy_tid.inc, line 50
Definition of views_arg_parent_term_plugin_argument_default_parent_taxonomy_tid.

Class

views_arg_parent_term_plugin_argument_default_parent_taxonomy_tid
Parent 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. It will get parent terms of current term page.'),
    '#default_value' => $this->options['term_page'],
  );
  $form['root_term_page'] = array(
    '#type' => 'checkbox',
    '#title' => t("Get term's parents to root parent term"),
    '#default_value' => $this->options['root_term_page'],
    '#process' => array(
      'ctools_dependent_process',
      'form_process_checkbox',
    ),
    '#dependency' => array(
      'edit-options-argument-default-taxonomy-parent-tid-term-page' => array(
        1,
      ),
    ),
  );
  $form['term_page_anyall'] = array(
    '#type' => 'radios',
    '#title' => t('Multiple-value handling'),
    '#default_value' => $this->options['term_page_anyall'],
    '#process' => array(
      'ctools_dependent_process',
      'form_process_radios',
    ),
    '#options' => array(
      ',' => t('Filter to items that share all terms'),
      '+' => t('Filter to items that share any term'),
    ),
    '#dependency' => array(
      'edit-options-argument-default-taxonomy-parent-tid-term-page' => array(
        1,
      ),
    ),
  );
  $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['root_parent'] = array(
    '#type' => 'checkbox',
    '#title' => t("Get term's parents to root parent term"),
    '#default_value' => $this->options['root_parent'],
    '#process' => array(
      'ctools_dependent_process',
      'form_process_checkbox',
    ),
    '#dependency' => array(
      'edit-options-argument-default-taxonomy-parent-tid-node' => array(
        1,
      ),
    ),
  );
  $form['limit'] = array(
    '#type' => 'checkbox',
    '#title' => t('Limit terms by vocabulary'),
    '#default_value' => $this->options['limit'],
    '#process' => array(
      'ctools_dependent_process',
      'form_process_checkbox',
    ),
    '#dependency' => array(
      'edit-options-argument-default-taxonomy-parent-tid-node' => array(
        1,
      ),
    ),
  );
  $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-vids">',
    '#suffix' => '</div></div>',
    '#type' => 'checkboxes',
    '#title' => t('Vocabularies'),
    '#options' => $options,
    '#default_value' => $this->options['vocabularies'],
    '#process' => array(
      'ctools_dependent_process',
      'form_process_checkboxes',
    ),
    '#dependency' => array(
      'edit-options-argument-default-taxonomy-parent-tid-limit' => array(
        1,
      ),
      'edit-options-argument-default-taxonomy-parent-tid-node' => array(
        1,
      ),
    ),
  );
  $form['anyall'] = array(
    '#type' => 'radios',
    '#title' => t('Multiple-value handling'),
    '#default_value' => $this->options['anyall'],
    '#process' => array(
      'ctools_dependent_process',
      'form_process_radios',
    ),
    '#options' => array(
      ',' => t('Filter to items that share all terms'),
      '+' => t('Filter to items that share any term'),
    ),
    '#dependency' => array(
      'edit-options-argument-default-taxonomy-parent-tid-node' => array(
        1,
      ),
    ),
  );
}