summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--relation.module14
-rw-r--r--views/relation.views.inc3
2 files changed, 16 insertions, 1 deletions
diff --git a/relation.module b/relation.module
index 8e0168f..0073af3 100644
--- a/relation.module
+++ b/relation.module
@@ -455,6 +455,20 @@ function relation_get_types($types = array()) {
}
/**
+ * Returns all relation types in a way which can be used
+ * on form options.
+ */
+function relation_get_types_options() {
+ $types = relation_get_types();
+ $options = array();
+ foreach ($types as $type => $relation_type) {
+ $options[$type] = $relation_type->label;
+ }
+
+ return $options;
+}
+
+/**
* Helper function. Attaches bundles to relation type objects in an array.
*/
function _relation_get_types_bundles(&$relation_types) {
diff --git a/views/relation.views.inc b/views/relation.views.inc
index eb4b040..7d0ce65 100644
--- a/views/relation.views.inc
+++ b/views/relation.views.inc
@@ -50,7 +50,8 @@ function relation_views_data() {
'numeric' => TRUE,
),
'filter' => array(
- 'handler' => 'views_handler_filter_string',
+ 'handler' => 'views_handler_filter_in_operator',
+ 'options callback' => 'relation_get_types_options',
),
'sort' => array(
'handler' => 'views_handler_sort',