/[drupal]/contributions/modules/views/handlers/views_handler_filter_equality.inc
ViewVC logotype

Contents of /contributions/modules/views/handlers/views_handler_filter_equality.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Wed Sep 10 01:08:06 2008 UTC (14 months, 2 weeks ago) by merlinofchaos
Branch: MAIN
CVS Tags: DRUPAL-6--2-7, DRUPAL-6--2-6, DRUPAL-6--2-5, DRUPAL-6--2-4, DRUPAL-6--2-3, DRUPAL-6--2-2, DRUPAL-6--2-1, DRUPAL-6--2-0, DRUPAL-6--3-0-ALPHA1, DRUPAL-6--2-0-RC5, DRUPAL-6--2-0-RC4, DRUPAL-6--2-0-RC3, DRUPAL-6--2-0-RC2, HEAD
Branch point for: DRUPAL-6--2, DRUPAL-6--3, DRUPAL-7--3
Changes since 1.1: +8 -1 lines
File MIME type: text/x-php
Some exposed filter fixes.
1 <?php
2 // $Id: views_handler_filter_equality.inc,v 1.1 2008/09/03 19:21:28 merlinofchaos Exp $
3 /**
4 * Simple filter to handle equal to / not equal to filters
5 */
6 class views_handler_filter_equality extends views_handler_filter {
7 // exposed filter options
8 var $no_single = TRUE;
9
10 /**
11 * Provide simple equality operator
12 */
13 function operator_options() {
14 return array(
15 '=' => t('Is equal to'),
16 '!=' => t('Is not equal to'),
17 );
18 }
19
20 /**
21 * Provide a simple textfield for equality
22 */
23 function value_form(&$form, &$form_state) {
24 $form['value'] = array(
25 '#type' => 'textfield',
26 '#title' => t('Value'),
27 '#size' => 30,
28 '#default_value' => $this->value,
29 );
30
31 if (!empty($form_state['exposed'])) {
32 $identifier = $this->options['expose']['identifier'];
33 if (!isset($form_state['input'][$identifier])) {
34 $form_state['input'][$identifier] = $this->value;
35 }
36 }
37 }
38 }
39

  ViewVC Help
Powered by ViewVC 1.1.2