You are here

function _entityform_get_submissions_view_path in Entityform 7

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

Generates path for View based on current menu_item Adds display id on the end

Parameters

string $display_id:

Return value

string New path for View

2 calls to _entityform_get_submissions_view_path()
entityform_embed_view in ./entityform.module
Embed a view using a PHP snippet. Exactly the same as views_embed_view but adds override_path b/c View is embedded
entityform_submission_page in ./entityform.module
Page for view submission

File

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

Code

function _entityform_get_submissions_view_path($display_id) {
  $menu_item = menu_get_item();
  $menu_path = $menu_item['path'];
  $menu_path_parts = explode('/', $menu_path);
  $path_parts = explode('/', current_path());
  while (count($path_parts) > count($menu_path_parts)) {
    array_pop($path_parts);
  }
  $path_parts[] = $display_id;
  return implode('/', $path_parts);
}