You are here

function cshs_handler_filter_term_node_tid::expose_form in Client-side Hierarchical Select 7

Define the form which is displayed, when this filter is set to "exposed".

Overrides views_handler_filter_term_node_tid::expose_form

File

includes/handlers/cshs_handler_filter_term_node_tid.inc, line 36
Definition of cshs_handler_filter_term_node_tid.

Class

cshs_handler_filter_term_node_tid
Filter by term id (including selection by client-side hierarchical select).

Code

function expose_form(&$form, &$form_state) {
  parent::expose_form($form, $form_state);

  // Disable the "multiple" option in the exposed form settings.
  $form['expose']['multiple']['#access'] = FALSE;

  // Add a textfield for labels per level.
  $form['level_labels'] = array(
    '#type' => 'textfield',
    '#title' => t('Labels per hierarchy-level'),
    '#description' => t('Enter labels for each hierarchy-level separated by comma.'),
    '#default_value' => isset($this->options['level_labels']) ? $this->options['level_labels'] : '',
  );
}