Skip to content

Commit

Permalink
Added functionality for $after paramenter in addCrumbs() method
Browse files Browse the repository at this point in the history
  • Loading branch information
sreichel authored and colinmollenhour committed Jan 3, 2018
1 parent 5ed4a51 commit 1645688
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/code/core/Mage/Page/Block/Html/Breadcrumbs.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,12 @@ public function addCrumb($crumbName, $crumbInfo, $after = false)
{
$this->_prepareArray($crumbInfo, array('label', 'title', 'link', 'first', 'last', 'readonly'));
if ((!isset($this->_crumbs[$crumbName])) || (!$this->_crumbs[$crumbName]['readonly'])) {
$this->_crumbs[$crumbName] = $crumbInfo;
if ($after && isset($this->_crumbs[$after])) {
$offset = array_search($after, array_keys($this->_crumbs)) + 1;
$this->_crumbs = array_slice($this->_crumbs, 0, $offset, true) + array($crumbName => $crumbInfo) + array_slice($this->_crumbs, $offset, null, true);
} else {
$this->_crumbs[$crumbName] = $crumbInfo;
}
}
return $this;
}
Expand Down

0 comments on commit 1645688

Please sign in to comment.