Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
unstoppablecarl committed Aug 1, 2013
1 parent 322b3a3 commit e16c875
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Navinator/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -388,12 +388,14 @@ public function prepareForBreadcrumbTemplate($currentUrl = null, $currentNode =
$currentNodeAncestorPaths = array();
if($currentNode){
if($currentNode->getDepth() === 1){
$breadcrumbData = array($currentNode->prepareForTemplate($this, array($currentNode), $currentNode, $currentNodeAncestorPaths, $filter));
return $this->flattenBreadcrumbData($breadcrumbData);
$rootParent = $currentNode;
$sortedSiblings = array($currentNode);
} else {
$currentNodeAncestorPaths = $currentNode->getAncestorPaths();
$rootParent = $currentNode->getRootParent($this);
$sortedSiblings = array($rootParent);
}

$currentNodeAncestorPaths = $currentNode->getAncestorPaths();
$rootParent = $currentNode->getRootParent($this);
if($rootParent){
$breadcrumbData = array($rootParent->prepareForTemplate($this, array($rootParent), $currentNode, $currentNodeAncestorPaths, $filter));
return $this->flattenBreadcrumbData($breadcrumbData);
Expand Down

0 comments on commit e16c875

Please sign in to comment.