hidden.inc 924 Bytes
Newer Older
Cody Craven's avatar
Cody Craven committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
// $Id$

/**
 * Add a display handler that will hide the term when viewed.
 */
class TaxonomyDisplayTermDisplayHandlerHidden extends TaxonomyDisplayTermDisplayHandler {
  /**
   * Do not display anything to the user, we return an empty string.
   *
   * @see TaxonomyDisplayTermDisplayHandler::displayTerm()
   */
  public function displayTerm($term, $options) {
    return '';
  }

  /**
   * Set a description when the user selects this option.
   *
   * @see TaxonomyDisplayHandlerForm::formFieldset()
   */
  public function formFieldset(&$form, &$form_state) {
    $form['#description'] = t('By selecting this option 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, &$form_state) {
    return;
  }
}