You are here

function views_handler_filter_tag_font_tid::extra_options_form in @font-your-face 7.2

Same name and namespace in other branches
  1. 6.2 views/views_handler_filter_tag_font_tid.inc \views_handler_filter_tag_font_tid::extra_options_form()
  2. 7 views/views_handler_filter_tag_font_tid.inc \views_handler_filter_tag_font_tid::extra_options_form()

Provide a form for setting options.

Overrides views_handler::extra_options_form

File

modules/fontyourface_ui/views/views_handler_filter_tag_font_tid.inc, line 31
Views handler.

Class

views_handler_filter_tag_font_tid
Filter by tag id. Largely copied from views_handler_filter_term_node_tid.inc

Code

function extra_options_form(&$form, &$form_state) {
  $form['type'] = array(
    '#type' => 'radios',
    '#title' => t('Selection type'),
    '#options' => array(
      'select' => t('Dropdown'),
      'textfield' => t('Autocomplete'),
    ),
    '#default_value' => $this->options['type'],
  );
  $type_options = array(
    '*' => '-- Any --',
  );
  $type_results = db_query('SELECT DISTINCT type FROM {fontyourface_tag}');
  foreach ($type_results as $type_result) {
    $type_options[$type_result->type] = $type_result->type;
  }

  // foreach
  $form['tag_type'] = array(
    '#type' => 'radios',
    '#title' => t('Tag Type'),
    '#options' => $type_options,
    '#description' => t('Limit which type of tags to show options.'),
    '#default_value' => $this->options['tag_type'],
  );
}