You are here

function lineage_handler_field::options_form in Taxonomy Lineage 6

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

Provide formatting options for the field.

File

./lineage_handler_field.inc, line 15
Views field plugin for lineage's field handler.

Class

lineage_handler_field
Field handler for Taxonomy: Hierarchy.

Code

function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);
  $field = $this->content_field;
  $options = $this->options;
  $form['lineage'] = array(
    '#type' => 'fieldset',
    '#title' => t("Lineage string formatting options"),
  );
  $form['lineage']['strip_weights'] = array(
    '#type' => 'checkbox',
    '#title' => t('Strip weights'),
    '#default_value' => $options['lineage']['strip_weights'],
    '#description' => t("The raw lineage entries begin with a number indicating the term weight (for term ordering).  Check to remove weights for display."),
  );
  $form['lineage']['machine_safe'] = array(
    '#type' => 'checkbox',
    '#title' => t('Machine-safe'),
    '#default_value' => $options['lineage']['machine_safe'],
    '#description' => t("Reformats the lineage strings for use in machine-readable contexts.  Be sure to use an appropriate term delimiter (below) and prefix text (above) if you wish this to be a CSS class name; CSS class names must begin with a letter."),
  );
  $form['lineage']['prefix'] = array(
    '#type' => 'textfield',
    '#title' => t('Term prefix'),
    '#default_value' => $options['lineage']['prefix'],
    '#description' => t("Appended before each term name in the lineage.  You may include HTML."),
  );
  $form['lineage']['suffix'] = array(
    '#type' => 'textfield',
    '#title' => t('Term suffix'),
    '#default_value' => $options['lineage']['suffix'],
    '#description' => t("Appended before each term name in the lineage.  You may include HTML."),
  );
  $form['lineage']['delimiter'] = array(
    '#type' => 'textfield',
    '#title' => t('Delimiter between terms'),
    '#default_value' => $options['lineage']['delimiter'],
    '#description' => t("Use %linebreak_code for line breaks.", array(
      '%linebreak_code' => '\\n',
    )),
  );
}