You are here

function references_dialog_search_view in References dialog 7

Menu callback for fetching a search view.

Parameters

$view_name a view to use.:

$display_name the display name.:

$instance_info information aboutythe current display in a packed form.:

1 string reference to 'references_dialog_search_view'
references_dialog_plugin_display::execute_hook_menu in views/references_dialog_plugin_display.inc

File

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

Code

function references_dialog_search_view($view_name, $display_name, $attachable) {
  $args = func_get_args();
  $args = array_slice($args, 3);
  $view = views_get_view($view_name);

  // Find the entity that matches our base table.
  $entities = entity_get_info();
  foreach ($entities as $entity_type => $entity_info) {
    if ($entity_info['base table'] == $view->base_table) {
      break;
    }
  }

  // Add some nice data about our field that the display handler can use.
  $view->references_dialog = array(
    'attachable' => references_dialog_get_attachable($entity_type, $attachable) + array(
      'name' => $attachable,
    ),
  );
  return $view
    ->execute_display($display_name, $args);
}