summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--handlers/views_handler_filter_boolean_operator_string.inc17
1 files changed, 17 insertions, 0 deletions
diff --git a/handlers/views_handler_filter_boolean_operator_string.inc b/handlers/views_handler_filter_boolean_operator_string.inc
new file mode 100644
index 0000000..2bea616
--- /dev/null
+++ b/handlers/views_handler_filter_boolean_operator_string.inc
@@ -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) ? '=' : '<>') . " ''");
+ }
+}