diff --git a/relation.module b/relation.module index 8e0168f3ceac5a684795e75cd70370d150ad0d44..0073af33fef5d2e49eb52bbcf6630abe4d3fae67 100644 --- a/relation.module +++ b/relation.module @@ -454,6 +454,20 @@ function relation_get_types($types = array()) { return $return; } +/** + * 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. */ diff --git a/views/relation.views.inc b/views/relation.views.inc index eb4b040345f044d867ec3bd858ed1a03aba1d212..7d0ce658cfffebdf171959e1e466fb514eaa981e 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',