aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2011-10-07 14:37:08 -0300
committerSilvio Rhatto <rhatto@riseup.net>2011-10-07 14:37:08 -0300
commitd21f86b8fa608ab754acf1bd68bf8721d527dbbb (patch)
tree5e83c5e2e36aac2b16f7c9d30f7534458e174fbf
parent7cc74e2836e65871d674bb91394d4992546556b7 (diff)
downloadmuamba-d21f86b8fa608ab754acf1bd68bf8721d527dbbb.tar.gz
muamba-d21f86b8fa608ab754acf1bd68bf8721d527dbbb.tar.bz2
Adding views_handler_filter_muamba_status
-rw-r--r--muamba.handlers.inc15
-rw-r--r--muamba.views.inc2
2 files changed, 16 insertions, 1 deletions
diff --git a/muamba.handlers.inc b/muamba.handlers.inc
index 2f5d9a7..37033ee 100644
--- a/muamba.handlers.inc
+++ b/muamba.handlers.inc
@@ -5,6 +5,9 @@
* Contains the muamba transaction status views field handler.
*/
+/**
+ * Field handler for muamba transaction status.
+ */
class views_handler_field_muamba_status extends views_handler_field {
/**
* Renders the field.
@@ -13,3 +16,15 @@ class views_handler_field_muamba_status extends views_handler_field {
return muamba_statuses($values->muamba_status);
}
}
+
+/**
+ * Filter by transaction status
+ */
+class views_handler_filter_muamba_status extends views_handler_filter_in_operator {
+ function get_value_options() {
+ if (!isset($this->value_options)) {
+ $this->value_title = t('Transaction status');
+ $this->value_options = muamba_statuses();
+ }
+ }
+}
diff --git a/muamba.views.inc b/muamba.views.inc
index 05e2980..9eea803 100644
--- a/muamba.views.inc
+++ b/muamba.views.inc
@@ -99,7 +99,7 @@ function muamba_views_data() {
'click sortable' => TRUE,
),
'filter' => array(
- 'handler' => 'views_handler_filter_numeric',
+ 'handler' => 'views_handler_filter_muamba_status',
),
'sort' => array(
'handler' => 'views_handler_sort',