You are here

function views_plugin_style_summary_taxonomy::options_form in Views Hacks 6

Same name and namespace in other branches
  1. 7 views_summary_taxonomy/views_plugin_style_summary_taxonomy.inc \views_plugin_style_summary_taxonomy::options_form()

File

views_summary_taxonomy/views_plugin_style_summary_taxonomy.inc, line 13

Class

views_plugin_style_summary_taxonomy

Code

function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);
  foreach (taxonomy_get_vocabularies() as $vid => $vocabulary) {
    $options[$vid] = $vocabulary->name;
  }
  $form['taxonomy'] = array(
    '#type' => 'select',
    '#default_value' => $this->options['taxonomy'],
    '#title' => t('Taxonomy'),
    '#options' => $options,
  );
  $form['count_no_aggregate'] = array(
    '#type' => 'checkbox',
    '#default_value' => $this->options['count_no_aggregate'],
    '#title' => t('If displaying record count, do not use aggregate count of parent/child terms.'),
    '#description' => t('Enable this if you apply all terms (the entire "trail") in node term hierarchy. Without this, term parents could show several times the count you expect.'),
  );
  $form['hide_zero'] = array(
    '#type' => 'checkbox',
    '#default_value' => $this->options['hide_zero'],
    '#title' => t('Hide terms with zero entries'),
  );
  if (module_exists('token')) {
    $form['path'] = array(
      '#type' => 'textfield',
      '#default_value' => $this->options['path'],
      '#title' => t('Path for term links (optional)'),
      '#description' => t('Use this to override the term paths. Otherwise, the view page path will be used. You can use any of the following tokens:'),
    );
    $form['tokens'] = array(
      '#type' => 'fieldset',
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
      '#title' => t('Tokens available'),
      '#description' => t("Tokens available for use in custom path."),
    );
    $form['tokens']['path'] = array(
      '#value' => theme('token_help', 'taxonomy'),
    );
  }
  else {
    $form['path'] = array(
      '#type' => 'value',
      '#value' => '',
    );
  }
}