From d21f86b8fa608ab754acf1bd68bf8721d527dbbb Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 7 Oct 2011 14:37:08 -0300 Subject: Adding views_handler_filter_muamba_status --- muamba.handlers.inc | 15 +++++++++++++++ muamba.views.inc | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) 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', -- cgit v1.2.3