source: sipes/modules_contrib/views/handlers/views_handler_filter_boolean_operator_string.inc @ 177a560

stableversion-3.0
Last change on this file since 177a560 was 177a560, checked in by José Gregorio Puentes <jpuentes@…>, 8 años ago

se agrego el directorio de modulos contribuidos de drupal

  • Propiedad mode establecida a 100644
File size: 780 octetos
Línea 
1<?php
2/**
3 * Simple filter to handle matching of boolean values.
4 *
5 * This handler checks to see if a string field is empty (equal to '') or not.
6 * It is otherwise identical to the parent operator.
7 *
8 * Definition items:
9 * - label: (REQUIRED) The label for the checkbox.
10 */
11class views_handler_filter_boolean_operator_string extends views_handler_filter_boolean_operator {
12  function query() {
13    $this->ensure_my_table();
14    $where = "$this->table_alias.$this->real_field ";
15
16    if (empty($this->value)) {
17      $where .= "= ''";
18      if ($this->accept_null) {
19        $where = '(' . $where . " OR $this->table_alias.$this->real_field IS NULL)";
20      }
21    }
22    else {
23      $where .= "<> ''";
24    }
25    $this->query->add_where($this->options['group'], $where);
26  }
27}
Nota: Vea TracBrowser para ayuda de uso del navegador del repositorio.