Add missing .inc file
authorEarl Miles
Tue, 16 Dec 2008 19:12:27 +0000 (19:12 +0000)
committerEarl Miles
Tue, 16 Dec 2008 19:12:27 +0000 (19:12 +0000)
handlers/views_handler_filter_boolean_operator_string.inc [new file with mode: 0644]

diff --git a/handlers/views_handler_filter_boolean_operator_string.inc b/handlers/views_handler_filter_boolean_operator_string.inc
new file mode 100644 (file)
index 0000000..2bea616
--- /dev/null
@@ -0,0 +1,17 @@
+<?php
+// $Id$
+/**
+ * Simple filter to handle matching of boolean values.
+ *
+ * This handler checks to see if a string field is empty (equal to '') or not.
+ * It is otherwise identical to the parent operator.
+ *
+ * Definition items:
+ * - label: (REQUIRED) The label for the checkbox.
+ */
+class views_handler_filter_boolean_operator_string extends views_handler_filter_boolean_operator {
+  function query() {
+    $this->ensure_my_table();
+    $this->query->add_where($this->options['group'], "$this->table_alias.$this->real_field " . (empty($this->value) ? '=' : '<>') . " ''");
+  }
+}