You are here

function entityform_embed_view in Entityform 7

Same name and namespace in other branches
  1. 7.2 entityform.module \entityform_embed_view()

Embed a view using a PHP snippet. Exactly the same as views_embed_view but adds override_path b/c View is embedded

See also

views_embed_view()

1 call to entityform_embed_view()
entityform_submission_page in ./entityform.module
Page for view submission

File

./entityform.module, line 986
Module for the Entityform Entity - a starting point to create your own Entity and associated administration interface

Code

function entityform_embed_view($name, $display_id = 'default') {
  $args = func_get_args();
  array_shift($args);

  // remove $name
  if (count($args)) {
    array_shift($args);

    // remove $display_id
  }
  $view = views_get_view($name);

  // This needed so VBO will work correctly.
  $view->override_path = _entityform_get_submissions_view_path($display_id);
  if (!$view || !$view
    ->access($display_id)) {
    return;
  }
  return $view
    ->preview($display_id, $args);
}