You are here

function references_dialog_field_attachable_query in References dialog 7

This query is used by field referneces dialog attachables.

Parameters

\stdClass $view: The view to work with.

1 string reference to 'references_dialog_field_attachable_query'
references_dialog_references_dialog_search_attachables in ./references_dialog.module
Implements hook_references_dialog_search_attachables().

File

./references_dialog.module, line 289
This the main module file.

Code

function references_dialog_field_attachable_query($view) {
  list($entity_type, $field_name, $bundle_name) = explode(':', $view->references_dialog['attachable']['name']);
  $instance = field_info_instance($entity_type, $field_name, $bundle_name);
  $field_info = field_info_field($field_name);
  $dialog_widget = references_dialog_widget_load($instance['widget']['type']);
  if (isset($dialog_widget['views_query']) && function_exists($dialog_widget['views_query'])) {
    $dialog_widget['views_query']($view, $instance, $field_info);
  }
}