You are here

function _custom_breadcrumbs_construct_view_path in Custom Breadcrumbs 6.2

Same name and namespace in other branches
  1. 7.2 custom_breadcrumbs_common.inc \_custom_breadcrumbs_construct_view_path()

Constructs the view path replacing wildcards with arguments.

Parameters

$display: The view $display object.

$viewsargs: The $view->args array.

Return value

$viewpath The complete path to the view.

3 calls to _custom_breadcrumbs_construct_view_path()
custom_breadcrumbs_paths_views_pre_render in custom_breadcrumbs_paths/custom_breadcrumbs_paths.module
Implements hook_views_pre_render().
custom_breadcrumbs_taxonomy_views_pre_render in custom_breadcrumbs_taxonomy/custom_breadcrumbs_taxonomy.module
Implements hook_views_pre_render().
custom_breadcrumbs_views_views_pre_render in custom_breadcrumbs_views/custom_breadcrumbs_views.module
Implements hook_views_pre_render().

File

./custom_breadcrumbs_common.inc, line 40
Common helper functions used by custom breadcrumbs submodules.

Code

function _custom_breadcrumbs_construct_view_path($display) {
  $bits = explode('/', $display->display_options['path']);
  $args = arg();
  foreach ($bits as $pos => $bit) {
    if (!empty($args)) {
      $arg = array_shift($args);
      if ($bit == '%') {
        $bits[$pos] = $arg;
      }
    }
  }
  if (!empty($args)) {

    // Add any additional arguments to end of path.
    $bits = array_merge($bits, $args);
  }
  $viewpath = implode('/', $bits);
  return $viewpath;
}