You are here

class TaxonomyDisplayTermDisplayHandlerHidden in Taxonomy display 7

Add a display handler that will hide the term when viewed.

Hierarchy

Expanded class hierarchy of TaxonomyDisplayTermDisplayHandlerHidden

1 string reference to 'TaxonomyDisplayTermDisplayHandlerHidden'
hook_taxonomy_display_save_fields_alter in ./taxonomy_display.api.php
Alter a vocabulary's taxonomy_display settings before save.

File

handlers/term/hidden.inc, line 6

View source
class TaxonomyDisplayTermDisplayHandlerHidden extends TaxonomyDisplayTermDisplayHandler {

  /**
   * Do not display anything to the user, we return an empty array.
   *
   * @see TaxonomyDisplayTermDisplayHandler::displayTerm()
   */
  public function displayTerm($term, $options = NULL) {
    return array();
  }

  /**
   * Set a description when the user selects this option.
   *
   * @see TaxonomyDisplayHandlerForm::formFieldset()
   */
  public function formFieldset(&$form, &$values, $options = NULL) {
    $form['#description'] = t('The term will not be displayed to the user when viewed. Leaving only the title and associated content.');
  }

  /**
   * Do not want anything stored, return void.
   *
   * @see TaxonomyDisplayHandlerForm::formSubmit()
   */
  public function formSubmit($form, &$values) {
  }

}

Members

Namesort descending Modifiers Type Description Overrides
TaxonomyDisplayHandlerForm::formValidate public function Perform validation on the custom formFieldset when the user submits. 1
TaxonomyDisplayTermDisplayHandlerHidden::displayTerm public function Do not display anything to the user, we return an empty array. Overrides TaxonomyDisplayTermDisplayHandler::displayTerm
TaxonomyDisplayTermDisplayHandlerHidden::formFieldset public function Set a description when the user selects this option. Overrides TaxonomyDisplayHandlerForm::formFieldset
TaxonomyDisplayTermDisplayHandlerHidden::formSubmit public function Do not want anything stored, return void. Overrides TaxonomyDisplayHandlerForm::formSubmit