aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--muamba.module16
-rw-r--r--views/muamba.handlers.inc16
-rw-r--r--views/muamba.views.inc (renamed from muamba.views.inc)17
3 files changed, 35 insertions, 14 deletions
diff --git a/muamba.module b/muamba.module
index 0cfe977..ccaed41 100644
--- a/muamba.module
+++ b/muamba.module
@@ -271,21 +271,11 @@ function muamba_user_delete($account) {
}
/**
- * Register View API information. This is required for your module to have
- * its include files loaded; for example, when implementing
- * hook_views_default_views().
- *
- * @return
- * An array with the following possible keys:
- * - api: (required) The version of the Views API the module implements.
- * - path: (optional) If includes are stored somewhere other than within
- * the root module directory, specify its path here.
- * - template path: (optional) A path where the module has stored it's views template files.
- * When you have specificed this key views automatically uses the template files for the views.
- * You can use the same naming conventions like for normal views template files.
+ * Implementes hook_views_data()
*/
function muamba_views_api() {
return array(
- 'api' => 3,
+ 'api' => 3,
+ 'path' => drupal_get_path('module', 'muamba') . '/views',
);
}
diff --git a/views/muamba.handlers.inc b/views/muamba.handlers.inc
new file mode 100644
index 0000000..9c5c6b9
--- /dev/null
+++ b/views/muamba.handlers.inc
@@ -0,0 +1,16 @@
+<?php
+
+/**
+ * @file
+ * Contains the muamba transaction status views field handler.
+ */
+
+class views_handler_field_muamba_status extends views_handler_field_field {
+ /**
+ * Renders the field.
+ */
+ function render($values) {
+ return $values;
+ }
+ }
+}
diff --git a/muamba.views.inc b/views/muamba.views.inc
index c1f77a0..831fe71 100644
--- a/muamba.views.inc
+++ b/views/muamba.views.inc
@@ -95,7 +95,7 @@ function muamba_views_data() {
'title' => t('Status'),
'help' => t('Transaction status'),
'field' => array(
- 'handler' => 'views_handler_field_numeric',
+ 'handler' => 'views_handler_field_muamba_status',
'click sortable' => TRUE,
),
'filter' => array(
@@ -108,3 +108,18 @@ function muamba_views_data() {
return $data;
}
+
+/**
+ * Implements hook_views_handlers()
+ */
+function muamba_views_handlers() {
+ $common = array(
+ 'parent' => 'views_handler_field',
+ 'file' => 'muamba.handlers.inc',
+ );
+ return array(
+ 'handlers' => array(
+ 'views_handler_field_muamba_status' => $common,
+ ),
+ );
+}