}
/**
+ * 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) {
'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',