source: sipes/modules_contrib/views/handlers/views_handler_filter_boolean_operator_string.inc @ 65dadeb

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

se actualizo la version del modulo views

  • Propiedad mode establecida a 100644
File size: 817 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 *
11 * @ingroup views_filter_handlers
12 */
13class views_handler_filter_boolean_operator_string extends views_handler_filter_boolean_operator {
14  function query() {
15    $this->ensure_my_table();
16    $where = "$this->table_alias.$this->real_field ";
17
18    if (empty($this->value)) {
19      $where .= "= ''";
20      if ($this->accept_null) {
21        $where = '(' . $where . " OR $this->table_alias.$this->real_field IS NULL)";
22      }
23    }
24    else {
25      $where .= "<> ''";
26    }
27    $this->query->add_where($this->options['group'], $where);
28  }
29}
Nota: Vea TracBrowser para ayuda de uso del navegador del repositorio.