You are here

protected function crumbs_ParentFinder::_findParentPath in Crumbs, the Breadcrumbs suite 7.2

Same name and namespace in other branches
  1. 6.2 crumbs.trail.inc \crumbs_ParentFinder::_findParentPath()
  2. 7 lib/ParentFinder.php \crumbs_ParentFinder::_findParentPath()

Parameters

string $path:

array|null &$item:

Return value

string|bool

1 call to crumbs_ParentFinder::_findParentPath()
crumbs_ParentFinder::getParentPath in lib/ParentFinder.php

File

lib/ParentFinder.php, line 58

Class

crumbs_ParentFinder
Can find a parent path for a given path. Contains a cache.

Code

protected function _findParentPath($path, &$item) {
  if ($item) {
    if (!$item['access']) {

      // Parent should be the front page.
      return FALSE;
    }
    $parent_path = $this->pluginEngine
      ->findParent($path, $item);
    if (isset($parent_path)) {
      return $parent_path;
    }
  }

  // fallback: chop off the last fragment of the system path.
  $parent_path = $this->router
    ->reducePath($path);
  return isset($parent_path) ? $parent_path : FALSE;
}